From 200e2a8d2be52b46e759bf9f130f817b213c74ff Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 30 Jun 2022 13:29:17 -0400 Subject: [PATCH] configure: enable -Wshadow-field 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 Reviewed-on: https://review.lttng.org/c/babeltrace/+/8514 Tested-by: jenkins Reviewed-by: Philippe Proulx --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 89884d97..5dcb8bfe 100644 --- a/configure.ac +++ b/configure.ac @@ -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 -- 2.34.1