qemu-kvm编译错误

今天编译了下qemu-kvm,死活编不过,错误信息如下:

CC    block/qcow2-snapshot.o

In file included from ./qemu-common.h:6:0,

from block/qcow2-snapshot.c:25:

block/qcow2-snapshot.c: In function ‘qcow2_write_snapshots’:

./compiler.h:36:23: error: typedef ‘qemu_build_bug_on__250’ locally defined but not used [-Werror=unused-local-typedefs]

typedef char cat2(qemu_build_bug_on__,__LINE__)[(x)?-1:1];

^

./compiler.h:33:18: note: in definition of macro ‘cat’

#define cat(x,y) x ## y

^

./compiler.h:36:18: note: in expansion of macro ‘cat2’

typedef char cat2(qemu_build_bug_on__,__LINE__)[(x)?-1:1];

^

block/qcow2-snapshot.c:249:5: note: in expansion of macro ‘QEMU_BUILD_BUG_ON’

QEMU_BUILD_BUG_ON(offsetof(QCowHeader, snapshots_offset) !=

^

cc1: all warnings being treated as errors

说是把警告都当错误处理,但这不是自己的代码,要消除警告啥弄啊。后来在Makefile里添加了下面一行:

QEMU_CFLAGS+=-w

再次编译成功了。

发表评论

电子邮件地址不会被公开。