I am implementing a C compiler and have discovered a curious problem. Since & has a higher priority than && , it seems reasonable to consider it as binary - and the first operand with the address of the second:
x && y = (x) & ( &(y) )
A syntax review of specification C seems to allow this interpretation. Perhaps I lost something or misunderstood?
My understanding of syntax:
and expression: = expressionExpression | (andExpression '&' expressionExpression) | ...
...
unaryExpression: = postfixExpression | (('&' | '*' | '+' | '-' | '~' | '!') castExpression) | ...
source share