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