Variable length array

Alan Lehotsky lehotsky@tiac.net
Mon Aug 3 07:46:00 GMT 1998


> Trying to compile the following with gcc version 2.7.2.1 or egcs-1.0.3
> 
> int main()
> {
>    int dim; 
>    dim = 3;  
>    
>    /* GNU variable length array */
>    int gnu_array[dim]; 
>    return 0;
> } 
> 


	That's not legal C.  You can't have declarations in a block
	after executable statements. [It would be legal C++....]

-- Al



More information about the Gcc-bugs mailing list