加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

为什么uint会使用-std = c99消失?

发布时间:2020-12-14 03:58:55 所属栏目:Windows 来源:网络整理
导读:// Filename: test.c#include sys/types.hint 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 但是,以下
// 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

但是,以下错误导致错误“未声明的uint”.

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

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

解决方法

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读