lint: shouldn't it catch this?
Dolf Grunbauer
dolf at idca.tds.PHILIPS.nl
Thu Jan 3 21:13:02 AEST 1991
In article <1131 at van-bc.wimsey.bc.ca> jtc at van-bc.wimsey.bc.ca (J.T. Conklin) writes:
>In article <Jan.2.12.52.08.1991.467 at paul.rutgers.edu> birnbaum at paul.rutgers.edu (Rich Birnbaum) writes:
>>Running lint on this program produces no errors:
>>
>>main()
>>{
>> int i;
>> if (0)
>> i=0;
>> printf ("%d",i);
>>}
>>
>>Shouldn't it complain that 'i' may be used before set? I could have sworn it
>>did at some point in my life!
>
>It should, it doesn't, and ou've probably seen the 'i' may be used
>before set mesage before. Rather than doing data flow analysis, lint
>raises this warning only if the first use of a variable is access
>rather than assignment.
>
>[DELETED]
Shouldn't it also give a warning/error message like: "statement not reached" ?
--
_ _
/ U | Dolf Grunbauer Tel: +31 55 433233 Internet dolf at idca.tds.philips.nl
/__'< Philips Information Systems UUCP ...!mcsun!philapd!dolf
88 |_\ If you are granted one wish do you know what to wish for right now ?
More information about the Comp.unix.questions
mailing list