From ce7fc42f24c2c9a62a5eeb77f248d27a5cb4de4b Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Mon, 7 Mar 2022 14:21:21 -0500 Subject: [PATCH] configure: add '-Wundef' to warning flags MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: If47c16121b1679862e7a5f75fce70c7d9973e92e Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- configure.ac | 1 + src/bin/lttng-sessiond/modprobe.cpp | 2 +- src/bin/lttng-sessiond/ust-consumer.h | 2 +- src/bin/lttng/commands/add_context.cpp | 2 +- src/common/compat/poll.cpp | 2 +- src/common/compat/string.h | 2 +- src/common/fd-tracker/utils-poll.cpp | 2 +- tests/regression/ust/linking/demo.c | 2 +- 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index c04a3cbb8..5a63255c4 100644 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,7 @@ AC_TYPE_UINT8_T m4_define([WARN_FLAGS_COMMON_LIST], [ dnl -Wall dnl -Wnull-dereference dnl + -Wundef 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/bin/lttng-sessiond/modprobe.cpp b/src/bin/lttng-sessiond/modprobe.cpp index 4c1d62b48..9f6c4a9c3 100644 --- a/src/bin/lttng-sessiond/modprobe.cpp +++ b/src/bin/lttng-sessiond/modprobe.cpp @@ -242,7 +242,7 @@ static struct kern_modules_param *probes; static int nr_probes; static int probes_capacity; -#if HAVE_KMOD +#ifdef HAVE_KMOD #include /** diff --git a/src/bin/lttng-sessiond/ust-consumer.h b/src/bin/lttng-sessiond/ust-consumer.h index 5862c4837..4f9fca386 100644 --- a/src/bin/lttng-sessiond/ust-consumer.h +++ b/src/bin/lttng-sessiond/ust-consumer.h @@ -32,7 +32,7 @@ int ust_consumer_send_stream_to_ust(struct ust_app *app, int ust_consumer_send_channel_to_ust(struct ust_app *app, struct ust_app_session *ua_sess, struct ust_app_channel *channel); -#if HAVE_LIBLTTNG_UST_CTL +#ifdef HAVE_LIBLTTNG_UST_CTL int ust_consumer_metadata_request(struct consumer_socket *sock); #else static inline diff --git a/src/bin/lttng/commands/add_context.cpp b/src/bin/lttng/commands/add_context.cpp index 6ea53709c..4e4bb9fac 100644 --- a/src/bin/lttng/commands/add_context.cpp +++ b/src/bin/lttng/commands/add_context.cpp @@ -288,7 +288,7 @@ const struct ctx_opts { { (char *) "need_reschedule", CONTEXT_NEED_RESCHEDULE }, { (char *) "migratable", CONTEXT_MIGRATABLE }, { (char *) "callstack-kernel", CONTEXT_CALLSTACK_KERNEL }, -#if HAVE_MODULES_USERSPACE_CALLSTACK_CONTEXT +#ifdef HAVE_MODULES_USERSPACE_CALLSTACK_CONTEXT { (char *) "callstack-user", CONTEXT_CALLSTACK_USER }, #endif { (char *) "cgroup_ns", CONTEXT_CGROUP_NS }, diff --git a/src/common/compat/poll.cpp b/src/common/compat/poll.cpp index 0c40c4511..910b0f62a 100644 --- a/src/common/compat/poll.cpp +++ b/src/common/compat/poll.cpp @@ -17,7 +17,7 @@ #include "poll.h" -#if HAVE_EPOLL +#ifdef HAVE_EPOLL #include #include diff --git a/src/common/compat/string.h b/src/common/compat/string.h index fd4f2f021..4a96cb145 100644 --- a/src/common/compat/string.h +++ b/src/common/compat/string.h @@ -109,7 +109,7 @@ static inline int lttng_fls(int val) } #endif /* HAVE_FLS */ -#if HAVE_MEMRCHR +#ifdef HAVE_MEMRCHR static inline void *lttng_memrchr(const void *s, int c, size_t n) { diff --git a/src/common/fd-tracker/utils-poll.cpp b/src/common/fd-tracker/utils-poll.cpp index 4949d8160..6a0f2d9bd 100644 --- a/src/common/fd-tracker/utils-poll.cpp +++ b/src/common/fd-tracker/utils-poll.cpp @@ -9,7 +9,7 @@ #include "utils.h" -#if HAVE_EPOLL +#ifdef HAVE_EPOLL struct create_args { struct lttng_poll_event *events; diff --git a/tests/regression/ust/linking/demo.c b/tests/regression/ust/linking/demo.c index ca2c759ca..74d1d22a6 100644 --- a/tests/regression/ust/linking/demo.c +++ b/tests/regression/ust/linking/demo.c @@ -20,7 +20,7 @@ #define TRACEPOINT_DEFINE -#if TEST_DYNAMIC_LINKAGE +#ifdef TEST_DYNAMIC_LINKAGE #define TRACEPOINT_PROBE_DYNAMIC_LINKAGE #endif -- 2.34.1