Re: [PATCH bpf-next v2] tools: bpftool: fix variable shadowing in emit_obj_refs_json()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/23/20 11:36 PM, Quentin Monnet wrote:
Building bpftool yields the following complaint:

     pids.c: In function 'emit_obj_refs_json':
     pids.c:175:80: warning: declaration of 'json_wtr' shadows a global declaration [-Wshadow]
       175 | void emit_obj_refs_json(struct obj_refs_table *table, __u32 id, json_writer_t *json_wtr)
           |                                                                 ~~~~~~~~~~~~~~~^~~~~~~~
     In file included from pids.c:11:
     main.h:141:23: note: shadowed declaration is here
       141 | extern json_writer_t *json_wtr;
           |                       ^~~~~~~~

Let's rename the variable.

v2:
- Rename the variable instead of calling the global json_wtr directly.

Signed-off-by: Quentin Monnet <quentin@xxxxxxxxxxxxx>

Applied, thanks!



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux