public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/31288] New: Infinite for loop while initializing char array
@ 2007-03-20 21:04 bryan_sauser at pa-ucl dot com
2007-03-20 21:27 ` [Bug c++/31288] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: bryan_sauser at pa-ucl dot com @ 2007-03-20 21:04 UTC (permalink / raw)
To: gcc-bugs
I have a simple for for loop that initializes a char array and never stops.
Here is a small sample program that simulated the problem.
#include <stdio.h>
int main(int argc, char *argv[]){
int i=0;
char name_array[7][100];
for (i=0; i <= 7; i++)
{
printf("Loop i: %d\n", i);
name_array[i][0] = '\0';
}
return 1;
}
Here are my compile options
g++ -o testloop testloop.cpp
Example of the output
Loop i: 1
Loop i: 2
Loop i: 3
Loop i: 4
Loop i: 5
Loop i: 6
Loop i: 7
Loop i: 1
Loop i: 2
Loop i: 3
Loop i: 4
Loop i: 5
Loop i: 6
Loop i: 7
Loop i: 1
Loop i: 2
Loop i: 3
Loop i: 4
Loop i: 5
Loop i: 6
--
Summary: Infinite for loop while initializing char array
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bryan_sauser at pa-ucl dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31288
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/31288] Infinite for loop while initializing char array
2007-03-20 21:04 [Bug c++/31288] New: Infinite for loop while initializing char array bryan_sauser at pa-ucl dot com
@ 2007-03-20 21:27 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-20 21:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2007-03-20 21:26 -------
*** This bug has been marked as a duplicate of 31287 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31288
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-20 21:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-20 21:04 [Bug c++/31288] New: Infinite for loop while initializing char array bryan_sauser at pa-ucl dot com
2007-03-20 21:27 ` [Bug c++/31288] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).