Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何处理;警告:内联函数“*stat64”已声明但从未定义;在支持gnu99的gcc中_C_Linux_Gcc_Stat_Gnu99 - Fatal编程技术网

如何处理;警告:内联函数“*stat64”已声明但从未定义;在支持gnu99的gcc中

如何处理;警告:内联函数“*stat64”已声明但从未定义;在支持gnu99的gcc中,c,linux,gcc,stat,gnu99,C,Linux,Gcc,Stat,Gnu99,我在我的foo.c中包括stat.h,如下所示: #include <sys/stat.h> gcc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE=1 -DUSE_ZLIB -DUSE_BZLIB -O0 -g -Wformat -Wall -Wswitch-enum -Wextra -std=gnu99 -DDEBUG=1 -c foo.c -o objects/foo.o -I... gcc -D_FILE_OFFSET_BITS=

我在我的
foo.c
中包括
stat.h
,如下所示:

#include <sys/stat.h> 
gcc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE=1 -DUSE_ZLIB -DUSE_BZLIB -O0 -g -Wformat -Wall -Wswitch-enum -Wextra -std=gnu99 -DDEBUG=1 -c foo.c -o objects/foo.o -I...
gcc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE=1 -DUSE_ZLIB -DUSE_BZLIB -O0 -g -Wformat -Wall -Wswitch-enum -Wextra -std=gnu99 -DDEBUG=1 objects/foo.o -o ../bin/debug.foo ../lib/libfoo.a ... -lbz2 -lz
我收到以下警告,这些警告特定于
功能:

In file included from foo.c:15:0:
/usr/local/gcc-4.7.2/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/include-fixed/sys/stat.h:317:16: warning: inline function `lstat64` declared but never defined [enabled by default]
/usr/local/gcc-4.7.2/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/include-fixed/sys/stat.h:255:16: warning: inline function `fstat64` declared but never defined [enabled by default]
...

如何修复这些警告中引用的问题?在我使用
-std=gnu99
迁移到C99支持之前,这似乎不是一个问题,但我不知道为什么。感谢您的建议。

添加标志可以通过启用“C99模式下内联函数的传统GNU语义”来修复警告。

问题中的代码确实使用
lstat()
?它使用
stat()
。相关的代码行是
struct stat buf;int i=状态(fn和buf)