From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31421 invoked by alias); 17 Jun 2013 18:42:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 31338 invoked by uid 89); 17 Jun 2013 18:42:59 -0000 X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,TW_FN autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 17 Jun 2013 18:42:57 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5HIgu0B001048 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 17 Jun 2013 14:42:56 -0400 Received: from barimba.redhat.com (ovpn-113-102.phx2.redhat.com [10.3.113.102]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r5HIgsRP015351; Mon, 17 Jun 2013 14:42:56 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 3/3] add -Wold-style-definition Date: Mon, 17 Jun 2013 18:59:00 -0000 Message-Id: <1371494572-26594-4-git-send-email-tromey@redhat.com> In-Reply-To: <1371494572-26594-1-git-send-email-tromey@redhat.com> References: <1371494572-26594-1-git-send-email-tromey@redhat.com> X-SW-Source: 2013-06/txt/msg00397.txt.bz2 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