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

  1. Xref: sparky comp.std.c:2595 comp.std.c++:1137
  2. Newsgroups: comp.std.c,comp.std.c++
  3. Path: sparky!uunet!uunet.ca!canrem!telly!druid!pseudo!mjn
  4. From: mjn@pseudo.uucp (Murray Nesbitt)
  5. Subject: Re: Zero-length structures and pointer comparisons
  6. Organization: Private system in Toronto, ON
  7. Date: Wed, 9 Sep 1992 19:38:42 GMT
  8. Message-ID: <MJN.92Sep9113842@pseudo.uucp>
  9. In-Reply-To: fjh@munta.cs.mu.OZ.AU's message of 8 Sep 92 16:14:16 GMT
  10. References: <9225302.22791@mulga.cs.mu.OZ.AU>
  11. Sender: mjn@pseudo.uucp (Murray Nesbitt)
  12. Lines: 16
  13.  
  14.  
  15. fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
  16.  
  17. >is the following a legal (strictly conforming) program?
  18. >
  19. >    struct S { unsigned:0; }
  20. >    int main() { return sizeof(S); }
  21.  
  22. It is not a legal C program, but not due to any particular ANSI
  23. constraints.  It has syntax errors.  Perhaps you meant:
  24.  
  25.     struct S { unsigned:0; };
  26.     int main() { return sizeof(struct S); }
  27.  
  28. -- 
  29. Murray
  30.