Why does lint complain?

Doug Gwyn gwyn at smoke.brl.mil
Tue Feb 19 12:33:21 AEST 1991


In article <DAVIS.91Feb17165236 at pacific.mps.ohio-state.edu> davis at pacific.mps.ohio-state.edu  (John E. Davis) writes:
>test.c(9): warning: c may be used before set
>test.c(9): warning: cur_time may be used before set
>time value declared inconsistently	llib-lc(729)  ::  test.c(10)
>exit value declared inconsistently	llib-lc(232)  ::  test.c(19)

It appears to me that the first three warnings are a side effect of
your assumption that <time.h> declares time() and defines time_t
when in actuality it doesn't appear to do so.

The warning about exit() is because you have default-declared it as
returning type int, which is wrong.  If you have <stdlib.h> you could
use that to declare exit() properly, or you could do it "by hand".



More information about the Comp.lang.c mailing list