Why does lint complain?

John E. Davis davis at pacific.mps.ohio-state.edu
Mon Feb 18 08:52:36 AEST 1991


Hi,

Here is a sample program:

#include <stdio.h>
#include <time.h>


void getime()
{
    time_t  cur_time;

    (void) time(&cur_time);
    (void) printf("\nThis is running on %s\n", ctime(&cur_time));

}


int main()
{
    getime();
    exit(0);
    return(0);
}
   
Now here is the lint output:

[pacific]>lint test.c
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)
[pacific]>


So, why is lint complaining and how seriously should I take these complaints?

Thanks,
--
John

  bitnet: davis at ohstpy
internet: davis at pacific.mps.ohio-state.edu



More information about the Comp.lang.c mailing list