Bug 24507 - Compiler error from variable-size type
Compiler error from variable-size type
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-01-21 11:35 EST by Alex Selby
Modified: 2007-04-18 12:30 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-01-21 13:31:19 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Alex Selby 2001-01-21 11:35:07 EST
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 13:31:15 EST
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 16:08:30 EST
Fixed in gcc-2.96-74.

Note You need to log in before you can comment on or make changes to this bug.