linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* New -Werror=restrict error with incremental gcc
@ 2018-03-14 21:19 Laura Abbott
  2018-03-15 12:50 ` Jiri Olsa
  2018-03-15 14:30 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 7+ messages in thread
From: Laura Abbott @ 2018-03-14 21:19 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Adrian Hunter, Jiri Olsa, Namhyung Kim,
	Wang Nan, Josh Poimboeuf
  Cc: Linux Kernel Mailing List

Hi,

Fedora picked up a new gcc (8.0.1-0.18.fc29) and it seems to have introduced a new error:

   gcc -Wp,-MD,/home/labbott/linux/tools/objtool/.str_error_r.o.d -Wp,-MT,/home/labbott/linux/tools/objtool/str_error_r.o -Wall -Werror -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wno-switch-default -Wno-switch-enum -Wno-packed -fomit-frame-pointer -O2 -g -I/home/labbott/linux/tools/include -I/home/labbott/linux/tools/arch/x86/include/uapi -I/home/labbott/linux/tools/objtool/arch/x86/include -I/home/labbott/linux/tools/lib -D"BUILD_STR(s)=#s" -c -o /home/labbott/linux/tools/objtool/str_error_r.o ../lib/str_error_r.c
../lib/str_error_r.c: In function ‘str_error_r’:
../lib/str_error_r.c:25:3: error: passing argument 1 to restrict-qualified parameter aliases with argument 5 [-Werror=restrict]
    snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, %p, %zd)=%d", errnum, buf, buflen, err);
    ^~

This looks like gcc is now warning about the aliasing from printing out buf
while printing to the buffer. I can work around this pretty easily but I
know people have strong opinions about gcc warnings. Any thoughts?

Thanks,
Laura

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-20  6:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-14 21:19 New -Werror=restrict error with incremental gcc Laura Abbott
2018-03-15 12:50 ` Jiri Olsa
2018-03-15 14:30 ` Arnaldo Carvalho de Melo
2018-03-15 15:06   ` Laura Abbott
2018-03-16  3:11     ` Josh Poimboeuf
2018-03-17  0:56       ` Laura Abbott
2018-03-20  6:36       ` [tip:perf/core] objtool, perf: Fix GCC 8 -Wrestrict error tip-bot for Josh Poimboeuf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).