PCC Compiler Question

utzoo!decvax!harpo!eagle!allegra!jdd utzoo!decvax!harpo!eagle!allegra!jdd
Wed Mar 23 15:46:50 AEST 1983


The behavior in PCC on:

	a && b *= c

is (possibly) serendipitous but ultimately indicative of a compiler bug.
Parsing it as:

	a && (b *= c)

does not reflect the correct operator precendences.

If you believe that PCC is magically "doing the right thing", tell me why it
won't compile:

	int *a, b, c;

	...

	... a+b[c] ...

since interpreting the expression as:

	... (a+b)[c] ...

would "make sense".  No compilers (i.e., no languages) I know of overload
the syntax in this way; a little thought suggests that doing so could cause
as much harm as good; most of my coding errors have some "interpretation",
but probably not the one I intended.

Cheers,
John ("Let's All Program In Lisp Instead") DeTreville
Bell Labs, Murray Hill



More information about the Comp.lang.c mailing list