DPDK patches and discussions
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [DPDK/core Bug 1742] trace: duplicate shadow of same variable
Date: Thu, 03 Jul 2025 17:03:15 +0000	[thread overview]
Message-ID: <bug-1742-3@https.bugs.dpdk.org/> (raw)

[-- Attachment #1: Type: text/plain, Size: 3715 bytes --]

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@dpdk.org
          Reporter: stephen@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.

[-- Attachment #2: Type: text/html, Size: 5583 bytes --]

                 reply	other threads:[~2025-07-03 17:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-1742-3@https.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).