configure: enable -Wshadow-field
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 30 Jun 2022 17:29:17 +0000 (13:29 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 22 Aug 2022 14:24:06 +0000 (10:24 -0400)
This warning exists in clang and warns about fields in classes shadowing
fields in base classes.  I hit one bug that this warning would have
caught.  I don't think there are many legitimate / useful cases to have
derived and base classes with fields of the same name.

Change-Id: Ifab0bc03bce2b84a4a186fcc98da8b68ef61e771
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8514
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
configure.ac

index 89884d973eb7b7bc85b4a0024bfe6b97a35db7ea..5dcb8bfe79888900c336edf55a148ddc43f4e209 100644 (file)
@@ -704,6 +704,7 @@ m4_define([WARN_FLAGS_LIST], [ dnl
   dnl Clang's does not.  Enable Clang's `-Wshadow-field-in-constructor`, to make
   dnl Clang warn about that.
   -Wshadow-field-in-constructor dnl
+  -Wshadow-field dnl
   -Wjump-misses-init dnl
   -Wsuggest-attribute=format dnl
   -Wtautological-constant-out-of-range-compare dnl
This page took 0.0248 seconds and 4 git commands to generate.