これは私がLinux上でコンパイルしていますいくつかのコードです:なぜC99はストレージサイズについて不平を言っていますか?
#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
は、それは、Linuxでstruct ifreq
の定義は好きではないことをC99についての異なる何ですか?
私の質問はこれと重複していると思います。 http://stackoverflow.com/questions/3875197/std-c99-wtf-on-linux –