🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9451

Re: sizeof (int) - 1

#9451
From: Dale Worley
Date: Wed, 01 Oct 1986 20:04
14 lines
835 bytes
> It is interesting that the expression
> 	sizeof (int) - 1
> is ambiguous in C, for it can be parsed as
> 	sizeof ((int)(- 1))
> or as
> 	(sizeof(int)) - 1
> 
> Think about it!

Both K&R (App. A, 7.2) and Harbison&Steele (7.4.2) note that it is
ambiguous on the face of it, and that it is to be resolved in favor of
	(sizeof (int)) - 1

Dale
Technical Details
Message-ID: <356@cullvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!think!nike!ll-xn!cullvax!drw
References: <102500008@uiucuxc>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!think!nike!ll-xn!cullvax!drw
From: drw@cullvax.UUCP (Dale Worley)
Newsgroups: net.lang.c
Subject: Re: sizeof (int) - 1
Message-ID: <356@cullvax.UUCP>
Date: Wed, 1-Oct-86 16:04:04 EDT
Article-I.D.: cullvax.356
Posted: Wed Oct  1 16:04:04 1986
Date-Received: Fri, 3-Oct-86 10:31:40 EDT
References: <102500008@uiucuxc>
Organization: Cullinet Software, Inc., Westwood, MA
Lines: 14