From: Simon Marchi Date: Thu, 22 Feb 2024 02:23:03 +0000 (-0500) Subject: bt2: compile `native_bt.c` with `-Wno-undef` X-Git-Url: https://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=9ade9a3bbc773a70ee8e1d4eae8e712b2cdb5938 bt2: compile `native_bt.c` with `-Wno-undef` As explained in the comment, work around a problem with SWIG 4.2.0. Change-Id: Ia95fc1e4929591a0a16df48892b05f5e5df46be3 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/11849 Tested-by: jenkins Reviewed-by: Michael Jeanson --- diff --git a/src/bindings/python/bt2/Makefile.am b/src/bindings/python/bt2/Makefile.am index 7d58b732..77b3bec5 100644 --- a/src/bindings/python/bt2/Makefile.am +++ b/src/bindings/python/bt2/Makefile.am @@ -127,6 +127,14 @@ WARN_CFLAGS += -Wno-redundant-decls WARN_CFLAGS += -Wno-missing-field-initializers WARN_CFLAGS += -Wno-unused-parameter +# SWIG 4.2.0 generates: +# +# #if __cplusplus >=201103L +# +# ... leading to some `-Wundef` warnings when building the extension as C, where +# `__cplusplus` is not defined. +WARN_CFLAGS += -Wno-undef + BUILD_FLAGS=CC="$(CC)" \ CFLAGS="$(GLIB_CFLAGS) $(AM_CFLAGS) $(CFLAGS) $(WARN_CFLAGS)" \ CPPFLAGS="$(AM_CPPFLAGS) $(CPPFLAGS) -I$(srcdir)/bt2" \