From patchwork Wed Mar 27 13:34:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 231689 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6A6622C0098 for ; Thu, 28 Mar 2013 00:35:09 +1100 (EST) Received: from localhost ([::1]:36289 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKqVN-0008R0-AA for incoming@patchwork.ozlabs.org; Wed, 27 Mar 2013 09:35:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKqV3-0008Nr-B7 for qemu-devel@nongnu.org; Wed, 27 Mar 2013 09:34:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKqV1-0004dq-NL for qemu-devel@nongnu.org; Wed, 27 Mar 2013 09:34:45 -0400 Received: from mail-ea0-x230.google.com ([2a00:1450:4013:c01::230]:37139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKqV1-0004dj-HM for qemu-devel@nongnu.org; Wed, 27 Mar 2013 09:34:43 -0400 Received: by mail-ea0-f176.google.com with SMTP id h10so3479518eaj.35 for ; Wed, 27 Mar 2013 06:34:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:subject:date:message-id:x-mailer :mime-version:content-type:content-transfer-encoding; bh=ID6qu2J/51J14Ka9qBrYfeGqu7hSPz58ZmCxVjj/VlU=; b=SR0EPRqx5/dt0+VlqO6IFMGsxlZ1m96y/cP8F+2Bw8M466of1LQQFSkeuEn1uus6WK 4kO8fa/9dQb5aSe7WIJgfDO/fTVkAP8ogYiHknz43j3A3oVbViD43nJ+mealZNho49BG O7K7VpVPLReHX7x7zbuLmFjofhGwb4dU+2QW+6xp38+bSbUhQMOvJz9xNl57Nsm1ytkV /ZtcjFwOKK/jUyzD4cTsTB9KIbde33X202JuNSMH23I8S3k43Mqghfzinj8mljJxid1b HPlGefPOIe3XbGeqywxnlXCjS23X157O//ZPUBo6ZdIhPikn3wKONF9YeOjgrFw0Jdw2 vnww== X-Received: by 10.14.175.71 with SMTP id y47mr31984998eel.18.1364391282610; Wed, 27 Mar 2013 06:34:42 -0700 (PDT) Received: from yakj.lan (93-34-176-20.ip50.fastwebnet.it. [93.34.176.20]) by mx.google.com with ESMTPS id f47sm31332696eep.13.2013.03.27.06.34.40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 27 Mar 2013 06:34:41 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 27 Mar 2013 14:34:32 +0100 Message-Id: <1364391272-1128-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::230 Subject: [Qemu-devel] [PATCH] compiler: fix warning with GCC 4.8.0 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org GCC 4.8.0 introduces a new warning: block/qcow2-snapshot.c: In function 'qcow2_write_snapshots’: block/qcow2-snapshot.c:252:18: error: typedef 'qemu_build_bug_on__253' locally defined but not used [-Werror=unused-local-typedefs] QEMU_BUILD_BUG_ON(offsetof(QCowHeader, snapshots_offset) != ^ cc1: all warnings being treated as errors (Caret diagnostics aren't perfect yet with macros... :)) Work around it with __attribute__((unused)). Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- include/qemu/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 2f7998b..6175c24 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -33,7 +33,7 @@ #define cat(x,y) x ## y #define cat2(x,y) cat(x,y) #define QEMU_BUILD_BUG_ON(x) \ - typedef char cat2(qemu_build_bug_on__,__LINE__)[(x)?-1:1]; + typedef char cat2(qemu_build_bug_on__,__LINE__)[(x)?-1:1] __attribute__((unused)); #if defined __GNUC__ # if !QEMU_GNUC_PREREQ(4, 4)