Clean-up: common: rename local variables in PERROR
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 31 Mar 2021 14:46:20 +0000 (10:46 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 13 Apr 2021 20:21:25 +0000 (16:21 -0400)
commit0c818c97b35a36971c326171d9aea5b0a432ced9
treea64103d3d662c10b8ed293cded4bec5127d55ffd
parent9de37b2bb179ef4bc729ab3abc3c47400012a960
Clean-up: common: rename local variables in PERROR

If PERROR is used in a function where a `buf` or `tmp` variable already
exists, we get this when enabling -Wshadow:

      CC       poll.lo
    In file included from /home/simark/src/lttng-tools/src/common/compat/poll.c:15:
    /home/simark/src/lttng-tools/src/common/compat/poll.c: In function ‘compat_epoll_set_max_size’:
    /home/simark/src/lttng-tools/src/common/error.h:247:9: error: declaration of ‘buf’ shadows a previous local [-Werror=shadow]
      247 |   char *buf; \
          |         ^~~
    /home/simark/src/lttng-tools/src/common/compat/poll.c:335:3: note: in expansion of macro ‘PERROR’
      335 |   PERROR("read set max size");
          |   ^~~~~~
    /home/simark/src/lttng-tools/src/common/compat/poll.c:313:7: note: shadowed declaration is here
      313 |  char buf[64];
          |       ^~~

Avoid that by giving PERROR's variables names that are unlikely to be
used elsewhere.

Change-Id: I167491fd3b232e6cfd86d13c0003ad4facb40c58
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/error.h
tests/utils/utils.h
This page took 0.033942 seconds and 4 git commands to generate.