This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/46759] incorrect array bounds warning?
- From: "LpSolit at netscape dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 25 Jan 2011 23:04:54 +0000
- Subject: [Bug c++/46759] incorrect array bounds warning?
- Auto-submitted: auto-generated
- References: <bug-46759-4@http.gcc.gnu.org/bugzilla/>
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?