1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
instruction: 0.778
graphic: 0.706
device: 0.643
semantic: 0.635
mistranslation: 0.537
socket: 0.418
network: 0.411
assembly: 0.240
other: 0.236
vnc: 0.227
boot: 0.197
KVM: 0.167
[Qemu-devel] [BUG] Failed to compile using gcc7.1
Hi all,
After upgrading gcc from 6.3.1 to 7.1.1, qemu can't be compiled with gcc.
The error is:
------
CC block/blkdebug.o
block/blkdebug.c: In function 'blkdebug_refresh_filename':
block/blkdebug.c:693:31: error: '%s' directive output may be truncated
writing up to 4095 bytes into a region of size 4086
[-Werror=format-truncation=]
"blkdebug:%s:%s", s->config_file ?: "",
^~
In file included from /usr/include/stdio.h:939:0,
from /home/adam/qemu/include/qemu/osdep.h:68,
from block/blkdebug.c:25:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk'
output 11 or more bytes (assuming 4106) into a destination of size 4096
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [/home/adam/qemu/rules.mak:69: block/blkdebug.o] Error 1
------
It seems that gcc 7 is introducing more restrict check for printf.
If using clang, although there are some extra warning, it can at least
pass the compile.
Thanks,
Qu
|