🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1750

Re: Legal ansi?

#1750
From: Dave Hanson
Date: Wed, 05 Oct 1988 11:58
12 lines
847 bytes
In article <765@paris.ics.uci.edu> Doug Schmidt <schmidt@crimee.ics.uci.edu> writes:
	Hi,
	
	   Is the following short code legal Ansi-C?  gcc -ansi accepts it,
	gcc -pedantic rejects it, and the Sun 4.0 cc compiler also rejects it.
	
	...
	{      
	  (( P->Item > Item ) ? P->Left : P->Right ) = (Tree *) malloc(sizeof(Tree));
	}

no. conditional expressions are not l-values.
Technical Details
Message-ID: <12411@princeton.Princeton.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!njin!princeton!notecnirp!drh
References: <765@paris.ics.uci.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!njin!princeton!notecnirp!drh
From: drh@notecnirp.Princeton.EDU (Dave Hanson)
Newsgroups: gnu.gcc.bug
Subject: Re: Legal ansi?
Message-ID: <12411@princeton.Princeton.EDU>
Date: 5 Oct 88 11:58:27 GMT
References: <765@paris.ics.uci.edu>
Sender: news@princeton.Princeton.EDU
Reply-To: drh@notecnirp.UUCP (Dave Hanson)
Distribution: gnu
Organization: Dept. of Computer Science, Princeton University
Lines: 12