From 1970828049d051d5cb485dfab995081b4550fd2a Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 9 Mar 2022 11:32:09 -0500 Subject: [PATCH] configure: add '-Wredundant-decls' to warning flags MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I5329ebe83aab40e6796b506c28e853b4af3c5e99 Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- configure.ac | 1 + .../trigger-condition-event-matches/Makefile.am | 2 ++ src/bin/lttng-consumerd/health-consumerd.cpp | 2 +- src/bin/lttng-consumerd/health-consumerd.h | 2 +- src/bin/lttng-consumerd/lttng-consumerd.cpp | 2 +- src/bin/lttng-relayd/health-relayd.cpp | 2 +- src/bin/lttng-relayd/health-relayd.h | 2 +- src/bin/lttng-relayd/main.cpp | 2 +- src/bin/lttng-sessiond/cmd.h | 2 -- src/common/Makefile.am | 3 ++- src/common/consumer/consumer-stream.h | 10 ---------- tests/regression/tools/filtering/Makefile.am | 7 +++++++ tests/regression/ust/baddr-statedump/Makefile.am | 4 ++++ tests/regression/ust/daemon/Makefile.am | 4 ++++ tests/regression/ust/exit-fast/Makefile.am | 4 ++++ tests/regression/ust/fork/Makefile.am | 4 ++++ tests/regression/ust/high-throughput/Makefile.am | 4 ++++ tests/regression/ust/linking/Makefile.am | 4 ++++ tests/regression/ust/low-throughput/Makefile.am | 4 ++++ tests/regression/ust/multi-lib/Makefile.am | 4 ++++ tests/regression/ust/multi-session/Makefile.am | 4 ++++ tests/regression/ust/overlap/demo/Makefile.am | 4 ++++ tests/regression/ust/type-declarations/Makefile.am | 4 ++++ tests/regression/ust/ust-dl/Makefile.am | 4 ++++ tests/utils/testapp/gen-ust-events-ns/Makefile.am | 7 +++++++ tests/utils/testapp/gen-ust-events/Makefile.am | 7 +++++++ tests/utils/testapp/gen-ust-nevents-str/Makefile.am | 6 ++++++ tests/utils/testapp/gen-ust-nevents/Makefile.am | 6 ++++++ 28 files changed, 92 insertions(+), 19 deletions(-) diff --git a/configure.ac b/configure.ac index 65f9b0f75..f75991a90 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,7 @@ m4_define([WARN_FLAGS_COMMON_LIST], [ dnl -Wall dnl -Wnull-dereference dnl -Wundef dnl + -Wredundant-decls dnl -Wmissing-noreturn dnl -Wlogical-op dnl dnl We currently get this warning when building with Clang: diff --git a/doc/examples/trigger-condition-event-matches/Makefile.am b/doc/examples/trigger-condition-event-matches/Makefile.am index cb5512ed0..f42b6fe84 100644 --- a/doc/examples/trigger-condition-event-matches/Makefile.am +++ b/doc/examples/trigger-condition-event-matches/Makefile.am @@ -2,6 +2,8 @@ AM_CPPFLAGS += -I$(srcdir) +AM_CFLAGS += -Wno-redundant-decls + LIBLTTNG_CTL=$(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la dist_noinst_SCRIPTS = demo.sh EXTRA_DIST = README.md diff --git a/src/bin/lttng-consumerd/health-consumerd.cpp b/src/bin/lttng-consumerd/health-consumerd.cpp index ec30af5dd..fe2f6d22c 100644 --- a/src/bin/lttng-consumerd/health-consumerd.cpp +++ b/src/bin/lttng-consumerd/health-consumerd.cpp @@ -144,7 +144,7 @@ end: /* * Thread managing health check socket. */ -void *thread_manage_health(void *data) +void *thread_manage_health_consumerd(void *data) { int sock = -1, new_sock = -1, ret, i, pollfd, err = -1; uint32_t revents, nb_fd; diff --git a/src/bin/lttng-consumerd/health-consumerd.h b/src/bin/lttng-consumerd/health-consumerd.h index 42ec9ea94..9faa081d4 100644 --- a/src/bin/lttng-consumerd/health-consumerd.h +++ b/src/bin/lttng-consumerd/health-consumerd.h @@ -23,7 +23,7 @@ enum health_type_consumerd { /* Consumerd health monitoring */ extern struct health_app *health_consumerd; -void *thread_manage_health(void *data); +void *thread_manage_health_consumerd(void *data); extern int health_quit_pipe[2]; diff --git a/src/bin/lttng-consumerd/lttng-consumerd.cpp b/src/bin/lttng-consumerd/lttng-consumerd.cpp index 91617a11a..73238b4fb 100644 --- a/src/bin/lttng-consumerd/lttng-consumerd.cpp +++ b/src/bin/lttng-consumerd/lttng-consumerd.cpp @@ -502,7 +502,7 @@ int main(int argc, char **argv) /* Create thread to manage the client socket */ ret = pthread_create(&health_thread, default_pthread_attr(), - thread_manage_health, (void *) NULL); + thread_manage_health_consumerd, (void *) NULL); if (ret) { errno = ret; PERROR("pthread_create health"); diff --git a/src/bin/lttng-relayd/health-relayd.cpp b/src/bin/lttng-relayd/health-relayd.cpp index 265c70d2e..b832ffe0e 100644 --- a/src/bin/lttng-relayd/health-relayd.cpp +++ b/src/bin/lttng-relayd/health-relayd.cpp @@ -259,7 +259,7 @@ end: /* * Thread managing health check socket. */ -void *thread_manage_health(void *data) +void *thread_manage_health_relayd(void *data) { int sock = -1, new_sock = -1, ret, i, pollfd, err = -1; uint32_t revents, nb_fd; diff --git a/src/bin/lttng-relayd/health-relayd.h b/src/bin/lttng-relayd/health-relayd.h index 3384f49ae..4cd3ec1e7 100644 --- a/src/bin/lttng-relayd/health-relayd.h +++ b/src/bin/lttng-relayd/health-relayd.h @@ -29,6 +29,6 @@ extern struct health_app *health_relayd; extern int health_quit_pipe[2]; -void *thread_manage_health(void *data); +void *thread_manage_health_relayd(void *data); #endif /* HEALTH_RELAYD_H */ diff --git a/src/bin/lttng-relayd/main.cpp b/src/bin/lttng-relayd/main.cpp index 72bf30b7e..2b1061876 100644 --- a/src/bin/lttng-relayd/main.cpp +++ b/src/bin/lttng-relayd/main.cpp @@ -4424,7 +4424,7 @@ int main(int argc, char **argv) /* Create thread to manage the client socket */ ret = pthread_create(&health_thread, default_pthread_attr(), - thread_manage_health, (void *) NULL); + thread_manage_health_relayd, (void *) NULL); if (ret) { errno = ret; PERROR("pthread_create health"); diff --git a/src/bin/lttng-sessiond/cmd.h b/src/bin/lttng-sessiond/cmd.h index bd2d93974..13d540e25 100644 --- a/src/bin/lttng-sessiond/cmd.h +++ b/src/bin/lttng-sessiond/cmd.h @@ -117,8 +117,6 @@ enum lttng_error_code cmd_list_events(enum lttng_domain_type domain, enum lttng_error_code cmd_list_channels(enum lttng_domain_type domain, struct ltt_session *session, struct lttng_payload *payload); -ssize_t cmd_list_domains(struct ltt_session *session, - struct lttng_domain **domains); void cmd_list_lttng_sessions(struct lttng_session *sessions, size_t session_count, uid_t uid, gid_t gid); enum lttng_error_code cmd_list_tracepoint_fields(enum lttng_domain_type domain, diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 2ba44fa52..4b9e313dc 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -251,7 +251,8 @@ BUILT_SOURCES += filter/filter-parser.hpp # Disable some warning flags for generated sources. FILTER_WARN_FLAGS = \ - -Wno-null-dereference + -Wno-null-dereference \ + -Wno-redundant-decls libfilter_la_CFLAGS = $(AM_CFLAGS) $(FILTER_WARN_FLAGS) libfilter_la_CXXFLAGS = -include filter-symbols.h $(AM_CXXFLAGS) $(FILTER_WARN_FLAGS) diff --git a/src/common/consumer/consumer-stream.h b/src/common/consumer/consumer-stream.h index c9af63cd8..021742e43 100644 --- a/src/common/consumer/consumer-stream.h +++ b/src/common/consumer/consumer-stream.h @@ -136,16 +136,6 @@ int consumer_stream_enable_metadata_bucketization( void consumer_stream_metadata_set_version( struct lttng_consumer_stream *stream, uint64_t new_version); -/* - * Set the version of a metadata stream (i.e. following a metadata - * regeneration). - * - * Changing the version of a metadata stream will cause any bucketized metadata - * to be discarded and will mark the metadata stream for future `reset`. - */ -void consumer_stream_metadata_set_version( - struct lttng_consumer_stream *stream, uint64_t new_version); - /* * Attempt to open a packet in a stream. * diff --git a/tests/regression/tools/filtering/Makefile.am b/tests/regression/tools/filtering/Makefile.am index 919307e17..4a851c32f 100644 --- a/tests/regression/tools/filtering/Makefile.am +++ b/tests/regression/tools/filtering/Makefile.am @@ -3,6 +3,13 @@ AM_CPPFLAGS += -I$(top_srcdir)/tests -I$(srcdir) if HAVE_LIBLTTNG_UST_CTL +# Disable some warnings flags to accomodate the tracepoint headers +WARN_FLAGS = \ + -Wno-redundant-decls + +AM_CFLAGS += $(WARN_FLAGS) +AM_CXXFLAGS += $(WARN_FLAGS) + noinst_PROGRAMS = gen-ust-events gen_ust_events_SOURCES = gen-ust-events.c tp.c tp.h gen_ust_events_LDADD = $(UST_LIBS) $(DL_LIBS) diff --git a/tests/regression/ust/baddr-statedump/Makefile.am b/tests/regression/ust/baddr-statedump/Makefile.am index 35de5f941..f8fe26395 100644 --- a/tests/regression/ust/baddr-statedump/Makefile.am +++ b/tests/regression/ust/baddr-statedump/Makefile.am @@ -6,6 +6,10 @@ objcopy_verbose_0 = @echo OBJCOPY $@; AM_CPPFLAGS += -I$(srcdir) -g +# Disable some warnings flags to accomodate the tracepoint headers +AM_CFLAGS += \ + -Wno-redundant-decls + noinst_PROGRAMS = prog prog_SOURCES = prog.c tp.c tp.h prog_LDADD = $(UST_LIBS) $(DL_LIBS) diff --git a/tests/regression/ust/daemon/Makefile.am b/tests/regression/ust/daemon/Makefile.am index c2a836ed4..48806e1b6 100644 --- a/tests/regression/ust/daemon/Makefile.am +++ b/tests/regression/ust/daemon/Makefile.am @@ -2,6 +2,10 @@ AM_CPPFLAGS += -I$(srcdir) +# Disable some warnings flags to accomodate the tracepoint headers +AM_CFLAGS += \ + -Wno-redundant-decls + noinst_PROGRAMS = daemon daemon_SOURCES = daemon.c ust_tests_daemon.h daemon_LDADD = $(UST_LIBS) -llttng-ust-fork $(DL_LIBS) diff --git a/tests/regression/ust/exit-fast/Makefile.am b/tests/regression/ust/exit-fast/Makefile.am index 7ae169706..30f05966b 100644 --- a/tests/regression/ust/exit-fast/Makefile.am +++ b/tests/regression/ust/exit-fast/Makefile.am @@ -2,6 +2,10 @@ AM_CPPFLAGS += -I$(srcdir) +# Disable some warnings flags to accomodate the tracepoint headers +AM_CFLAGS += \ + -Wno-redundant-decls + noinst_PROGRAMS = exit-fast exit_fast_SOURCES = exit-fast.c ust_tests_exitfast.h exit_fast_LDADD = $(UST_LIBS) $(DL_LIBS) diff --git a/tests/regression/ust/fork/Makefile.am b/tests/regression/ust/fork/Makefile.am index 4a0016f5b..e01bd5d8e 100644 --- a/tests/regression/ust/fork/Makefile.am +++ b/tests/regression/ust/fork/Makefile.am @@ -2,6 +2,10 @@ AM_CPPFLAGS += -I$(srcdir) +# Disable some warnings flags to accomodate the tracepoint headers +AM_CFLAGS += \ + -Wno-redundant-decls + noinst_PROGRAMS = fork fork2 fork_SOURCES = fork.c ust_tests_fork.h fork_LDADD = $(UST_LIBS) -llttng-ust-fork $(DL_LIBS) diff --git a/tests/regression/ust/high-throughput/Makefile.am b/tests/regression/ust/high-throughput/Makefile.am index 8b7e65cd8..108633651 100644 --- a/tests/regression/ust/high-throughput/Makefile.am +++ b/tests/regression/ust/high-throughput/Makefile.am @@ -2,6 +2,10 @@ AM_CPPFLAGS += -I$(srcdir) +# Disable some warnings flags to accomodate the tracepoint headers +AM_CFLAGS += \ + -Wno-redundant-decls + noinst_PROGRAMS = gen-events gen_events_SOURCES = main.c tp.c tp.h gen_events_LDADD = $(UST_LIBS) $(DL_LIBS) diff --git a/tests/regression/ust/linking/Makefile.am b/tests/regression/ust/linking/Makefile.am index 424afd1c5..5edcb9374 100644 --- a/tests/regression/ust/linking/Makefile.am +++ b/tests/regression/ust/linking/Makefile.am @@ -7,6 +7,10 @@ # so disable that. AM_CPPFLAGS += -I$(srcdir) -Wsystem-headers -Wno-format-nonliteral +# Disable some warnings flags to accomodate the tracepoint headers +AM_CFLAGS += \ + -Wno-redundant-decls + # Set LIBS to nothing so the application does not link on useless # libraries. LIBS = diff --git a/tests/regression/ust/low-throughput/Makefile.am b/tests/regression/ust/low-throughput/Makefile.am index 7d5b21371..5e688c56d 100644 --- a/tests/regression/ust/low-throughput/Makefile.am +++ b/tests/regression/ust/low-throughput/Makefile.am @@ -2,6 +2,10 @@ AM_CPPFLAGS += -I$(srcdir) +# Disable some warnings flags to accomodate the tracepoint headers +AM_CFLAGS += \ + -Wno-redundant-decls + noinst_PROGRAMS = gen-events gen_events_SOURCES = main.c tp.c tp.h gen_events_LDADD = $(UST_LIBS) $(DL_LIBS) diff --git a/tests/regression/ust/multi-lib/Makefile.am b/tests/regression/ust/multi-lib/Makefile.am index 7d869c628..7fdcb8ac1 100644 --- a/tests/regression/ust/multi-lib/Makefile.am +++ b/tests/regression/ust/multi-lib/Makefile.am @@ -1,5 +1,9 @@ # SPDX-License-Identifier: GPL-2.0-only +# Disable some warnings flags to accomodate the tracepoint headers +AM_CFLAGS += \ + -Wno-redundant-decls + noinst_SCRIPTS = test_multi_lib EXTRA_DIST = test_multi_lib noinst_PROGRAMS = exec-with-callsites exec-without-callsites diff --git a/tests/regression/ust/multi-session/Makefile.am b/tests/regression/ust/multi-session/Makefile.am index 5f83c5133..aaaf2ff04 100644 --- a/tests/regression/ust/multi-session/Makefile.am +++ b/tests/regression/ust/multi-session/Makefile.am @@ -2,6 +2,10 @@ AM_CFLAGS += -I$(srcdir) +# Disable some warnings flags to accomodate the tracepoint headers +AM_CFLAGS += \ + -Wno-redundant-decls + noinst_PROGRAMS = gen-nevents gen_nevents_SOURCES = gen-nevents.c tp.c ust_gen_nevents.h gen_nevents_LDADD = $(UST_LIBS) $(DL_LIBS) diff --git a/tests/regression/ust/overlap/demo/Makefile.am b/tests/regression/ust/overlap/demo/Makefile.am index 302baa770..dbdf266e0 100644 --- a/tests/regression/ust/overlap/demo/Makefile.am +++ b/tests/regression/ust/overlap/demo/Makefile.am @@ -14,6 +14,10 @@ else AM_CPPFLAGS += -I$(srcdir) +# Disable some warnings flags to accomodate the tracepoint headers +AM_CFLAGS += \ + -Wno-redundant-decls + # Force the shared flag on the noinst libraries since they are # only built static by default FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \ diff --git a/tests/regression/ust/type-declarations/Makefile.am b/tests/regression/ust/type-declarations/Makefile.am index f24a8fbd5..64bb56ce1 100644 --- a/tests/regression/ust/type-declarations/Makefile.am +++ b/tests/regression/ust/type-declarations/Makefile.am @@ -2,6 +2,10 @@ AM_CPPFLAGS += -I$(srcdir) +# Disable some warnings flags to accomodate the tracepoint headers +AM_CFLAGS += \ + -Wno-redundant-decls + noinst_PROGRAMS = type-declarations type_declarations_SOURCES = type-declarations.c ust_tests_td.h type_declarations_LDADD = $(UST_LIBS) $(DL_LIBS) diff --git a/tests/regression/ust/ust-dl/Makefile.am b/tests/regression/ust/ust-dl/Makefile.am index 2176b23bc..366b02bb0 100644 --- a/tests/regression/ust/ust-dl/Makefile.am +++ b/tests/regression/ust/ust-dl/Makefile.am @@ -19,6 +19,10 @@ objcopy_verbose_0 = @echo " OBJCOPY " $@; AM_CPPFLAGS += -I$(srcdir) -g +# Disable some warnings flags to accomodate the tracepoint headers +AM_CFLAGS += \ + -Wno-redundant-decls + noinst_PROGRAMS = prog prog_SOURCES = prog.c prog_LDADD = $(DL_LIBS) diff --git a/tests/utils/testapp/gen-ust-events-ns/Makefile.am b/tests/utils/testapp/gen-ust-events-ns/Makefile.am index 2e3ad0747..37bdc94fe 100644 --- a/tests/utils/testapp/gen-ust-events-ns/Makefile.am +++ b/tests/utils/testapp/gen-ust-events-ns/Makefile.am @@ -4,6 +4,13 @@ AM_CPPFLAGS += -I$(top_srcdir)/tests/utils -I$(srcdir) \ -I$(top_srcdir)/tests/utils/testapp if HAVE_LIBLTTNG_UST_CTL +# Disable some warnings flags to accomodate the tracepoint headers +WARN_FLAGS = \ + -Wno-redundant-decls + +AM_CFLAGS += $(WARN_FLAGS) +AM_CXXFLAGS += $(WARN_FLAGS) + noinst_PROGRAMS = gen-ust-events-ns gen_ust_events_ns_SOURCES = \ gen-ust-events-ns.cpp \ diff --git a/tests/utils/testapp/gen-ust-events/Makefile.am b/tests/utils/testapp/gen-ust-events/Makefile.am index c05c665a1..1e89ddd67 100644 --- a/tests/utils/testapp/gen-ust-events/Makefile.am +++ b/tests/utils/testapp/gen-ust-events/Makefile.am @@ -4,6 +4,13 @@ AM_CPPFLAGS += -I$(top_srcdir)/tests/utils -I$(srcdir) \ -I$(top_srcdir)/tests/utils/testapp if HAVE_LIBLTTNG_UST_CTL +# Disable some warnings flags to accomodate the tracepoint headers +WARN_FLAGS = \ + -Wno-redundant-decls + +AM_CFLAGS += $(WARN_FLAGS) +AM_CXXFLAGS += $(WARN_FLAGS) + noinst_PROGRAMS = gen-ust-events gen_ust_events_SOURCES = \ gen-ust-events.cpp \ diff --git a/tests/utils/testapp/gen-ust-nevents-str/Makefile.am b/tests/utils/testapp/gen-ust-nevents-str/Makefile.am index 955200c2b..75c50bb1e 100644 --- a/tests/utils/testapp/gen-ust-nevents-str/Makefile.am +++ b/tests/utils/testapp/gen-ust-nevents-str/Makefile.am @@ -4,6 +4,12 @@ AM_CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/tests/utils \ -I$(top_srcdir)/tests/utils/testapp if HAVE_LIBLTTNG_UST_CTL +WARN_FLAGS = \ + -Wno-redundant-decls + +AM_CFLAGS += $(WARN_FLAGS) +AM_CXXFLAGS += $(WARN_FLAGS) + noinst_PROGRAMS = gen-ust-nevents-str gen_ust_nevents_str_SOURCES = \ gen-ust-nevents-str.cpp \ diff --git a/tests/utils/testapp/gen-ust-nevents/Makefile.am b/tests/utils/testapp/gen-ust-nevents/Makefile.am index cb869715d..c2d36d7c9 100644 --- a/tests/utils/testapp/gen-ust-nevents/Makefile.am +++ b/tests/utils/testapp/gen-ust-nevents/Makefile.am @@ -4,6 +4,12 @@ AM_CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/tests/utils \ -I$(top_srcdir)/tests/utils/testapp if HAVE_LIBLTTNG_UST_CTL +WARN_FLAGS = \ + -Wno-redundant-decls + +AM_CFLAGS += $(WARN_FLAGS) +AM_CXXFLAGS += $(WARN_FLAGS) + noinst_PROGRAMS = gen-ust-nevents gen_ust_nevents_SOURCES = \ gen-ust-nevents.cpp \ -- 2.34.1