提交 da78a1bc 编写于 作者: P Paolo Bonzini 提交者: Michael Roth

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: NPaolo Bonzini <pbonzini@redhat.com>
Message-id: 1364391272-1128-1-git-send-email-pbonzini@redhat.com
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 99835e00)
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 2b92aa36
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#define cat(x,y) x ## y #define cat(x,y) x ## y
#define cat2(x,y) cat(x,y) #define cat2(x,y) cat(x,y)
#define QEMU_BUILD_BUG_ON(x) \ #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 defined __GNUC__
# if !QEMU_GNUC_PREREQ(4, 4) # if !QEMU_GNUC_PREREQ(4, 4)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册