I want to add a warning message during the compilation to warn the user it should use gnu99 instead of c99 (I am using anonymous struct, and it seems it doesn't exist at all in c99).
I found that:
#if __STDC_VERSION__ >= 199901L
but this test is true for c99 and gnu99.
Which predefined macro could I use?
You can check for yourself:
$ gcc -std=c99 -dM -E - < /dev/null > c99.txt
$ gcc -std=gnu99 -dM -E - < /dev/null > gnu99.txt
$ sdiff -s c99.txt gnu99.txt
#define __STRICT_ANSI__ 1 <
来源:https://stackoverflow.com/questions/8656175/how-to-check-that-c99-is-used-and-not-gnu99