This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/66397] sanitize=undefined triggers extra -Warray-bounds warning


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]