Article View: comp.std.c
Article #1182Re: Zero-length structures and pointer comparisons
From: Murray Nesbitt
Date: Wed, 09 Sep 1992 19:38
Date: Wed, 09 Sep 1992 19:38
16 lines
891 bytes
891 bytes
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
Technical Details
Message-ID:
<MJN.92Sep9113842@pseudo.uucp>Path:
arc1-ca.pugleaf.net!sparky!uunet!uunet.ca!canrem!telly!druid!pseudo!mjnReferences:
<9225302.22791@mulga.cs.mu.OZ.AU>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c,comp.std.c++ Path: arc1-ca.pugleaf.net!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