From patchwork Tue Sep 29 23:10:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 34503 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 46E86B7C0E for ; Wed, 30 Sep 2009 09:15:11 +1000 (EST) Received: from localhost ([127.0.0.1]:38497 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsluW-0001ZR-7y for incoming@patchwork.ozlabs.org; Tue, 29 Sep 2009 19:15:08 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mslql-0000Is-RN for qemu-devel@nongnu.org; Tue, 29 Sep 2009 19:11:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mslqg-0000H5-Oa for qemu-devel@nongnu.org; Tue, 29 Sep 2009 19:11:15 -0400 Received: from [199.232.76.173] (port=41404 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mslqg-0000Gz-IO for qemu-devel@nongnu.org; Tue, 29 Sep 2009 19:11:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10010) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mslqg-0000Sg-3N for qemu-devel@nongnu.org; Tue, 29 Sep 2009 19:11:10 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8TNB9T9012268 for ; Tue, 29 Sep 2009 19:11:09 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8TNB4bp020143; Tue, 29 Sep 2009 19:11:08 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 30 Sep 2009 01:10:55 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 2/3] Add -Wold-style-* flags 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 This time, I add them in configure only if target compiler supports it Signed-off-by: Juan Quintela --- configure | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 8b0db7e..81bcc27 100755 --- a/configure +++ b/configure @@ -1653,6 +1653,16 @@ QEMU_CFLAGS="-U_FORTIFY_SOURCE $QEMU_CFLAGS" QEMU_CFLAGS="-I. -I\$(SRC_PATH) -MMD -MP -MT \$@ $QEMU_CFLAGS" LDFLAGS="-g $LDFLAGS" +gcc_flags="-Wold-style-declaration -Wold-style-definition" +cat > $TMPC << EOF +int main(void) { } +EOF +for flag in $gcc_flags; do + if compile_prog "$QEMU_CFLAGS" "$flag" ; then + QEMU_CFLAGS="$flag $QEMU_CFLAGS" + fi +done + # Consult white-list to determine whether to enable werror # by default. Only enable by default for git builds if test -z "$werror" ; then