🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3695

Re: Parenthesis with return ?

#3695
From: Peter Holzer
Date: Thu, 10 Aug 1995 16:25
30 lines
1310 bytes
martin@kcbbs.gen.nz (Martin Kealey) writes:

>"( type-name )" sure looks a lot like a cast to me ...

>The shift states in many parsers would see that as a cast leading into an
>expression, and then note that the thing following the ) is not valid for an
>expression, and reduce the sizeof.

I hope not. 

int i = 1;
char j;

j = (char) - i;
j = sizeof (char) - i;

If you were right, they would find that what follows the ) in the second
expression is valid for an expression and assign 1 instead of 0 to j.

>Is there any harm in refering to something that looks & acts like a cast,
>"a cast"?

No. But it doesn't act like a cast.

	hp
--
   _  | Peter Holzer | Systemadministrator WSR | hjp@wsr.ac.at
|_|_) |-------------------------------------------------------
| |   |  ...and it's finished!  It only has to be written.
__/   |         -- Karl Lehenbauer
Technical Details
Message-ID: <40dbth$boo@wsrcom.wsr.ac.at>
Path: arc1-ca.pugleaf.net!wsrcom.wsr.ac.at!wsrdb!hjp
References: <405fhs$iin@boson.epita.fr> <DCy9uG.CEr@proteon.com> <DCz7qw.HvM@stdc.demon.co.uk> <6495221.12652.4448@kcbbs.gen.nz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!wsrcom.wsr.ac.at!wsrdb!hjp
From: hjp@wsrdb.wsr.ac.at (Peter Holzer)
Newsgroups: comp.std.c
Subject: Re: Parenthesis with return ?
Date: 10 Aug 1995 16:25:21 GMT
Organization: WSR, Vienna, Austria
Message-ID: <40dbth$boo@wsrcom.wsr.ac.at>
References: <405fhs$iin@boson.epita.fr> <DCy9uG.CEr@proteon.com> <DCz7qw.HvM@stdc.demon.co.uk> <6495221.12652.4448@kcbbs.gen.nz>
NNTP-Posting-Host: wsrdb.wsr.ac.at