g++ compiling code that is wrong.
Andrew Pinski
pinskia@physics.uc.edu
Wed Apr 27 21:22:00 GMT 2005
>
> Hello.
>
> I dont know if I am to write here, but I think I found a bug that I know
> is not related to my hardware or my system. Problem is that I don't know
> how to report it or if it allready been reported(Kind of hard to search
> for a bug when you dont know how to describe it.).
>
> Backstory : I am a bit of a newbie on C++ and was doing a
> schoolassigment where I was to make a dynamic array. I didn't do it
> right but the code compile(and work on gentoo, didn't work on windowsXP)
> anyway.
>
> Instead of using new and delete[] when making the array, I wrote a code
> that was something like this :
>
> {
> int b;
> char a[b];
>
> cout << "bla bla bla";
> cin.getline(a,b);
> }
This is a GNU extension which is now the bases for the VLAs in C99.
-- Pinski
More information about the Gcc-bugs
mailing list