public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: enable -Wmissing-prototypes warning
@ 2020-03-03 22:34 Simon Marchi
  2020-03-11 19:16 ` Simon Marchi
  2021-11-04 12:00 ` gdb: disable -Wmissing-prototypes warning w/gcc Mike Frysinger
  0 siblings, 2 replies; 7+ messages in thread
From: Simon Marchi @ 2020-03-03 22:34 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

While compiling with clang, I noticed it didn't catch cases where my
function declaration didn't match my function definition.  This is
normally caught by gcc with -Wmissing-declarations.

On clang, this is caught by -Wmissing-prototypes instead.

Note that on gcc, -Wmissing-prototypes also exists, but is only valid
for C and Objective-C.  It gets correctly rejected by the configure
script since gcc rejects it with:

    cc1plus: error: command line option '-Wmissing-prototypes' is valid for C/ObjC but not for C++ -Werror

So this warning flag ends up not used for gcc (which is what we want).

gdb/ChangeLog:

	* configure: Re-generate.

gdbserver/ChangeLog:

	* configure: Re-generate.

gdbsupport/ChangeLog:

	* configure: Re-generate.
	* warning.m4: Enable -Wmissing-prototypes.
---
 gdb/configure         | 1 +
 gdbserver/configure   | 1 +
 gdbsupport/configure  | 1 +
 gdbsupport/warning.m4 | 1 +
 4 files changed, 4 insertions(+)

diff --git a/gdb/configure b/gdb/configure
index f99cbe40f11f..47ca77f400c8 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -16323,6 +16323,7 @@ build_warnings="-Wall -Wpointer-arith \
 -Wdeprecated-copy-dtor \
 -Wredundant-move \
 -Wmissing-declarations \
+-Wmissing-prototypes \
 -Wstrict-null-sentinel \
 "
 
diff --git a/gdbserver/configure b/gdbserver/configure
index be5719eb77aa..13ac7188454d 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -9616,6 +9616,7 @@ build_warnings="-Wall -Wpointer-arith \
 -Wdeprecated-copy-dtor \
 -Wredundant-move \
 -Wmissing-declarations \
+-Wmissing-prototypes \
 -Wstrict-null-sentinel \
 "
 
diff --git a/gdbsupport/configure b/gdbsupport/configure
index a4871f8d5bce..11ebee513c40 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -10871,6 +10871,7 @@ build_warnings="-Wall -Wpointer-arith \
 -Wdeprecated-copy-dtor \
 -Wredundant-move \
 -Wmissing-declarations \
+-Wmissing-prototypes \
 -Wstrict-null-sentinel \
 "
 
diff --git a/gdbsupport/warning.m4 b/gdbsupport/warning.m4
index 81939ed76102..649be7552dd1 100644
--- a/gdbsupport/warning.m4
+++ b/gdbsupport/warning.m4
@@ -51,6 +51,7 @@ build_warnings="-Wall -Wpointer-arith \
 -Wdeprecated-copy-dtor \
 -Wredundant-move \
 -Wmissing-declarations \
+-Wmissing-prototypes \
 -Wstrict-null-sentinel \
 "
 
-- 
2.25.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-11-04 20:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-03 22:34 [PATCH] gdb: enable -Wmissing-prototypes warning Simon Marchi
2020-03-11 19:16 ` Simon Marchi
2021-11-04 12:00 ` gdb: disable -Wmissing-prototypes warning w/gcc Mike Frysinger
2021-11-04 12:17   ` Andrew Burgess
2021-11-04 12:59     ` Simon Marchi
2021-11-04 18:43       ` Simon Marchi
2021-11-04 20:18         ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).