[Bug middle-end/48666] [4.6/4.7 Regression] -Warray-bounds doesn't trigger anymore for simple case

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 6 13:25:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48666

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-12-06 13:25:11 UTC ---
Clang warns:

pr48666.c:11:3: warning: array index of '4' indexes past the end of an array
(that contains 3 elements) [-Warray-bounds]
  x->val32Tab3[4] = 42;
  ^            ~
pr48666.c:5:3: note: array 'val32Tab3' declared here
  int val32Tab3[3];
  ^
1 warning generated.

It seems they took the opposite view:

http://llvm.org/bugs/show_bug.cgi?id=10871



More information about the Gcc-bugs mailing list