From d7e2a9ad8351a542a30c7fdc603adf83249f928b Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 21 Feb 2024 21:23:03 -0500 Subject: [PATCH] bt2: compile `native_bt.c` with `-Wno-undef` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://review.lttng.org/c/babeltrace/+/11930 Reviewed-by: Jérémie Galarneau --- src/bindings/python/bt2/Makefile.am | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bindings/python/bt2/Makefile.am b/src/bindings/python/bt2/Makefile.am index 20f142e4..b74821ae 100644 --- a/src/bindings/python/bt2/Makefile.am +++ b/src/bindings/python/bt2/Makefile.am @@ -120,6 +120,14 @@ WARN_CFLAGS += -Wno-deprecated-declarations # Python 3.11 + gcc 12.2.0 gave warnings of this kind in Python.h. WARN_CFLAGS += -Wno-redundant-decls +# 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" \ -- 2.34.1