🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1180

Re: Zero-length structures and pointer comparisons

#1180
From: John F. Woods
Date: Tue, 08 Sep 1992 21:39
10 lines
790 bytes
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 :-).
Technical Details
Message-ID: <15604@ksr.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!world!ksr!jfw
References: <9225302.22791@mulga.cs.mu.OZ.AU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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