configure: add '-Wnull-dereference' to warning flags
authorMichael Jeanson <mjeanson@efficios.com>
Mon, 7 Mar 2022 19:02:29 +0000 (14:02 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 15 Mar 2022 20:59:59 +0000 (16:59 -0400)
Change-Id: Ife5ad6963262c5c2715954fcd34c94015fb30aa6
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
src/common/Makefile.am
src/common/trigger.cpp

index 663636258a25ba39bf7a9de27a08a45e4f8748c8..c04a3cbb88fe27f3bd8bf86d69a7b2062abcef8f 100644 (file)
@@ -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 <setjmp.h>. [-Werror,-Wincomplete-setjmp-declaration]
index d29a37d98d0dee8b97302dd5fd10624abda837c2..2ba44fa526291fbf0f229fc0d7f1c067eff98633 100644 (file)
@@ -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
 
index 3782f49cad19c901d709d4531d7ca5e4db679d8a..2796903fc722388245655519ce3eee5a70bb8cbd 100644 (file)
@@ -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;
 }
 
This page took 0.026537 seconds and 4 git commands to generate.