C parsing : Significance of spaces
jgw at maxvax.UUCP
jgw at maxvax.UUCP
Thu Apr 26 01:05:09 AEST 1984
a++++++++++++++++++++++++++++++++++++b - eat this!
I am not convinced that a+++b should be resolved as (a++) + b. K&R
states that unary operators have a higher precedence than binary ops,
and that the former bind right to left.
Should not the above be disambiguated as a + (++b)?
However it is well known that the semantics of a language and
its implementation by a compiler are not always the same ( shock! ).
Our compiler (UNIX V) evaluates as (a++) + b.
Have you tried a-----b ???
Any programmer worth their salt, never meets these problems due
to their judicious use of spaces and parentheses!!!
John Weald.
More information about the Comp.lang.c
mailing list