在OSX上编译的ctime和time警告

在OSX 10.6.5上编译C程序时,我收到了一些警告,这似乎非常关键。
extras.c:15: warning: implicit declaration of function ‘time’
extras.c: In function ‘outlog’:
extras.c:363: warning: implicit declaration of function ‘ctime’
相应的行如下: 第13-15行:
RANDNUMGEN = gsl_rng_alloc(gsl_rng_taus);
long t1;
(void) time(&t1);
第360-363行:
if (LOG==NULL) { LOG=stdout;}

TVAL = time(NULL);
char* TIMESTRING = ctime(&TVAL);
我相信这个程序最初是为Linux编写的,所以我想知道两个平台上
time
ctime
之间是否存在差异?     
已邀请:
验证C文件是否包含:
#include <time.h>
在顶部的某个地方。 也,
long t1;
time(t1);
是非常糟糕的代码,
time()
的参数类型为
time_t*
,所以应该阅读
time_t t1;
time(&t1);
    

要回复问题请先登录注册