interesting program

Thomas Truscott trt at rti.UUCP
Mon Feb 1 12:37:04 AEST 1988


> ... What does the following program print?
> ...
>	k = k++;

Gems like this are posted to Usenet every month or so (it seems),
to which a typical response might be:

> The only flame this deserves is `RTFM'.
[note: page 50 of the K+R C book.]

I wish the responses would instead be something like
"It is a crime that your compiler misses blatant errors such as that."
If we all said bad things about compilers that passed such code
I bet the vendors would fix them!  Maybe even AT&T.

To those who feel that such checking belongs in lint and not in cc, I ask:
Don't current C compilers already have dozens of different warning
messages, such as "unsigned >= always true"?
Is it wrong to add another which will save man-years of debugging
(not to mention man-years of time spent reading comp.unix.c)?
	Tom Truscott



More information about the Comp.lang.c mailing list