Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!amdcad!weitek!aimt!breck From: breck@aimt.UU.NET (Robert Breckinridge Beatie) Newsgroups: comp.lang.c Subject: Re: Strange cc warning Summary: parens don't affect lvalueness (?) Message-ID: <2771@aimt.UU.NET> Date: 3 Feb 89 20:16:58 GMT References: <490@marob.MASA.COM> <10033@diamond.csl.sony.JUNET> Organization: AIM Technology, Santa Clara, CA Lines: 26 In article <10033@diamond.csl.sony.JUNET>, diamond@csl.sony.JUNET (Norman Diamond) writes: > In article <490@marob.MASA.COM>, daveh@marob.MASA.COM (Dave Hammond) writes: > > Line 88 ---------------------> strncpy((out)+1, (in), (len)); \ > > (out)[(len)-1] = 0; \ > > strcat((out), "\""); \ > > (in) = (out); } > > 2. I am really curious about line 91. When you wrap an lvalue in > parentheses, doesn't it become an rvalue? How can you assign to it? Since when? If this is the case, then it seems to be in direct contradiction with K&R (Appendix A Section 7.1) which says: ... The presence of parentheses does not affect whether the expression is an lvalue. And for that matter it even seems to contradict my (somewhat out of date) copy of the dpANS (Oct. 1986) which says (Section 3.3.1): A parenthesized expression is a primary expression. Its type and value are identical to those of the unadorned expression. it is an lvalue if the unadorned expression is an lvalue, ... -- Breck Beatie (408)748-8649 {uunet,ames!coherent}!aimt!breck OR breck@aimt.uu.net "Sloppy as hell Little Father. You've embarassed me no end."