Page MenuHomeFreeBSD

Fix compile error in devel/libpru
Needs ReviewPublic

Authored by oskar.holmlund_ohdata.se on Jun 20 2020, 6:56 PM.

Details

Reviewers
manu
Summary

@Stable libpru will compile.
@Head libpru will generate following errors:
Scanning dependencies of target pru
[ 33%] Building C object CMakeFiles/pru.dir/pru.c.o
[ 66%] Building C object CMakeFiles/pru.dir/ti-pru.c.o
/root/clean_rpaulo/libpru/ti-pru.c:505:3: error: 'memmove' will always overflow; destination buffer has size 15, but size argument is 16

[-Werror,-Wfortify-source]
          memmove(c_op2 + 1, c_op2, sizeof(c_op2));
          ^

/root/clean_rpaulo/libpru/ti-pru.c:519:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]

case TI_OP_SLP:
^

/root/clean_rpaulo/libpru/ti-pru.c:519:2: note: insert 'attribute((fallthrough));' to silence this warning

case TI_OP_SLP:
^
__attribute__((fallthrough));

/root/clean_rpaulo/libpru/ti-pru.c:519:2: note: insert 'break;' to avoid fall-through

case TI_OP_SLP:
^
break;

2 errors generated.

  • Error code 1

The mission is just to make it compile.
I have verified the binary (libpru + pructl) can load and execute a program on a PRU on AM3358 (BBBlack/PB).
I did not perform an analysis of the code for each errors but made reasonable decisions from the small context.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Skipped
Unit
Unit Tests Skipped