A curriosity in the C compiler...

Richard A. O'Keefe ok at quintus.uucp
Fri Oct 28 19:10:01 AEST 1988


In article <530 at uvicctr.UUCP> sbanner1 at uvicctr.UUCP (S. John Banner) writes:
>	This is a quick test of the C compiler, for implied bracketing...
>This will determine if the expression "a = b == c" is parsed
>as "(a = b) == c" (which is correct), or as "a = (b == c)" (which is not).

Surely there is some mistake here: == binds more tightly than = does.
You wouldn't expect "a = b + c" to be parsed as "(a=b) + c" would you?
The bracketing "a = (b == c)" is correct according to an old ANSI draft
I checked, and according to cparen [never leave for work without it].

The Sequent C compiler complained about an illegal pointer/integer
combinition in line 23 (counting the first #include as line 1) which
is the for(..) loop.



More information about the Comp.lang.c mailing list