// Filename: test.c
#include <sys/types.h>
int main() {
uint a;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
上面的代码能够使用gcc和clang编译,标准如gnu89或gnu99.换句话说,以下工作.
$gcc test.c # for the default is std=gnu89
$clang test.c # for the default is std=gnu99
Run Code Online (Sandbox Code Playgroud)
但是,以下错误导致错误"未声明的uint".
$gcc -std=c99 test.c
$clang -std=c99 test.c
Run Code Online (Sandbox Code Playgroud)
有人可以解释为什么uint的定义在c99标准中消失了吗?