【发布时间】:2013-12-01 05:00:18
【问题描述】:
我正在使用以下 C 代码:
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
int main()
{
int file=0;
if((file=open("testfile.txt",O_RDONLY)) < -1)
return 1;
char buffer[19];
if(read(file,buffer,19) != 19) return 1;
printf("%s\n",buffer);
if(lseek(file,10,SEEK_SET) < 0) return 1;
if(read(file,buffer,19) != 19) return 1;
printf("%s\n",buffer);
return 0;
}
编译后会产生警告:
warning: incompatible implicit declaration of built-in
function ‘printf’ [enabled by default]
这是什么意思,如何让 C 编译器不要发出警告?
【问题讨论】:
-
#include <stdio.h>
标签: c system-calls