Created attachment 150783 [details] Fix net/dpdk build with clang 3.5.0 The net/dpdk port fails to compile with clang 3.5.0, due to the following -Werror warnings: /wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:93:38: error: size argument in 'strncmp' call is a comparison [-Werror,-Wmemsize-comparison] sizeof(devargs->virtual.drv_name) != 0)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ /wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:92:6: note: did you mean to compare the result of 'strncmp' instead? if (strncmp(devargs->virtual.drv_name, "eth_ring1", ^ /wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:93:4: note: explicitly cast the argument to size_t to silence this warning sizeof(devargs->virtual.drv_name) != 0)) ^ (size_t)( ) /wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:95:69: error: size argument in 'strncmp' call is a comparison [-Werror,-Wmemsize-comparison] if (strncmp(devargs->args, "k1=val,k2=val2", sizeof(devargs->args) != 0)) ~~~~~~~~~~~~~~~~~~~~~~^~~~ /wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:95:6: note: did you mean to compare the result of 'strncmp' instead? if (strncmp(devargs->args, "k1=val,k2=val2", sizeof(devargs->args) != 0)) ^ ~ ) /wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:95:47: note: explicitly cast the argument to size_t to silence this warning if (strncmp(devargs->args, "k1=val,k2=val2", sizeof(devargs->args) != 0)) ^ (size_t)( ) /wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:108:55: error: size argument in 'strncmp' call is a comparison [-Werror,-Wmemsize-comparison] if (strncmp(devargs->args, "", sizeof(devargs->args) != 0)) ~~~~~~~~~~~~~~~~~~~~~~^~~~ /wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:108:6: note: did you mean to compare the result of 'strncmp' instead? if (strncmp(devargs->args, "", sizeof(devargs->args) != 0)) ^ ~ ) /wrkdirs/usr/ports/net/dpdk/work/dpdk-1.7.1/app/test/test_devargs.c:108:33: note: explicitly cast the argument to size_t to silence this warning if (strncmp(devargs->args, "", sizeof(devargs->args) != 0)) ^ (size_t)( ) 3 errors generated. Clang has found a bug in this code: the parentheses for the strncmp() call are incorrectly placed. Fix this by moving the parentheses to before the != operator.
Maintainer CC'd
(In reply to Bugzilla Automation from comment #1) > Maintainer CC'd This issue has been fixed in the latest DPDK codebase, with a new release (v1.8) due within days. Once the release is done, the DPDK port can be updated to that to get compilation support with clang 3.5
Bruce submitted dpdk 1.8.0 to me, and it's on ports tree now, You can update your ports tree, and try it later, thanks.