Bug 24507

Summary: Compiler error from variable-size type
Product: [Retired] Red Hat Linux Reporter: Alex Selby <a.p.selby>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-01-21 18:31:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alex Selby 2001-01-21 16:35:07 UTC
Compiling this

int inv(int n,char mm[n][n]);
int inv(int n,char mm[n][n]){}

using gcc-2.96-69 and the command

gcc -c zog.c

gives this output

zog.c:2: variable-size type declared outside of any function
zog.c:2: variable-size type declared outside of any function

If you remove the first line (the prototype line) then it will compile
OK (It is exactly the same as one of the examples given in "info gcc"
--> C Extensions --> Variable Length). 

Also it compiles OK with earlier gcc's such as kgcc.

Comment 1 Jakub Jelinek 2001-01-21 18:31:15 UTC
Verified both in 2.96-71 and current FSF CVS head.
Will jump onto it in the coming week.

Comment 2 Jakub Jelinek 2001-02-05 21:08:30 UTC
Fixed in gcc-2.96-74.