Fix -Wshadow warnings
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 28 Oct 2019 01:34:26 +0000 (21:34 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 30 Oct 2019 19:14:53 +0000 (15:14 -0400)
commit4ec8d4cd2650ba5e2865998cfbb221800c5727a1
tree4b0a01db8a6d2a5fd0aa319e29cbf702b1978e33
parentb079debfe85c962d2d6a050a5ab4e2343a5919eb
Fix -Wshadow warnings

Fix warnings of this type:

      CC       event.lo
    /home/simark/src/babeltrace/src/ctf-writer/event.c: In function ‘bt_ctf_event_common_create_fields’:
    /home/simark/src/babeltrace/src/ctf-writer/event.c:135:21: error: declaration of ‘create_field_func’ shadows a global declaration [-Werror=shadow]
      135 |   create_field_func create_field_func,
          |   ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
    In file included from /home/simark/src/babeltrace/src/ctf-writer/event.c:45:
    /home/simark/src/babeltrace/src/ctf-writer/event.h:89:17: note: shadowed declaration is here
       89 | typedef void *(*create_field_func)(void *);
          |                 ^~~~~~~~~~~~~~~~~

Simply rename the types so they don't have the same name as the
parameters, suffix the types with `_type`.

I have added -Wno-shadow when building native_bt.c (in the Python
bindings), see the comment in Makefile.am for more details.

Change-Id: I5335d54f9a005d0cd4790f603ed3b1cda9645a93
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2271
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
configure.ac
src/bindings/python/bt2/Makefile.am
src/ctf-writer/event.c
src/ctf-writer/event.h
This page took 0.024745 seconds and 4 git commands to generate.