home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.std.c:2595 comp.std.c++:1137
- Newsgroups: comp.std.c,comp.std.c++
- Path: sparky!uunet!uunet.ca!canrem!telly!druid!pseudo!mjn
- From: mjn@pseudo.uucp (Murray Nesbitt)
- Subject: Re: Zero-length structures and pointer comparisons
- Organization: Private system in Toronto, ON
- Date: Wed, 9 Sep 1992 19:38:42 GMT
- Message-ID: <MJN.92Sep9113842@pseudo.uucp>
- In-Reply-To: fjh@munta.cs.mu.OZ.AU's message of 8 Sep 92 16:14:16 GMT
- References: <9225302.22791@mulga.cs.mu.OZ.AU>
- Sender: mjn@pseudo.uucp (Murray Nesbitt)
- Lines: 16
-
-
- fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
-
- >is the following a legal (strictly conforming) program?
- >
- > struct S { unsigned:0; }
- > int main() { return sizeof(S); }
-
- It is not a legal C program, but not due to any particular ANSI
- constraints. It has syntax errors. Perhaps you meant:
-
- struct S { unsigned:0; };
- int main() { return sizeof(struct S); }
-
- --
- Murray
-