This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/66397] sanitize=undefined triggers extra -Warray-bounds warning
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 03 Jun 2015 11:56:23 +0000
- Subject: [Bug c/66397] sanitize=undefined triggers extra -Warray-bounds warning
- Auto-submitted: auto-generated
- References: <bug-66397-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66397
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Comment on attachment 35691
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35691
testcase, warns with gcc-6 -c -O2 -fsanitize=undefined
Except it is undefined behavior to have one element before the start of an
array. And that is why it is warning. Does not matter if there is a ++ later
on.