Skip to content

Commit

Permalink
gdb: enable -Wmissing-prototypes warning
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
simark committed Mar 11, 2020
1 parent 5308d1e commit a0761e3
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gdb/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2020-03-11 Simon Marchi <[email protected]>

* configure: Re-generate.

2020-03-11 Tom Tromey <[email protected]>

* ada-typeprint.c (print_choices): Fix comment.
Expand Down
1 change: 1 addition & 0 deletions gdb/configure
Original file line number Diff line number Diff line change
Expand Up @@ -16323,6 +16323,7 @@ build_warnings="-Wall -Wpointer-arith \
-Wdeprecated-copy-dtor \
-Wredundant-move \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wstrict-null-sentinel \
"

Expand Down
4 changes: 4 additions & 0 deletions gdbserver/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2020-03-11 Simon Marchi <[email protected]>

* configure: Re-generate.

2020-03-06 Andrew Burgess <[email protected]>

* .dir-locals.el: New file.
Expand Down
1 change: 1 addition & 0 deletions gdbserver/configure
Original file line number Diff line number Diff line change
Expand Up @@ -9616,6 +9616,7 @@ build_warnings="-Wall -Wpointer-arith \
-Wdeprecated-copy-dtor \
-Wredundant-move \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wstrict-null-sentinel \
"

Expand Down
5 changes: 5 additions & 0 deletions gdbsupport/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2020-03-11 Simon Marchi <[email protected]>

* configure: Re-generate.
* warning.m4: Enable -Wmissing-prototypes.

2020-03-08 Tom Tromey <[email protected]>

* gdb_binary_search.h: Fix two typos.
Expand Down
1 change: 1 addition & 0 deletions gdbsupport/configure
Original file line number Diff line number Diff line change
Expand Up @@ -10874,6 +10874,7 @@ build_warnings="-Wall -Wpointer-arith \
-Wdeprecated-copy-dtor \
-Wredundant-move \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wstrict-null-sentinel \
"

Expand Down
1 change: 1 addition & 0 deletions gdbsupport/warning.m4
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ build_warnings="-Wall -Wpointer-arith \
-Wdeprecated-copy-dtor \
-Wredundant-move \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wstrict-null-sentinel \
"
Expand Down

0 comments on commit a0761e3

Please sign in to comment.