c - 为什么 <sys/types.h> 中的 uint 使用 -std=c99 消失了?

标签 c standards c99

// Filename: test.c
#include <sys/types.h>
int main() {
    uint a;
    return 0;
}

上面的代码可以使用 gcc 和 clang 以及 gnu89 或 gnu99 等标准进行编译。换句话说,以下工作。

$gcc test.c # for the default is std=gnu89
$clang test.c # for the default is std=gnu99

但是,以下操作失败并出现错误“undeclared uint”。

$gcc -std=c99 test.c
$clang -std=c99 test.c

有人可以解释为什么 uint 的定义在 c99 标准中消失了吗?

最佳答案

因为 C 标准没有定义/要求 uint 类型。它很可能是特定于编译器、系统或库的便利类型。不要使用它。

关于c - 为什么 <sys/types.h> 中的 uint 使用 -std=c99 消失了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15466342/

相关文章:

比较输入的 ASCII 值(C 程序)

c - 关于STDIN、STDOUT、STDERR及返回值

c++ - 如何检测 Windows 更新状态

standards - 电话号码有标准吗?

c - 独立于平台获取文件大小 (C)

c - C语言中如何使用函数指针?

posix - Shebang (#!) 是否标准化?

c - 给定一个基于另一个的限制指针,它们应该永远不要别名吗?

c - 在 C 中取消引用

c - 有效地将无符号转换为有符号