Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!GLACIER.ICS.UCI.EDU!schmidt From: schmidt@GLACIER.ICS.UCI.EDU ("Douglas C. Schmidt") Newsgroups: gnu.gcc.bug Subject: variable length arrays broken? Message-ID: <8904032055.aa00525@PARIS.ICS.UCI.EDU> Date: 4 Apr 89 03:55:49 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 34 The following is an example from the gcc.texinfo file: ---------------------------------------- int foo; struct entry { char data[foo]; }; struct entry tester (struct entry arg) { struct entry new; int i; for (i = 0; i < foo; i++) new.data[i] = arg.data[i] + 1; return new; } ---------------------------------------- This does not compile with gcc 1.34, however. The compiler complains that: ---------------------------------------- test.c:5: variable-size type declared outside of any function ---------------------------------------- Is the documentation out-of-date, or is the compiler wrong? thanks, Doug