""" $ meson --werror -Dexamples=all build && ninja -C build [..] examples/qos_sched/args.c: In function 'app_parse_args': examples/qos_sched/args.c:413:28: error: implicit declaration of function 'RTE_BIT64'; did you mean 'RTE_BE64'? [-Werror=implicit-function-declaration] 413 | if (app_used_core_mask & RTE_BIT64(app_main_core)) { | ^~~~~~~~~ | RTE_BE64 examples/qos_sched/args.c:413:28: error: nested extern declaration of 'RTE_BIT64' [-Werror=nested-externs] cc1: all warnings being treated as errors """ Also reproduces with clang: """ $ meson --werror --buildtype=debugoptimized -Dexamples=all build && ninja -C build [..] examples/qos_sched/args.c:413:28: error: implicit declaration of function 'RTE_BIT64' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (app_used_core_mask & RTE_BIT64(app_main_core)) { ^ examples/qos_sched/args.c:419:24: error: implicit declaration of function 'RTE_BIT64' is invalid in C99 [-Werror,-Wimplicit-function-declaration] app_used_core_mask |= RTE_BIT64(app_main_core); ^ 2 errors generated. """ OS: Ubuntu 20.04.4 gcc: 9.3.0 clang: 10.0.0
Reproduces on version: eb0f31af87b
This is caused by backport of: commit 9c9fad3dfa042ae4b7a045cb1731f8701f8210e6 Author: Megha Ajmera <megha.ajmera@intel.com> Date: Wed Feb 23 17:36:30 2022 +0000 examples/qos_sched: fix core mask overflow Masking of core mask was incorrect. Instead of using 1U for shifting, it should be using 1LU as the result is assigned to uint64. CID 375859: Potentially overflowing expression "1U << app_main_core" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t" (64 bits, unsigned). Coverity issue: 375859 Fixes: de3cfa2c9823 ("sched: initial import") Cc: stable@dpdk.org It needs rte_bitops include added, see https://github.com/kevintraynor/dpdk-stable/commit/d33bb6bd28406944b31ad53ba90199ca5f2f114f
Sent patch here: http://inbox.dpdk.org/stable/20220308102109.161501-1-ktraynor@redhat.com/T/#u