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>
-Wold-style-definition dnl
-Wstrict-prototypes dnl
-Wshadow dnl
+ -Wno-gnu-folding-constant dnl
],
[WARN_CFLAGS],
[-Werror])