What does the compiler think I am do

darryl at ISM780.UUCP darryl at ISM780.UUCP
Fri Aug 30 22:43:00 AEST 1985




There is no such thing as an "assignment statement" in C.  Rather, assignment
is just one more binary operator, and the language supports the "expression
statement".  What you have written, c - a;, is just another expression
statement, that merely has no side effects.  According to the Unix philosophy,
this is perfectly ok, and (if you have a PCC compiler) it probably generates
the code to load up the values and do the subtract (why? beacause you asked
it to).  Hence lint.  Lint will also warn you about using = in conditionals
where you might have meant ==.

	    --Darryl Richman, INTERACTIVE Systems Corp.
	    ...!cca!ima!ism780!darryl
	    The views expressed above are my opinions only.



More information about the Comp.lang.c mailing list