Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!newstop!sun!limes From: limes@sun.com (Greg Limes) Newsgroups: comp.lang.c Subject: Re: lint [but not really printf] Message-ID: Date: 12 Jul 89 22:31:10 GMT References: <328@tree.UUCP> <417@siswat.UUCP> <105@borabora.omni.com> Sender: news@sun.Eng.Sun.COM Followup-To: comp.lang.c Organization: Sun Microsystems, Inc. Lines: 24 In-reply-to: bob@omni.com's message of 26 Jun 89 17:24:39 GMT In article <105@borabora.omni.com> bob@omni.com (Bob Weissman) writes: Last week I spent an entire day tracking down one of those bugs you just don't see after staring at your code too long. It was of the form: if (condition); action; You mean this never bit you before? Put it in your list of common things to look for when the bugs get weird, along with confusing the assignment and equality test operations. watch even for the combinations; I kid you not, I once saw this: if (fp = (struct file *)0); perror("opening file"); Yes, C is sometimes difficult to debug. Oh, you want an easy way to find those extra semicolons, and mismatched comment delimiters? Run the code through "indent", or something like it. If the indentation does not match what you think the code should be doing, look again carefully ... -- Greg Limes limes@sun.com ...!sun!limes 73327,2473 [chose one]