This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc/g++ not ISO compliance?
- From: Vincent Rivellino <vrivelli at cs dot vt dot edu>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 Jan 2003 09:58:54 -0500 (EST)
- Subject: gcc/g++ not ISO compliance?
I'm not sure if this is a bug or a feature, but I wanted to report it (and
see what the response was).
There is a thread on a university class discussion board that I
administrate for the Computer Science Department at Virginia Tech that
discusses dynamic array dimensions.
Here's the thread: https://forum.cs.vt.edu/topic_show.pl?tid=4731
Would anyone care to give me an explanation?
Thanks,
Vince
PS: The two posts that most interest me:
> See ISO Standard Item 8.3.4.1; the dimension if present must be a
> constant expression. Period. No exceptions. If g++ 3.2 accepts this
> code then it is out of compliance.
> FYI, I tried to compile and run
> this code (with proper header of course):
>
> int i;
> cin>>i;
> int array[ i ]; // i is dynamic
> cout<<endl;
> for (int j=0; j<i; j++) // see if there is any run-time error
> cout<<array[j]<<endl;
>
> It works perfectly.