Path: utzoo!attcan!uunet!kddlab!ccut!titcca!sragwa!wsgw!socslgw!diamond!diamond From: diamond@diamond.csl.sony.junet (Norman Diamond) Newsgroups: comp.lang.c Subject: Re: Lvalues and casts Message-ID: <10283@socslgw.csl.sony.JUNET> Date: 24 May 89 13:41:10 GMT References: <847@tub.UUCP> <17370@usc.edu> Sender: news@csl.sony.JUNET Reply-To: diamond@csl.sony.junet (Norman Diamond) Organization: Sony Computer Science Laboratory Inc., Tokyo, Japan Lines: 32 In article <847@tub.UUCP> net@tub.UUCP (Oliver Laumann) writes: >> (int *)cp = ip; >>The PCC, however, says "illegal lvalue in assignment". Is this legal >>C, i.e. is the result of a cast really an lvalue? In article <17370@usc.edu> blarson@skat.usc.edu (Bob Larson) writes: >Casts are never lvalues. True. >Gcc documents this bug as a feature. Hmm. There are ways that it could be construed as a feature, and it doesn't break good code, but it really deserves a warning except when some fool disables such a warning. >(Hopefully it is caught by -pedantic) Yeah, let's hope so. Now get this: I am trying to fix a PCC. This PCC not only accepts such a construct, but its own code USES such a construct. And to stop using it would require just enough of a change, non-minimal and not necessary at this time, that I'm not fixing it at this time.... -- Norman Diamond, Sony Computer Science Lab (diamond%csl.sony.co.jp@relay.cs.net) The above opinions are my own. | Why are programmers criticized for If they're also your opinions, | re-implementing the wheel, when car you're infringing my copyright. | manufacturers are praised for it?