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++/46759] incorrect array bounds warning?


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

--- Comment #4 from rwgk at yahoo dot com 2010-12-05 06:14:35 UTC ---
Created attachment 22639
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22639
reproducer for similar warning from gcc 4.6

I'm getting a similar warning with g++ from the current svn trunk:

svn trunk rev. 167466

g++ (GCC) 4.6.0 20101205 (experimental)

% g++ -Wall -O3 pr46759_bounds_warning_2.cpp
pr46759_bounds_warning_2.cpp: In function 'int main()':
pr46759_bounds_warning_2.cpp:11:3: warning: array subscript is above array
bounds [-Warray-bounds]

The reproducer is attached.
g++ 4.5.1 doesn't emit a warning.
Would it be better to file this as a new bug?


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