c - ctime and time warnings compiling on OSX -
i getting warnings when compiling c program on osx 10.6.5, seem quite critical.
extras.c:15: warning: implicit declaration of function ‘time’ extras.c: in function ‘outlog’: extras.c:363: warning: implicit declaration of function ‘ctime’ the corresponding lines follows:
lines 13-15:
randnumgen = gsl_rng_alloc(gsl_rng_taus); long t1; (void) time(&t1); lines 360-363:
if (log==null) { log=stdout;} tval = time(null); char* timestring = ctime(&tval); i believe program written linux, wonder if there difference between time , ctime on 2 platforms?
verify c files contains:
#include <time.h> somewhere around top.
also,
long t1; time(t1); is pretty lousy code, argument time() has type time_t*, should read
time_t t1; time(&t1);
Comments
Post a Comment