configure: add -Wno-gnu-folding-constant
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 23 Aug 2021 18:01:17 +0000 (14:01 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 24 Aug 2021 20:55:01 +0000 (16:55 -0400)
commitd0004d4bfc7d0f7e411b905b83da56d336768238
tree0cc5e43200eb785c573508ae35b257b208fe207e
parent39ff9b136e60b9d568278430523319749e4aae42
configure: add -Wno-gnu-folding-constant

When building with clang 12, I get:

  CC       tp.o
    In file included from /home/simark/src/lttng-tools/tests/utils/testapp/gen-ust-events/tp.c:10:
    In file included from /home/simark/src/lttng-tools/tests/utils/testapp/gen-ust-events/./tp.h:75:
    In file included from /tmp/lttng/include/lttng/tracepoint-event.h:69:
    In file included from /tmp/lttng/include/lttng/ust-tracepoint-event.h:1021:
    /home/simark/src/lttng-tools/tests/utils/testapp/gen-ust-events/./tp.h:30:1: error: variable length array folded to constant array as an extension [-Werror,-Wgnu-folding-constant]
    TRACEPOINT_EVENT(tp, tptest,
    ^
    /tmp/lttng/include/lttng/tracepoint.h:791:27: note: expanded from macro 'TRACEPOINT_EVENT'
    #define TRACEPOINT_EVENT                LTTNG_UST_TRACEPOINT_EVENT
                                            ^
    /tmp/lttng/include/lttng/ust-tracepoint-event.h:84:2: note: expanded from macro 'LTTNG_UST_TRACEPOINT_EVENT'
            LTTNG_UST__TRACEPOINT_EVENT_CLASS(_provider, _name,             \
            ^
    /tmp/lttng/include/lttng/ust-tracepoint-event.h:940:10: note: expanded from macro 'LTTNG_UST__TRACEPOINT_EVENT_CLASS'
                    size_t __dynamic_len[__num_fields];                           \
                           ^

From what I understand, this warning simply says that the compiler did
figure out that __num_fields could be known at compile-time, so
__dynamic_len ends up as a regular static array and not a variable
length array (which is what we want).  And it warns us that this
behavior is not standard C, but an extension that originated from GNU.

So I think it's fine to ignore it, as it simply warns us that the
behavior we want happens.

Change-Id: Ib7273e7f86c6b04742f8463f925cdbb1fa14041d
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
This page took 0.025154 seconds and 4 git commands to generate.