gcc支持c99验证

gcc3.0以上的版本都是支持C99标准的, 但是编译程序的时候需要加上
   -std=c9 
才可以:
一下程序是验证gcc是否支持c99标准的:
#include <stdio.h>

int main(void)
{
#ifdef __STDC__
     printf("%s
", "stardard C");
#endif
#ifdef __STDC_VERSION__
     printf("%ld
", __STDC_VERSION__);
#endif
     return 0;
}

gcc -std=c99 -o c99_test c99_test.c

./c99_test

输出结果如下:

stardard C
199901

原文地址:https://www.cnblogs.com/codeblock/p/5197220.html