Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 02 Dec 2012 17:50:49 -0600 Message-ID: <50BBE95D.268A@mindspring.com> Date: Sun, 02 Dec 2012 18:50:53 -0500 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: Casts on lvalues References: <50BBC645.3780@mindspring.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 40 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.156.228.199 X-Trace: sv3-j789CkCOtNqPU94ZmkCx0Dn/XadynB2rQHygR4dYpTsFVJy5J9RbJYdVcvZZlc7+NoMPvqnNUnti4KW!Y/IlxBV/X3MmYvjIaOAc+snBZiKUYDH78+fHp647NDeYaDtAWXVIxsLDC+UOCR4yLy6vif72nvD5!kOJg09S6l7E= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2243 Xref: csiph.com comp.lang.c:28893 Eric Sosman wrote: > > On 12/2/2012 4:21 PM, pete wrote: > > Keith Thompson wrote: > > > >> The result of a cast is not an lvalue. > > > > I don't think that the standard explicitly states this; > > It's in a footnote to 6.5.4p5. Footnotes are non-normative, > but then there's the definition of lvalue in 6.3.2.1p1: > > "An lvalue is an expression [...] that potentially > designates an object [...]" > > There is no cast that produces an object designator,[*] hence > there is no cast that produces an lvalue. > > [*] You can (sometimes) derive an lvalue from the result > of a cast by applying an operator to it, as in > > * (unsigned char*)&foo = 42; > > or > ((struct baz*)&foo) -> mumble = 17; > > > but as far as I can tell, > > the result of any conversion of the type of any expression, > > is not an lvalue. > > Even a non-conversion is not an lvalue: > > double trouble; > (double)trouble = 3.14; // BZZZT! The other type conversion that I was thinking of, was the implicit conversion of an array type. -- pete