【发布时间】:2012-05-13 02:55:16
【问题描述】:
这是我在 Linux 上编译的一些代码:
#include <net/if.h>
int main() {
struct ifreq ifr;
}
gcc test.c 很好。
gcc -std=gnu99 test.c 很好。
gcc -std=c99 test.c 失败并出现以下错误:
test.c: In function ‘main’:
test.c:4:16: error: storage size of ‘ifr’ isn’t known
C99 不喜欢 Linux 中struct ifreq 的定义有什么不同?
【问题讨论】:
标签: linux gcc network-programming c99 gnu99