Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site drivax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!amdahl!drivax!alan From: alan@drivax.UUCP (Alan Fargusson) Newsgroups: net.lang.c Subject: Re: how has C bitten you? (Really, style) Message-ID: <214@drivax.UUCP> Date: Thu, 22-Aug-85 12:15:05 EDT Article-I.D.: drivax.214 Posted: Thu Aug 22 12:15:05 1985 Date-Received: Sun, 25-Aug-85 01:40:38 EDT References: <302@brl-tgr.ARPA> <4081@alice.UUCP> <243@ecrhub.UUCP> <123@ecsvax.UUCP> <389@phri.UUCP> <372@ttrdc.UUCP> Distribution: net Organization: Digital Research, Monterey, CA Lines: 22 > Here's one that just got me: > > if (sv > score); <----- note extraneous semi-colon > score = sv; > > This was in a series of computations which gave various scores; the >fragment above was repeated in various places to pick out the maximum. Of >course, the test is a no-op and the assignment was always done. Naturally, >this passes lint (even with the -h flag which uses "heuristic tests to >attempt to intuit bugs") without any complaint. >-- >Roy SmithI have to tell you that I got bit the same way in PASCAL when I was a student. This is not just a C problem. I think that all of the strucutred languages I have seen (except Modula-2, and Algol 68) have this problem. -- Alan Fargusson. { ihnp4, amdahl, mot }!drivax!alan