[15/15] Enable -Wmissing-declarations diagnostic

Message ID 20191125052655.22696-16-simon.marchi@efficios.com
State New, archived
Headers

Commit Message

Simon Marchi Nov. 25, 2019, 5:26 a.m. UTC
  Now that most warnings of this kind are fixed, we can enable
-Wmissing-declarations.  I say "most", because it is likely that there
are some more in some configurations I am not able to build, but they
should be pretty easy to fix.

gdb/ChangeLog:

	* warning.m4: Add -Wmissing-declarations to build_warnings.
	* configure: Re-generate.

Change-Id: Iae9b59f22eb5dd1965d09f34c5c9e212cddf67ba
---
 gdb/configure  | 3 ++-
 gdb/warning.m4 | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
  

Comments

Tom Tromey Nov. 25, 2019, 10:06 p.m. UTC | #1
>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> Now that most warnings of this kind are fixed, we can enable
Simon> -Wmissing-declarations.  I say "most", because it is likely that there
Simon> are some more in some configurations I am not able to build, but they
Simon> should be pretty easy to fix.

Simon> gdb/ChangeLog:

Simon> 	* warning.m4: Add -Wmissing-declarations to build_warnings.
Simon> 	* configure: Re-generate.

gdbserver uses warning.m4, so you have to also rebuild configure there
and fix up any issues -- otherwise, the next person to rebuild
gdbserver/configure will be surprised.

Tom
  
Simon Marchi Nov. 25, 2019, 10:11 p.m. UTC | #2
On 2019-11-25 5:06 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> Now that most warnings of this kind are fixed, we can enable
> Simon> -Wmissing-declarations.  I say "most", because it is likely that there
> Simon> are some more in some configurations I am not able to build, but they
> Simon> should be pretty easy to fix.
> 
> Simon> gdb/ChangeLog:
> 
> Simon> 	* warning.m4: Add -Wmissing-declarations to build_warnings.
> Simon> 	* configure: Re-generate.
> 
> gdbserver uses warning.m4, so you have to also rebuild configure there
> and fix up any issues -- otherwise, the next person to rebuild
> gdbserver/configure will be surprised.

Doh.  I was really susprised that gdbserver had zero occurence of this warning!

Do patches 2 to 8 and 10 to 14 look ok to you?  If so, I would probably push them
right away since I believe they are good cleanups in any case.

Patches 1 and 9 are not really important until we are ready to switch the warning
on.

Simon
  
Tom Tromey Nov. 26, 2019, 2:12 p.m. UTC | #3
>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> Do patches 2 to 8 and 10 to 14 look ok to you?  If so, I would probably push them
Simon> right away since I believe they are good cleanups in any case.

Yeah, those all seem fine to me.

thank,
Tom
  
Simon Marchi Nov. 26, 2019, 7:48 p.m. UTC | #4
On 2019-11-26 9:12 a.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> Do patches 2 to 8 and 10 to 14 look ok to you?  If so, I would probably push them
> Simon> right away since I believe they are good cleanups in any case.
> 
> Yeah, those all seem fine to me.

Thanks, I pushed these.

Simon
  

Patch

diff --git a/gdb/configure b/gdb/configure
index 4afd7f9b9680..cf3aff66b4d0 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -15265,7 +15265,8 @@  build_warnings="-Wall -Wpointer-arith \
 -Wshadow=local \
 -Wdeprecated-copy \
 -Wdeprecated-copy-dtor \
--Wredundant-move"
+-Wredundant-move \
+-Wmissing-declarations"
 
 case "${host}" in
   *-*-mingw32*)
diff --git a/gdb/warning.m4 b/gdb/warning.m4
index c9e64a1836a8..3162fe3a04a8 100644
--- a/gdb/warning.m4
+++ b/gdb/warning.m4
@@ -49,7 +49,8 @@  build_warnings="-Wall -Wpointer-arith \
 -Wshadow=local \
 -Wdeprecated-copy \
 -Wdeprecated-copy-dtor \
--Wredundant-move"
+-Wredundant-move \
+-Wmissing-declarations"
 
 case "${host}" in
   *-*-mingw32*)