home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / std / c / 2593 < prev    next >
Encoding:
Text File  |  1992-09-08  |  771 b   |  22 lines

  1. Path: sparky!uunet!world!ksr!jfw
  2. From: jfw@ksr.com (John F. Woods)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Zero-length structures and pointer comparisons
  5. Message-ID: <15604@ksr.com>
  6. Date: 8 Sep 92 17:39:12 EDT
  7. References: <9225302.22791@mulga.cs.mu.OZ.AU>
  8. Sender: news@ksr.com
  9. Lines: 11
  10.  
  11. fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
  12. >First, a question for comp.std.c:
  13. >is the following a legal (strictly conforming) program?
  14. >    struct S { unsigned:0; }
  15. >    int main() { return sizeof(S); }
  16.  
  17. No.  "If the struct-declaration-list contains no named members, the behavior
  18. is undefined."  This is not a Constraint, so no message is required by the
  19. Standard; the compiler can do something arbitrarily cruel and stupid without
  20. even giving a hint as to what it is up to :-).
  21.  
  22.