LINT won't do your debugging for you
Doug Gwyn
gwyn at smoke.BRL.MIL
Sat Jul 1 07:28:07 AEST 1989
In article <713 at srhqla.SR.COM> tcm at 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.
More information about the Comp.lang.c
mailing list