lint: shouldn't it catch this?

Rich Birnbaum birnbaum at paul.rutgers.edu
Thu Jan 3 04:52:09 AEST 1991


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!

This is a VERY pared down version of a bigger program.
I tried this on a Sun, a Gould, and a Pyramid.

Maybe lint isn't as smart as I thought...
Please email responses to birnbaum at pica.army.mil.



More information about the Comp.unix.questions mailing list