summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-03-27 14:34:32 +0100
committerMichael Roth <mdroth@linux.vnet.ibm.com>2013-04-04 19:53:21 -0500
commitda78a1bc7a6ad2c0653c265a19032540921c15d0 (patch)
treeaef239aadca1fde2d2ace774eba7111a5af63138
parent2b92aa36d112780674d5686ad9c98e8cfe68d207 (diff)
downloadqemu-da78a1bc7a6ad2c0653c265a19032540921c15d0.tar.gz
compiler: fix warning with GCC 4.8.0
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 <pbonzini@redhat.com> Message-id: 1364391272-1128-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 99835e00849369bab726a4dc4ceed1f6f9ed967c) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--include/qemu/compiler.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index 2f7998b6c1..6175c24c94 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)