home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!cs.tu-berlin.de!jutta
- From: jutta@opal.cs.tu-berlin.de (Jutta Degener)
- Subject: Re: Is this ANSI?
- Message-ID: <1992Nov19.124858.5691@cs.tu-berlin.de>
- Sender: news@cs.tu-berlin.de
- Organization: Techn. University of Berlin, Germany
- References: <9eRguB1w165w@quest.UUCP>
- Date: Thu, 19 Nov 1992 12:48:58 GMT
- Lines: 24
-
- kdq@quest.UUCP (Kevin D. Quitt) writes:
- > struct FM
- > {
- > short data_len;
- > char data[]; /* This line is the kicker */
- > };
- >
- > Is [this] legal ANSI code?
-
- No. In
- | char data[];
-
- the member `data' has incomplete type [ANSI 3.5.4.2].
- A structure or union shall not contain a member with
- incomplete type [3.5.2.1, Constraints]; an ANSI C compiler
- must at least emit a warning about this.
-
- The `complete' alternative,
- | char data[0];
-
- is also illegal; the expression inside the []s must
- have a value greater than zero [3.5.4.2, Constraints].
-
- Jutta (jutta@cs.tu-berlin.de)
-