This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] Compile GDB with -Wshadow? (was: "Re: [rfa] function parameter shadowed by local variable in opencl-lang.c")


> I wish the compiler would warn us about things like this...  The patch
> looks correct to me, but I will let Ken and Ulrich take a look. Perhaps
> they'll be able to suggest a more specific name than `length2' ;-).

Howzabout we add -Wshadow to the list of warning compiler switches
for GCC? Something like this (untested for now, just to give an idea
for this discussion)...

-- 
Joel
diff --git a/gdb/configure.ac b/gdb/configure.ac
index f31ef2a..ea0cda9 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1753,7 +1753,7 @@ fi
 build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
 -Wformat-nonliteral -Wno-pointer-sign \
 -Wno-unused -Wunused-value -Wunused-function \
--Wno-switch -Wno-char-subscripts"
+-Wno-switch -Wno-char-subscripts -Wshadow"
 
 # Enable -Wno-format by default when using gcc on mingw since many
 # GCC versions complain about %I64.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]