trace: fix build with clang 21
PATCH 1/1 trace: fix build with clang 21
This was caught with recent clang.
The RTE_TRACE_POINT_ARGS() macro expects at least one parameter. As a (void) function does not require any special tweaking with __rte_unused, we can simply replace with a direct (void) token.
Build dir: /export/dpdk-next-net-mrvl/build-clang-static Project version: 25.11.0-rc1
C compiler for the host machine: ccache clang (clang 21.1.4
"clang version 21.1.4")
In file included from ../lib/eal/common/eal_common_trace_points.c:7:../lib/eal/include/rte_eal_trace.h:23:2: error: attribute 'unused'
cannot be applied to a 'void' parameter [-Werror,-Wignored-attributes]
23 | RTE_TRACE_POINT_ARGS(void),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/eal/include/rte_trace_point_register.h:46:3: note: expanded
from macro 'RTE_TRACE_POINT_ARGS'
46 | (RTE_TRACE_POINT_ARGS_(RTE_TRACE_POINT_ARGS_COUNT(0,
__VA_ARGS__), __VA_ARGS__))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/eal/include/rte_trace_point_register.h:44:30: note: expanded
from macro 'RTE_TRACE_POINT_ARGS_'
44 | RTE_TRACE_POINT_ARGS_EXPAND(RTE_TRACE_POINT_ARGS_FUNC
(N))(__VA_ARGS__)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~../lib/eal/include/rte_trace_point_register.h:41:38: note: expanded
from macro 'RTE_TRACE_POINT_ARGS_FUNC'
41 | #define RTE_TRACE_POINT_ARGS_FUNC(a) RTE_TRACE_POINT_ARGS_ ## a
| ^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0
to see all)../lib/eal/include/rte_trace_point_register.h:42:42: note: expanded
from macro 'RTE_TRACE_POINT_ARGS_EXPAND'
42 | #define RTE_TRACE_POINT_ARGS_EXPAND(...) __VA_ARGS__
| ^../lib/eal/include/rte_trace_point_register.h:26:35: note: expanded
from macro 'RTE_TRACE_POINT_ARGS_1'
26 | #define RTE_TRACE_POINT_ARGS_1(a) __rte_unused a
| ^~~~~~~~~~~~
../lib/eal/include/rte_common.h:248:37: note: expanded
from macro '__rte_unused'
248 | #define __rte_unused __attribute__((__unused__))
| ^~~~~~~~~~
1 error generated.
--- app/test/test_trace.h | 2 +- lib/eal/include/rte_eal_trace.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
app/test/test_trace.h +1 -1
@@ -13,5 +13,5 @@ RTE_TRACE_POINT( RTE_TRACE_POINT_FP( app_dpdk_test_fp, - RTE_TRACE_POINT_ARGS(void), + (void), )
lib/eal/include/rte_eal_trace.h +1 -1
@@ -20,7 +20,7 @@ extern "C" {/* Generic */ RTE_TRACE_POINT ( rte_eal_trace_generic_void, - RTE_TRACE_POINT_ARGS(void), + (void), ) RTE_TRACE_POINT(
Signature · 1 line
2.51.0
Quoted 7 lines · David Marchand
This was caught with recent clang.
TheRTE_TRACE_POINT_ARGS()macro expects at least one parameter. As a (void) function does not require any special tweaking with__rte_unused, we can simply replace with a direct (void) token.Build dir: /export/dpdk-next-net-mrvl/build-clang-static
This can be removed.
Add Fixes: if possible.
Quoted 78 lines
Project version: 25.11.0-rc1
C compiler for the host machine: ccache clang (clang 21.1.4"clang version 21.1.4")In file included from
../lib/eal/common/eal_common_trace_points.c:7:../lib/eal/include/rte_eal_trace.h:23:2: error: attribute 'unused'
cannot be applied to a 'void' parameter [-Werror,-Wignored-attributes]23 | RTE_TRACE_POINT_ARGS(void), | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ../lib/eal/include/rte_trace_point_register.h:46:3: note: expanded from macro 'RTE_TRACE_POINT_ARGS' 46 | (RTE_TRACE_POINT_ARGS_(RTE_TRACE_POINT_ARGS_COUNT(0, __VA_ARGS__), __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../lib/eal/include/rte_trace_point_register.h:44:30: note: expanded from macro 'RTE_TRACE_POINT_ARGS_' 44 | RTE_TRACE_POINT_ARGS_EXPAND(RTE_TRACE_POINT_ARGS_FUNC (N))(__VA_ARGS__) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
../lib/eal/include/rte_trace_point_register.h:41:38: note: expanded
from macro 'RTE_TRACE_POINT_ARGS_FUNC'
41 | #defineRTE_TRACE_POINT_ARGS_FUNC(a)RTE_TRACE_POINT_ARGS_## a
| ^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0
to see all)../lib/eal/include/rte_trace_point_register.h:42:42: note: expanded
from macro 'RTE_TRACE_POINT_ARGS_EXPAND'
42 | #defineRTE_TRACE_POINT_ARGS_EXPAND(...)__VA_ARGS__
| ^../lib/eal/include/rte_trace_point_register.h:26:35: note: expanded
from macro 'RTE_TRACE_POINT_ARGS_1'
26 | #defineRTE_TRACE_POINT_ARGS_1(a)__rte_unuseda| ^~~~~~~~~~~~
../lib/eal/include/rte_common.h:248:37: note: expanded
from macro '__rte_unused'
248 | #define__rte_unused__attribute__((__unused__))
| ^~~~~~~~~~
1 error generated.Reported-by Jerin Jacob <[email protected]>Signed-off-by David Marchand <[email protected]>--- app/test/test_trace.h | 2 +- lib/eal/include/rte_eal_trace.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)app/test/test_trace.h +1
-1@@ -13,5 +13,5 @@ RTE_TRACE_POINT( RTE_TRACE_POINT_FP( app_dpdk_test_fp, - RTE_TRACE_POINT_ARGS(void), + (void), )lib/eal/include/rte_eal_trace.h +1
-2@@ -20,7 +20,7 @@ extern "C" {/* Generic */ RTE_TRACE_POINT ( rte_eal_trace_generic_void, - RTE_TRACE_POINT_ARGS(void), + (void), ) RTE_TRACE_POINT( --2.51.0
Quoted 8 lines · Jerin Jacob
Quoted 6 lines · David Marchand
This was caught with recent clang.
TheRTE_TRACE_POINT_ARGS()macro expects at least one parameter. As a (void) function does not require any special tweaking with__rte_unused, we can simply replace with a direct (void) token.
Quoted 5 lines
Quoted 1 line
Build dir: /export/dpdk-next-net-mrvl/build-clang-static
This can be removed.
Add Fixes: if possible.
Indeed,
Quoted 1 line
Acked-by Jerin Jacob <[email protected]>
Thanks for testing.
Signature · 1 line
David Marchand
David Marchand
AppliedQuoted 42 lines · David Marchand
This was caught with recent clang.
TheRTE_TRACE_POINT_ARGS()macro expects at least one parameter. As a (void) function does not require any special tweaking with__rte_unused, we can simply replace with a direct (void) token.Build dir: /export/dpdk-next-net-mrvl/build-clang-static Project version: 25.11.0-rc1
C compiler for the host machine: ccache clang (clang 21.1.4"clang version 21.1.4")In file included from
../lib/eal/common/eal_common_trace_points.c:7:../lib/eal/include/rte_eal_trace.h:23:2: error: attribute 'unused'
cannot be applied to a 'void' parameter [-Werror,-Wignored-attributes]23 | RTE_TRACE_POINT_ARGS(void), | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ../lib/eal/include/rte_trace_point_register.h:46:3: note: expanded from macro 'RTE_TRACE_POINT_ARGS' 46 | (RTE_TRACE_POINT_ARGS_(RTE_TRACE_POINT_ARGS_COUNT(0, __VA_ARGS__), __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../lib/eal/include/rte_trace_point_register.h:44:30: note: expanded from macro 'RTE_TRACE_POINT_ARGS_' 44 | RTE_TRACE_POINT_ARGS_EXPAND(RTE_TRACE_POINT_ARGS_FUNC (N))(__VA_ARGS__) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
../lib/eal/include/rte_trace_point_register.h:41:38: note: expanded
from macro 'RTE_TRACE_POINT_ARGS_FUNC'
41 | #defineRTE_TRACE_POINT_ARGS_FUNC(a)RTE_TRACE_POINT_ARGS_## a
| ^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0
to see all)../lib/eal/include/rte_trace_point_register.h:42:42: note: expanded
from macro 'RTE_TRACE_POINT_ARGS_EXPAND'
42 | #defineRTE_TRACE_POINT_ARGS_EXPAND(...)__VA_ARGS__
| ^../lib/eal/include/rte_trace_point_register.h:26:35: note: expanded
from macro 'RTE_TRACE_POINT_ARGS_1'
26 | #defineRTE_TRACE_POINT_ARGS_1(a)__rte_unuseda
Quoted 7 lines
| ^~~~~~~~~~~~
../lib/eal/include/rte_common.h:248:37: note: expanded
from macro '__rte_unused'
248 | #define__rte_unused__attribute__((__unused__))
| ^~~~~~~~~~
1 error generated.
Quoted 4 lines
Reported-by Jerin Jacob <[email protected]>Signed-off-by David Marchand <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand