parens around sizeof arg

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Thu Mar 7 01:49:16 AEST 1985


I had always thought that
	( lvalue_expr )
would not be an lvalue_expr, but checking in the proposed ANSI spec
I see that the parentheses do not affect lvalueness, so extra parens
	sizeof(thing)
do no actual harm, although they are a bit sloppy, as is
	return(expr);
when
	return expr;
would do.

There turns out to be a real use for the unary + operator, which is
to remove lvalueness from an expression:
	+(lvalue_expr)
is not an lvalue.



More information about the Comp.lang.c mailing list