Why does C99 complain about storage sizes?
问题 This is some code I'm compiling on Linux: #include <net/if.h> int main() { struct ifreq ifr; } gcc test.c is fine. gcc -std=gnu99 test.c is fine. gcc -std=c99 test.c fails with the following error: test.c: In function ‘main’: test.c:4:16: error: storage size of ‘ifr’ isn’t known What's different about C99 that it doesn't like the definition of struct ifreq in Linux? 回答1: It's a chain of consequences of preprocessing and GNU C vs C99. First up, net/if.h : net/if.h includes features.h Later on,