home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16779 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.0 KB  |  36 lines

  1. Newsgroups: comp.lang.c
  2. 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
  3. From: jutta@opal.cs.tu-berlin.de (Jutta Degener)
  4. Subject: Re: Is this ANSI?
  5. Message-ID: <1992Nov19.124858.5691@cs.tu-berlin.de>
  6. Sender: news@cs.tu-berlin.de
  7. Organization: Techn. University of Berlin, Germany
  8. References: <9eRguB1w165w@quest.UUCP>
  9. Date: Thu, 19 Nov 1992 12:48:58 GMT
  10. Lines: 24
  11.  
  12. kdq@quest.UUCP (Kevin D. Quitt) writes:
  13. > struct FM
  14. > {
  15. >    short    data_len;
  16. >    char    data[];        /*  This line is the kicker  */
  17. > };
  18. >
  19. > Is [this] legal ANSI code?
  20.  
  21. No.  In
  22. |    char    data[];
  23.  
  24. the member `data' has incomplete type [ANSI 3.5.4.2]. 
  25. A structure or union shall not contain a member with
  26. incomplete type [3.5.2.1, Constraints]; an ANSI C compiler
  27. must at least emit a warning about this.
  28.  
  29. The `complete' alternative,
  30. |    char    data[0];
  31.  
  32. is also illegal; the expression inside the []s must
  33. have a value greater than zero [3.5.4.2, Constraints].
  34.  
  35. Jutta (jutta@cs.tu-berlin.de)
  36.