This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g++ compiling code that is wrong.


> 
> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]