Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@redhat.com>
Subject: [PATCH 3/3] add -Wold-style-definition
Date: Mon, 17 Jun 2013 18:59:00 -0000	[thread overview]
Message-ID: <1371494572-26594-4-git-send-email-tromey@redhat.com> (raw)
In-Reply-To: <1371494572-26594-1-git-send-email-tromey@redhat.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


  parent reply	other threads:[~2013-06-17 18:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-17 18:42 [PATCH 0/3] add a few new warning options Tom Tromey
2013-06-17 18:42 ` [PATCH 2/3] add -Wold-style-declaration Tom Tromey
2013-07-01 19:49   ` Tom Tromey
2013-06-17 18:42 ` [PATCH 1/3] add -Wmissing-parameter-type Tom Tromey
2013-06-17 18:59 ` Tom Tromey [this message]
2013-07-02  8:08   ` Build regression on CentOS-5 [Re: [PATCH 3/3] add -Wold-style-definition] Jan Kratochvil
2013-07-02 20:53     ` Tom Tromey
2013-07-02 20:54       ` Tom Tromey
2013-07-03  9:00         ` Jan Kratochvil
2013-07-10 16:28           ` Tom Tromey
2013-07-10 16:51         ` Michael Eager
2013-07-10 18:11           ` Tom Tromey
2013-07-10 18:24             ` Joel Brobecker
2013-07-10 19:11               ` Michael Eager
2013-06-18  5:14 ` [PATCH 0/3] add a few new warning options Joel Brobecker
2013-07-01 19:46 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371494572-26594-4-git-send-email-tromey@redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox