Strange cc warning

Robert Breckinridge Beatie breck at aimt.UU.NET
Sat Feb 4 06:16:58 AEST 1989


In article <10033 at diamond.csl.sony.JUNET>, diamond at csl.sony.JUNET (Norman Diamond) writes:
> In article <490 at marob.MASA.COM>, daveh at 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 at aimt.uu.net
"Sloppy as hell Little Father.  You've embarassed me no end."



More information about the Comp.lang.c mailing list