[Bug other/78678] New: possibly missing -Warray-bounds warning
clyon at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Dec 5 10:23:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78678
Bug ID: 78678
Summary: possibly missing -Warray-bounds warning
Product: gcc
Version: 7.0
URL: https://bugs.linaro.org/show_bug.cgi?id=2349
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: clyon at gcc dot gnu.org
Target Milestone: ---
Arnd reported bug https://bugs.linaro.org/show_bug.cgi?id=2349.
gcc -fsanitize=object-size shows a useful warning that is not seen without that
option.
Compiling the attached code results in a warning:
atyfb_base.c:167:33: warning: array subscript is above array bounds
[-Warray-bounds]
only if one uses -fsanitize=object-size.
Removing this flag also removes the warning, which could probably be generated.
I've checked with today's trunk on arm-linux-gnueabi.
To reproduce the problem, compile with:
$ arm-none-linux-gnueabi-gcc -Wall -O2 -fno-partial-inlining
-Wno-unused-but-set-variable -Wno-pointer-sign -fsanitize=object-size
atyfb_base.i -c
[generates warning]
recompile without -fsanitize=object-size, it does not generate any warning.
More information about the Gcc-bugs
mailing list