Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!wuarchive!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!diamond From: diamond@tkou02.enet.dec.com (diamond@tkovoa) Newsgroups: comp.lang.c Subject: Re: Comma operator: lvalue???? Message-ID: <1907@tkou02.enet.dec.com> Date: 9 Aug 90 04:42:59 GMT References: <10839@crdgw1.crd.ge.com> Reply-To: diamond@tkou02.enet.dec.com (diamond@tkovoa) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 29 In article <10839@crdgw1.crd.ge.com> volpe@underdog.crd.ge.com (Christopher R Volpe) writes: >Can someone with a copy of the standard tell me if the comma >operator produces an lvalue. This is one of the only operators >that K&R2 fails to mention whether or not it returns an lvalue. The last draft of the standard puts it in a FOOTNOTE that the comma operator does not produce an lvalue. And because of the positioning of the footnote, it is very easy to miss. It is typographically correct but accidentally ended up in a reader-unfriendly manner, so it looks like even K&R missed it! >My intuition at first would tell me no, but the following works >under GNU C: In some cases, if a compiler provides an extension, it is still required to issue a warning. However, it seems that this extension does not require a warning. No syntax or constraints section seems to say which expressions yield lvalues. >I assume that if the comma operator EVER produces an lvalue, it does >so if and only if the right operand is an lvalue. Is this correct? Intuitively it's hard to imagine how the result could be an lvalue if the right operand isn't an lvalue. However, when you're asking what's correct, you have to RTIFM (I == implementation's). -- Norman Diamond, Nihon DEC diamond@tkou02.enet.dec.com This is me speaking. If you want to hear the company speak, you need DECtalk.