logging: ignore -Wundef in log.c
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 28 Oct 2019 18:40:16 +0000 (14:40 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 31 Oct 2019 18:11:59 +0000 (14:11 -0400)
commit156184d68ce8a9338e042908c522255e3eed800d
tree03809725762e0ebacc8a9266b40317fe27e05437
parent78deb9134e34490c8d90825d7f4778f86b96aa73
logging: ignore -Wundef in log.c

When building with -Wundef enabled, I get this warning:

    /home/smarchi/src/babeltrace/src/logging/log.c: In function ‘put_tag’:
    /home/smarchi/src/babeltrace/src/logging/log.c:455:15: error: "_BT_LOG_MESSAGE_FORMAT_MASK__TAG" is not defined, evaluates to 0 [-Werror=undef]
      _PP_CONCAT_3(_BT_LOG_MESSAGE_FORMAT_MASK_, _, field)
                   ^
    /home/smarchi/src/babeltrace/src/logging/log.c:350:30: note: in definition of macro ‘_PP_PASTE_3’
     #define _PP_PASTE_3(a, b, c) a ## b ## c
                                  ^
    /home/smarchi/src/babeltrace/src/logging/log.c:455:2: note: in expansion of macro ‘_PP_CONCAT_3’
      _PP_CONCAT_3(_BT_LOG_MESSAGE_FORMAT_MASK_, _, field)
      ^~~~~~~~~~~~
    /home/smarchi/src/babeltrace/src/logging/log.c:470:3: note: in expansion of macro ‘_BT_LOG_MESSAGE_FORMAT_MASK’
      (_BT_LOG_MESSAGE_FORMAT_MASK(field) & _BT_LOG_MESSAGE_FORMAT_FIELDS(format))
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/smarchi/src/babeltrace/src/logging/log.c:1151:6: note: in expansion of macro ‘_BT_LOG_MESSAGE_FORMAT_CONTAINS’
     #if !_BT_LOG_MESSAGE_FORMAT_CONTAINS(TAG, BT_LOG_MESSAGE_TAG_FORMAT)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

That code comes from zf_log and is a big mess of macros, I don't know
how to fix that.  However, I'd like to enable -Wundef, given that it has
found a relatively important bug (see commit 9103e903a8 "Fix: define
macros for logging levels").  So, silence -Wundef just for that
particular spot.

Change-Id: I42fece6a04c3715daea873683c350b2987c500e5
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2278
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
configure.ac
src/logging/log.c
This page took 0.025147 seconds and 4 git commands to generate.