c/4247: gcc fills variable with random data
aoliva@gcc.gnu.org
aoliva@gcc.gnu.org
Sun Sep 9 14:51:00 GMT 2001
Synopsis: gcc fills variable with random data
State-Changed-From-To: open->closed
State-Changed-By: aoliva
State-Changed-When: Sun Sep 9 14:51:29 2001
State-Changed-Why:
This is the kind of thing to be expected when you invoke undefined behavior. After c=-1, result[c++] indexes result[-1], and then increments c. -1 is not a valid index into result. From that point on, all bets are off. Perhaps you meant result[++c] ?
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4247&database=gcc
More information about the Gcc-bugs
mailing list