From 011e18de205a8ce58182e59301aad48513a28c0b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 28 Mar 2023 14:41:15 -0400 Subject: [PATCH] Python bindings: warnings in generated code causes build failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Swig regularily introduces new warnings in the generated code which makes it difficult to maintain a buildable tree with -Werror. The option is disabled for this sub-project. The warnings that appear in the code generated by the current version of Swig (4.1.0) are also silenced. Signed-off-by: Jérémie Galarneau Change-Id: I008de07f67b2ce6ebedcf138de5a68c87d869af2 --- extras/bindings/swig/python/Makefile.am | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/extras/bindings/swig/python/Makefile.am b/extras/bindings/swig/python/Makefile.am index a8fd56d80..29914e5cd 100644 --- a/extras/bindings/swig/python/Makefile.am +++ b/extras/bindings/swig/python/Makefile.am @@ -7,12 +7,17 @@ lttng.i: lttng.i.in # `swig_this` shadows a global of the same name. Later versions (like 4.0.1) # have renamed this global to `Swig_This_global`. # -# Disable -Wshadow for that file. -AM_CFLAGS += -Wno-shadow - -AM_CFLAGS += -Wno-missing-field-initializers - -AM_CFLAGS += -Wno-cast-function-type +# Disable some warning flags for that file. +AM_CFLAGS += \ + -Wno-cast-function-type \ + -Wno-missing-field-initializers \ + -Wno-redundant-decls \ + -Wno-shadow \ + -Wno-unused-parameter + +# Swig regularily changes and generates code that results warnings which break +# Werror builds. Disable that option for this sub-project. +AM_CFLAGS += -Wno-error AM_CPPFLAGS += $(PYTHON_INCLUDE) -- 2.34.1