Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: LINT won't do your debugging for you Message-ID: <10475@smoke.BRL.MIL> Date: 30 Jun 89 21:28:07 GMT References: <713@srhqla.SR.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 16 In article <713@srhqla.SR.COM> tcm@srhqla.UUCP (Tim Meighan) writes: !1. There is rarely, if ever, a case when it would be reasonable for a ! program to contain an if() statement that, when evaluated as true, ! does absolutely nothing. How about macro expansions or code generated by another program? A similar case (null "false" branch) is often seen: #define swap(a,b,type) if(1){type t=(a);(a)=(b);(b)=t;}else !2. Even assuming a use for such code, LINT should still call attention to all ! cases of null instruction blocks on GP, since they probably represent a ! mistake rather than intentional coding. It should probably be an option, so one could disable the reams of warnings that extensive deliberate use of such code could generate.