Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!dartvax!eleazar.dartmouth.edu!ari From: ari@eleazar.dartmouth.edu (Ari Halberstadt) Newsgroups: comp.lang.c Subject: Re: lint [but not really printf] Summary: Common bug: see a good book Keywords: semicolon, bugs, pitfalls Message-ID: <14443@dartvax.Dartmouth.EDU> Date: 16 Jul 89 18:09:39 GMT References: <328@tree.UUCP> <417@siswat.UUCP> <105@borabora.omni.com> Sender: news@dartvax.Dartmouth.EDU Reply-To: ari@eleazar.dartmouth.edu (Ari Halberstadt) Organization: Dartmouth College, Hanover, NH Lines: 28 This is my first submission to this group. I hope I reply correctly. For the past week or so, there's been this discussion about null statements inserted by mistake after an if. It was suggested that lint be modified to catch these errors. I would support this, but only as an extra option to lint, not a default action, since I frequently use while and for loops with null statements. For myself, I rarely run into this bug. I simply type carefully, and realize that such bugs usually creep in at 2AM. An execellent book on the topic of bugs and pitfalls is: -- Andrew Koenig, "C Traps and Pit Falls", Addison-Wesley, Reading, Massachusetts (1989). About the suggestion to type: if (expr) { stmt; } I really DON'T like seeing this kind of use of parenthesis in code. But if it works for some people, let them use it. -- Ari Halberstadt Ari Halberstadt: ari@dartmouth.edu