&&**

Olivier Ridoux ridoux at irisa.fr
Thu Sep 6 19:16:05 AEST 1990


Hello,

I'd like to know about the portability of expressions of the form 
`` &^n*^n x '' (`` &*x '', `` &&**x '', `` &&&***x '', ...).

An expression of the form `` &&x '' seems to make no sense, since `` & '' 
requires a lvalue though it yields no lvalue.  So `` &&**x '' seems to be 
ruled out.

However, `` &*x '' and `` x '' have the same value though `` x '' may be a 
lvalue and `` &*x '' cannot if `` & '' is interpreted conservatively.  So 
expressions of the form `` &^n*^n x '' can be reduced to `` x '' through 
algebraic manipulation.  One can even consider that `` &^n*^n x '' has the 
lvalue-ness of `` x '' (in contrast with the conservative interpretation of 
`` & '').  The gcc compiler performs this algebraic simplification.

My question is: can a programmer expect that every C compiler will perform the
algebraic simplification of `` &^n*^nx '' to `` x '', and what will be the 
lvalue-ness of the expression ?

I thank you in advance,

Olivier Ridoux



More information about the Comp.lang.c mailing list