This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Remove C-specific warnings from common warning set
- From: Pedro Alves <palves at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 7 Mar 2015 18:21:06 -0000
- Subject: [binutils-gdb] Remove C-specific warnings from common warning set
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=aac331e484bba9736f12602da3715c8f7e0f1a45
commit aac331e484bba9736f12602da3715c8f7e0f1a45
Author: Pedro Alves <palves@redhat.com>
Date: Sat Feb 28 19:11:10 2015 +0000
Remove C-specific warnings from common warning set
Whoops, these are C specific, but I somehow missed the warnings before:
cc1plus: warning: command line option â??-Wmissing-prototypesâ?? is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option â??-Wdeclaration-after-statementâ?? is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option â??-Wmissing-parameter-typeâ?? is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option â??-Wold-style-declarationâ?? is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option â??-Wold-style-definitionâ?? is valid for C/ObjC but not for C++ [enabled by default]
gdb/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
* configure.ac (build_warnings): Move -Wmissing-prototypes
-Wdeclaration-after-statement -Wmissing-parameter-type
-Wold-style-declaration -Wold-style-definition to the C-specific
set.
* configure: Regenerate.
gdb/gdbserver/ChangeLog:
2015-03-07 Pedro Alves <palves@redhat.com>
* configure.ac (build_warnings): Move
-Wdeclaration-after-statement to the C-specific set.
* configure: Regenerate.
Diff:
---
gdb/ChangeLog | 8 ++++++++
gdb/configure | 11 ++++++-----
gdb/configure.ac | 11 ++++++-----
gdb/gdbserver/ChangeLog | 6 ++++++
gdb/gdbserver/configure | 4 +++-
gdb/gdbserver/configure.ac | 4 +++-
6 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 522f2bb..eee5bad 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2015-03-07 Pedro Alves <palves@redhat.com>
+ * configure.ac (build_warnings): Move -Wmissing-prototypes
+ -Wdeclaration-after-statement -Wmissing-parameter-type
+ -Wold-style-declaration -Wold-style-definition to the C-specific
+ set.
+ * configure: Regenerate.
+
+2015-03-07 Pedro Alves <palves@redhat.com>
+
* common/gdb_socket.h: New file.
* ser-tcp.c: Include gdb_socket.h. Don't include netinet/in.h nor
sys/socket.h.
diff --git a/gdb/configure b/gdb/configure
index 3297d37..1ddcc62 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -13383,18 +13383,19 @@ if test "${ERROR_ON_WARNING}" = yes ; then
fi
# These options work in either C or C++ modes.
-build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
+build_warnings="-Wall -Wpointer-arith \
-Wno-unused -Wunused-value -Wunused-function \
--Wno-switch -Wno-char-subscripts -Wmissing-prototypes \
--Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \
--Wold-style-declaration -Wold-style-definition"
+-Wno-switch -Wno-char-subscripts \
+-Wempty-body"
# Now add in C and C++ specific options, depending on mode.
if test "$enable_build_with_cxx" = "yes"; then
build_warnings="$build_warnings -Wno-sign-compare -Wno-write-strings \
-Wno-narrowing"
else
- build_warnings="$build_warnings -Wpointer-sign"
+ build_warnings="$build_warnings -Wpointer-sign -Wmissing-prototypes \
+-Wdeclaration-after-statement -Wmissing-parameter-type \
+-Wold-style-declaration -Wold-style-definition"
fi
# Enable -Wno-format by default when using gcc on mingw since many
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 0898d0e..a4886c9 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1978,18 +1978,19 @@ if test "${ERROR_ON_WARNING}" = yes ; then
fi
# These options work in either C or C++ modes.
-build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
+build_warnings="-Wall -Wpointer-arith \
-Wno-unused -Wunused-value -Wunused-function \
--Wno-switch -Wno-char-subscripts -Wmissing-prototypes \
--Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \
--Wold-style-declaration -Wold-style-definition"
+-Wno-switch -Wno-char-subscripts \
+-Wempty-body"
# Now add in C and C++ specific options, depending on mode.
if test "$enable_build_with_cxx" = "yes"; then
build_warnings="$build_warnings -Wno-sign-compare -Wno-write-strings \
-Wno-narrowing"
else
- build_warnings="$build_warnings -Wpointer-sign"
+ build_warnings="$build_warnings -Wpointer-sign -Wmissing-prototypes \
+-Wdeclaration-after-statement -Wmissing-parameter-type \
+-Wold-style-declaration -Wold-style-definition"
fi
# Enable -Wno-format by default when using gcc on mingw since many
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 8aa38a3..b27090e 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,11 @@
2015-03-07 Pedro Alves <palves@redhat.com>
+ * configure.ac (build_warnings): Move
+ -Wdeclaration-after-statement to the C-specific set.
+ * configure: Regenerate.
+
+2015-03-07 Pedro Alves <palves@redhat.com>
+
* gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
or <winsock2.h> here. Instead include "gdb_socket.h".
(remote_open): Use union gdb_sockaddr_u.
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index a14def9..cbf4b4e 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -5794,13 +5794,15 @@ if test "${ERROR_ON_WARNING}" = yes ; then
WERROR_CFLAGS="-Werror"
fi
-build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
+build_warnings="-Wall -Wpointer-arith \
-Wformat-nonliteral -Wno-char-subscripts -Wempty-body"
# Now add in C and C++ specific options, depending on mode.
if test "$enable_build_with_cxx" = "yes"; then
build_warnings="$build_warnings -Wno-sign-compare -Wno-write-strings \
-Wno-narrowing"
+else
+ build_warnings="$build_warnings -Wdeclaration-after-statement"
fi
# The set of warnings supported by a C++ compiler is not the same as
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index cefc69e..0381aa9 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -167,13 +167,15 @@ if test "${ERROR_ON_WARNING}" = yes ; then
WERROR_CFLAGS="-Werror"
fi
-build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
+build_warnings="-Wall -Wpointer-arith \
-Wformat-nonliteral -Wno-char-subscripts -Wempty-body"
# Now add in C and C++ specific options, depending on mode.
if test "$enable_build_with_cxx" = "yes"; then
build_warnings="$build_warnings -Wno-sign-compare -Wno-write-strings \
-Wno-narrowing"
+else
+ build_warnings="$build_warnings -Wdeclaration-after-statement"
fi
# The set of warnings supported by a C++ compiler is not the same as