From mboxrd@z Thu Jan 1 00:00:00 1970 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) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 27 Mar 2013 14:34:32 +0100 Message-Id: <1364391272-1128-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH] compiler: fix warning with GCC 4.8.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@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 --- 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) -- 1.8.1.4