[DPDK/core Bug 1742] trace: duplicate shadow of same variable
bugzilla at dpdk.org
bugzilla at dpdk.org
Thu Jul 3 19:03:15 CEST 2025
https://bugs.dpdk.org/show_bug.cgi?id=1742
Bug ID: 1742
Summary: trace: duplicate shadow of same variable
Product: DPDK
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: minor
Priority: Normal
Component: core
Assignee: dev at dpdk.org
Reporter: stephen at networkplumber.org
Target Milestone: ---
The variable name 'trace' is used in different places and will get flagged as
warning with -Wshadow. Confusing and error prone
[48/3418] Compiling C object lib/librte_eal.a.p/eal_common_eal_common_trace.c.o
../lib/eal/common/eal_common_trace.c: In function ‘trace_lcore_mem_dump’:
../lib/eal/common/eal_common_trace.c:273:23: warning: declaration of ‘trace’
shadows a global declaration [-Wshadow]
273 | struct trace *trace = trace_obj_get();
| ^~~~~
../lib/eal/common/eal_common_trace.c:27:21: note: shadowed declaration is here
27 | static struct trace trace = { .args =
STAILQ_HEAD_INITIALIZER(trace.args), };
| ^~~~~
../lib/eal/common/eal_common_trace.c: In function ‘rte_trace_dump’:
../lib/eal/common/eal_common_trace.c:298:34: warning: declaration of ‘tp_list’
shadows a global declaration [-Wshadow]
298 | struct trace_point_head *tp_list = trace_list_head_get();
| ^~~~~~~
../lib/eal/common/eal_common_trace.c:26:32: note: shadowed declaration is here
26 | static struct trace_point_head tp_list =
STAILQ_HEAD_INITIALIZER(tp_list);
| ^~~~~~~
../lib/eal/common/eal_common_trace.c:299:23: warning: declaration of ‘trace’
shadows a global declaration [-Wshadow]
299 | struct trace *trace = trace_obj_get();
| ^~~~~
../lib/eal/common/eal_common_trace.c:27:21: note: shadowed declaration is here
27 | static struct trace trace = { .args =
STAILQ_HEAD_INITIALIZER(trace.args), };
| ^~~~~
../lib/eal/common/eal_common_trace.c: In function
‘__rte_trace_mem_per_thread_alloc’:
../lib/eal/common/eal_common_trace.c:334:23: warning: declaration of ‘trace’
shadows a global declaration [-Wshadow]
334 | struct trace *trace = trace_obj_get();
| ^~~~~
../lib/eal/common/eal_common_trace.c:27:21: note: shadowed declaration is here
27 | static struct trace trace = { .args =
STAILQ_HEAD_INITIALIZER(trace.args), };
| ^~~~~
../lib/eal/common/eal_common_trace.c: In function ‘trace_mem_per_thread_free’:
../lib/eal/common/eal_common_trace.c:411:23: warning: declaration of ‘trace’
shadows a global declaration [-Wshadow]
411 | struct trace *trace = trace_obj_get();
| ^~~~~
../lib/eal/common/eal_common_trace.c:27:21: note: shadowed declaration is here
27 | static struct trace trace = { .args =
STAILQ_HEAD_INITIALIZER(trace.args), };
| ^~~~~
../lib/eal/common/eal_common_trace.c: In function ‘trace_mem_free’:
../lib/eal/common/eal_common_trace.c:441:23: warning: declaration of ‘trace’
shadows a global declaration [-Wshadow]
441 | struct trace *trace = trace_obj_get();
| ^~~~~
../lib/eal/common/eal_common_trace.c:27:21: note: shadowed declaration is here
27 | static struct trace trace = { .args =
STAILQ_HEAD_INITIALIZER(trace.args), };
| ^~~~~
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20250703/30407158/attachment.htm>
More information about the dev
mailing list