This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 3/3] add -Wold-style-definition
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at redhat dot com>
- Date: Mon, 17 Jun 2013 12:42:52 -0600
- Subject: [PATCH 3/3] add -Wold-style-definition
- References: <1371494572-26594-1-git-send-email-tromey at redhat dot com>
This adds -Wold-style-definition to gdb's list of warnings. This
found a couple of spots where "()" was used where "(void)" is more
correct.
Tested by rebuilding on x86-64 Fedora 18.
* configure.ac (build_warnings): Add -Wold-style-definition.
* configure: Rebuild.
* machoread.c (_initialize_machoread): Use "(void)".
* macrocmd.c (macro_inform_no_debuginfo): Fix formatting;
use "(void)".
---
gdb/configure | 2 +-
gdb/configure.ac | 2 +-
gdb/machoread.c | 2 +-
gdb/macrocmd.c | 3 ++-
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/gdb/configure b/gdb/configure
index 0c9ac97..dcdd496 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -12457,7 +12457,7 @@ build_warnings="-Wall -Wdeclaration-after-statement -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-declaration -Wold-style-definition"
# Enable -Wno-format by default when using gcc on mingw since many
# GCC versions complain about %I64.
diff --git a/gdb/configure.ac b/gdb/configure.ac
index f2cd9dc..811f6f8 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1930,7 +1930,7 @@ build_warnings="-Wall -Wdeclaration-after-statement -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-declaration -Wold-style-definition"
# Enable -Wno-format by default when using gcc on mingw since many
# GCC versions complain about %I64.
diff --git a/gdb/machoread.c b/gdb/machoread.c
index 7a4f0c3..65dd610 100644
--- a/gdb/machoread.c
+++ b/gdb/machoread.c
@@ -1039,7 +1039,7 @@ static const struct sym_fns macho_sym_fns = {
extern initialize_file_ftype _initialize_machoread;
void
-_initialize_machoread ()
+_initialize_machoread (void)
{
add_symtab_fns (&macho_sym_fns);
diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c
index 250a1f0..b48c3c9 100644
--- a/gdb/macrocmd.c
+++ b/gdb/macrocmd.c
@@ -47,7 +47,8 @@ macro_command (char *arg, int from_tty)
/* Prints an informational message regarding the lack of macro information. */
-static void macro_inform_no_debuginfo()
+static void
+macro_inform_no_debuginfo (void)
{
puts_filtered ("GDB has no preprocessor macro information for that code.\n");
}
--
1.8.1.4