C question

Stew Rubenstein stew at harvard.ARPA
Wed Apr 10 17:21:10 AEST 1985


Regarding the question about x = x++ and a[i] = i++ and similarly
ambiguous constructs:  Why the (*@#$%^*^ can't the compiler complain
rather than flipping a coin?  Programs with statements like these are
WRONG, just as wrong as one with a missing brace.  And while I am
making suggestions to the compiler-writers out there, I'd like to
endorse the action of the compiler which warned the programmer of
a possibly unintended assignment in the statement "if (i = 0) ..."
I have spent too much time fixing bugs caused by this.  I have even
written "i == j;", also a legal statement, but one which I would
love to have had the compiler complain about.
-- 
-----------------------
Stew Rubenstein     UUCP: ihnp4!harvard!stew
Harvard Chemistry   ARPA: stew at harvard



More information about the Comp.lang.c mailing list