From dd420a9b3f83cda6f77e8813165a061856d9d618 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 9 Mar 2022 17:14:20 -0500 Subject: [PATCH] configure: re-enable '-Wmissing-field-initializers' This warning is part of '-Wextra' in GCC. Change-Id: Ie6170cb06900e93011ddedc102a9964c63edad55 Signed-off-by: Michael Jeanson Reviewed-on: https://review.lttng.org/c/babeltrace/+/7558 Reviewed-by: Simon Marchi --- configure.ac | 1 - src/bindings/python/bt2/Makefile.am | 3 +++ src/plugins/ctf/common/metadata/Makefile.am | 3 ++- src/plugins/ctf/common/metadata/ctf-meta-translate.cpp | 2 +- src/plugins/ctf/lttng-live/lttng-live.cpp | 2 +- src/plugins/ctf/lttng-live/viewer-connection.cpp | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 716c9f4d..90ce3d20 100644 --- a/configure.ac +++ b/configure.ac @@ -761,7 +761,6 @@ m4_define([WARN_FLAGS_LIST], [ dnl dnl dnl Ref: https://github.com/swig/swig/issues/1259 -Wno-cast-function-type dnl - -Wno-missing-field-initializers dnl -Wno-maybe-uninitialized dnl ]) diff --git a/src/bindings/python/bt2/Makefile.am b/src/bindings/python/bt2/Makefile.am index e427ef61..4be84144 100644 --- a/src/bindings/python/bt2/Makefile.am +++ b/src/bindings/python/bt2/Makefile.am @@ -122,6 +122,9 @@ WARN_CFLAGS += -Wno-deprecated-declarations # Python 3.11 + gcc 12.2.0 gave warnings of this kind in Python.h. WARN_CFLAGS += -Wno-redundant-decls +# For SWIG generated code +WARN_CFLAGS += -Wno-missing-field-initializers + BUILD_FLAGS=CC="$(CC)" \ CFLAGS="$(GLIB_CFLAGS) $(AM_CFLAGS) $(CFLAGS) $(WARN_CFLAGS)" \ CPPFLAGS="$(AM_CPPFLAGS) $(CPPFLAGS) -I$(srcdir)/bt2" \ diff --git a/src/plugins/ctf/common/metadata/Makefile.am b/src/plugins/ctf/common/metadata/Makefile.am index 7d843d64..2fca29b3 100644 --- a/src/plugins/ctf/common/metadata/Makefile.am +++ b/src/plugins/ctf/common/metadata/Makefile.am @@ -17,7 +17,8 @@ libctf_parser_la_CPPFLAGS = $(AM_CPPFLAGS) \ # produces. libctf_parser_la_CXXFLAGS = $(AM_CXXFLAGS) \ -Wno-unused-function \ - -Wno-null-dereference + -Wno-null-dereference \ + -Wno-missing-field-initializers libctf_ast_la_SOURCES = \ visitor-generate-ir.cpp \ diff --git a/src/plugins/ctf/common/metadata/ctf-meta-translate.cpp b/src/plugins/ctf/common/metadata/ctf-meta-translate.cpp index 6f066b77..09707108 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-translate.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-translate.cpp @@ -623,7 +623,7 @@ int ctf_trace_class_translate(bt_self_component *self_comp, bt_trace_class *ir_t { int ret = 0; uint64_t i; - struct ctx ctx = {0}; + struct ctx ctx = {}; ctx.self_comp = self_comp; ctx.tc = tc; diff --git a/src/plugins/ctf/lttng-live/lttng-live.cpp b/src/plugins/ctf/lttng-live/lttng-live.cpp index be6d7ba9..5ff0ff3f 100644 --- a/src/plugins/ctf/lttng-live/lttng-live.cpp +++ b/src/plugins/ctf/lttng-live/lttng-live.cpp @@ -1958,7 +1958,7 @@ lttng_live_query_support_info(const bt_value *params, const bt_value **result, const bt_value *input_type_value; const bt_value *input_value; double weight = 0; - struct bt_common_lttng_live_url_parts parts = {0}; + struct bt_common_lttng_live_url_parts parts = {}; /* Used by the logging macros */ __attribute__((unused)) bt_self_component *self_comp = NULL; diff --git a/src/plugins/ctf/lttng-live/viewer-connection.cpp b/src/plugins/ctf/lttng-live/viewer-connection.cpp index 8706493b..1236ba41 100644 --- a/src/plugins/ctf/lttng-live/viewer-connection.cpp +++ b/src/plugins/ctf/lttng-live/viewer-connection.cpp @@ -336,7 +336,7 @@ static int parse_url(struct live_viewer_connection *viewer_connection) char error_buf[256] = {0}; bt_self_component *self_comp = viewer_connection->self_comp; bt_self_component_class *self_comp_class = viewer_connection->self_comp_class; - struct bt_common_lttng_live_url_parts lttng_live_url_parts = {0}; + struct bt_common_lttng_live_url_parts lttng_live_url_parts = {}; int ret = -1; const char *path = viewer_connection->url->str; -- 2.34.1