This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31287] Infinite for loop while initializing char array
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Mar 2007 21:01:06 -0000
- Subject: [Bug c++/31287] Infinite for loop while initializing char array
- References: <bug-31287-14280@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2007-03-20 21:01 -------
Note you are going over name_array's bounds so you are invoking undefined
behavior. 7 <= 7. arrays go from 0 to last-1 in C or (0, last-1] in math
notation for C arrays.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31287