Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!uvaarpa!mcnc!rti!trt From: trt@rti.UUCP (Thomas Truscott) Newsgroups: comp.lang.c Subject: Re: Is this a bug, or is it just me? Message-ID: <1923@rti.UUCP> Date: 16 Dec 87 23:38:56 GMT References: <464@ecrcvax.UUCP> Organization: Research Triangle Institute, RTP, NC Lines: 16 Summary: Steve Johnson's second biggest mistake In article <464@ecrcvax.UUCP>, johng@ecrcvax.UUCP (John Gregor) writes: > sum = a[i++] + a[i++] + a[i++]; Gems like this are posted to Usenet every month or so (it seems), and the usual response is "Poor grasshopper, read K&R page 50 and stop bothering us". I wish the responses would include something like "Why don't C compilers flag blatant errors such as the above?" If we all said bad things about compilers that permitted such code I bet the vendors would fix them! Maybe even AT&T. And come to think of it, why doesn't someone fix the 4.3BSD compiler to do this? After all 4.3BSD "lint" finds it. Just steal the code from lint! (And catch "i = i++;" too.) Tom Truscott