possible operator precedence bug?
Doug Gwyn
gwyn at smoke.ARPA
Thu Oct 13 18:45:22 AEST 1988
In article <4700025 at m.cs.uiuc.edu> kenny at m.cs.uiuc.edu writes:
- a ? b , c : d
-has no such problem. There is no lexical confusion, particularly when
-the spaces that I show are supplied. There is no ambiguity in the
-parse; the only syntactically correct interpretation is
- a ? (b , c) : d .
-Then, as long as c and d are type-compatible, and a can be coerced to
-an integral type, the expression has a meaningful interpretation
-semantically. (The ice is thin if b and c are type-incompatible --
-does anyone know if the latest dpANS is clearer on this point?)
I don't see the issue. b,c does not require type compatibility
for b and c. That comma-expression has the type of c. Type
compatibility constraints apply after the parse is already done.
More information about the Comp.lang.c
mailing list