From patchwork Sat Sep 4 21:26:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 63809 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E953FB713B for ; Sun, 5 Sep 2010 07:29:25 +1000 (EST) Received: from localhost ([127.0.0.1]:60509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Os0Id-0005wD-88 for incoming@patchwork.ozlabs.org; Sat, 04 Sep 2010 17:29:23 -0400 Received: from [140.186.70.92] (port=46351 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Os0GN-0004t7-DO for qemu-devel@nongnu.org; Sat, 04 Sep 2010 17:27:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Os0GM-00040C-9n for qemu-devel@nongnu.org; Sat, 04 Sep 2010 17:27:03 -0400 Received: from mail-qy0-f173.google.com ([209.85.216.173]:58305) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Os0GM-000406-3f for qemu-devel@nongnu.org; Sat, 04 Sep 2010 17:27:02 -0400 Received: by qyk34 with SMTP id 34so1408011qyk.4 for ; Sat, 04 Sep 2010 14:27:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=cSxgqM2Bjvn4yxoYW5M6/uO7ErWIdLO4CngqDrAT8Zs=; b=EPpVp5YP3glT2c1wR29iGSbP0oipCz0DKa7czy8f0tdi5Dw2sD3X7DFTkvEADsM/yk zbQIPGvuQAYJsCSHhjRIo6bc6cR076SLghrslxr/gNWm2RMGdRUDsAisNUqMaBwl0Jgk Yfj7kyhnNLmlxb7b4FTs5c6BDalj7dH2xFAJE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=YTJT5wdL8RHdyCgBt0s1g1cxnB5RUbgs6RopFseGuo3W5g3CdI227SeEUU9y9Vop22 VNHUSEfjyVdxIRNZ/AsCeB8nzMp/veEKZwx1DX0kDI/cxccmt6owmP75Y7cB9Gg5p5bx 4N9oT1ewCMT0TnHrhCkbHWHBswGoditDk6I9Q= Received: by 10.229.116.144 with SMTP id m16mr1597751qcq.260.1283635621494; Sat, 04 Sep 2010 14:27:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.240.135 with HTTP; Sat, 4 Sep 2010 14:26:41 -0700 (PDT) From: Blue Swirl Date: Sat, 4 Sep 2010 21:26:41 +0000 Message-ID: To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH] Use gcc warning flag -Wnested-externs, fix warnings X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org If the compiler supports the warning flag -Wnested-externs, use it. Fix the only warning by moving the xml_builtin declaration to a more proper place. Signed-off-by: Blue Swirl --- configure | 2 +- feature_to_c.sh | 1 - gdbstub.c | 1 - gdbstub.h | 3 +++ 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 61626b8..78829e9 100755 --- a/configure +++ b/configure @@ -140,7 +140,7 @@ LDFLAGS="-g $LDFLAGS" gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" -gcc_flags="-Wmissing-include-dirs -Wclobbered -Wempty-body $gcc_flags" +gcc_flags="-Wmissing-include-dirs -Wclobbered -Wempty-body -Wnested-externs $gcc_flags" gcc_flags="-fstack-protector-all $gcc_flags" cat > $TMPC << EOF int main(void) { return 0; } diff --git a/feature_to_c.sh b/feature_to_c.sh index dbf9f19..0994d95 100644 --- a/feature_to_c.sh +++ b/feature_to_c.sh @@ -63,7 +63,6 @@ for input; do done echo >> $output -echo "extern const char *const xml_builtin[][2];" >> $output echo "const char *const xml_builtin[][2] = {" >> $output for input; do diff --git a/gdbstub.c b/gdbstub.c index 2b03ef2..0aa081b 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1504,7 +1504,6 @@ static int memtox(char *buf, const char *mem, int len) static const char *get_feature_xml(const char *p, const char **newp) { - extern const char *const xml_builtin[][2]; size_t len; int i; const char *name; diff --git a/gdbstub.h b/gdbstub.h index 219abda..ce5fdcc 100644 --- a/gdbstub.h +++ b/gdbstub.h @@ -38,4 +38,7 @@ int gdbserver_start(int); int gdbserver_start(const char *port); #endif +/* in gdbstub-xml.c, generated by feature_to_c.sh */ +extern const char *const xml_builtin[][2]; + #endif