From: Tom Tromey Date: Mon, 1 Jul 2013 19:52:32 +0000 (+0000) Subject: add -Wold-style-definition X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd9aa0484e0b935fcf90d12337779e56a31f9352;p=binutils-gdb.git add -Wold-style-definition 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)". --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6e2d3550244..d3e76d3cade 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2013-07-01 Tom Tromey + + * 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)". + 2013-07-01 Tom Tromey * configure.ac (build_warnings): Add -Wold-style-declaration. diff --git a/gdb/configure b/gdb/configure index 7e08fba659e..822f2dfc282 100755 --- a/gdb/configure +++ b/gdb/configure @@ -12471,7 +12471,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 e0e5dd4efde..89a07b417e3 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1941,7 +1941,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 8d45f6f3b98..b56e21c5418 100644 --- a/gdb/machoread.c +++ b/gdb/machoread.c @@ -1037,7 +1037,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 250a1f0642b..b48c3c92cbc 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"); }