From: Michael Jeanson Date: Mon, 7 Mar 2022 19:02:29 +0000 (-0500) Subject: configure: add '-Wnull-dereference' to warning flags X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6ce1601f8fbd14fed32790e3e58fe11ecdf07183;p=lttng-tools.git configure: add '-Wnull-dereference' to warning flags Change-Id: Ife5ad6963262c5c2715954fcd34c94015fb30aa6 Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/configure.ac b/configure.ac index 663636258..c04a3cbb8 100644 --- a/configure.ac +++ b/configure.ac @@ -59,6 +59,7 @@ AC_TYPE_UINT8_T # WARN_CFLAGS and WARN_CXXFLAGS. m4_define([WARN_FLAGS_COMMON_LIST], [ dnl -Wall dnl + -Wnull-dereference dnl dnl We currently get this warning when building with Clang: dnl dnl /usr/include/setjmp.h:54:12: error: declaration of built-in function '__sigsetjmp' requires the declaration of the 'jmp_buf' type, commonly provided in the header . [-Werror,-Wincomplete-setjmp-declaration] diff --git a/src/common/Makefile.am b/src/common/Makefile.am index d29a37d98..2ba44fa52 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -249,7 +249,12 @@ libfilter_la_SOURCES = \ BUILT_SOURCES += filter/filter-parser.hpp -libfilter_la_CXXFLAGS = -include filter-symbols.h $(AM_CXXFLAGS) +# Disable some warning flags for generated sources. +FILTER_WARN_FLAGS = \ + -Wno-null-dereference + +libfilter_la_CFLAGS = $(AM_CFLAGS) $(FILTER_WARN_FLAGS) +libfilter_la_CXXFLAGS = -include filter-symbols.h $(AM_CXXFLAGS) $(FILTER_WARN_FLAGS) libfilter_la_CPPFLAGS = -I$(srcdir)/filter -I$(builddir)/filter $(AM_CPPFLAGS) libfilter_la_LIBADD = libstring-utils.la diff --git a/src/common/trigger.cpp b/src/common/trigger.cpp index 3782f49ca..2796903fc 100644 --- a/src/common/trigger.cpp +++ b/src/common/trigger.cpp @@ -374,6 +374,7 @@ bool lttng_trigger_is_equal( bool lttng_trigger_is_hidden(const struct lttng_trigger *trigger) { + LTTNG_ASSERT(trigger); return trigger->is_hidden; }