gpt4 book ai didi

c - stdint.h 和 C99

转载 作者:太空宇宙 更新时间:2023-11-04 00:35:49 29 4
gpt4 key购买 nike

我在 C99 standard 中读到stdint.h 是 C 标准库的一部分。

我没看错吗,如果我测试 C99 合规性,使用:

defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)

这意味着 stdint.h 应该可用?

恰当的例子:我可以考虑假装符合 C99 但不提供 stdint.h 的环境与其自身的合规性声明不一致,因此 buggy ?

编辑:对于那些好奇的人,有问题的系统是带有 HP C 编译器的 OpenVMS(不是 gcc,它在 openVMS 上确实提供了 stdint.h)。因此,根据目前收到的答复和评论,我必须将此实现(假装是 C99)视为错误。更多详情:https://groups.google.com/forum/#!topic/comp.os.vms/Bnh3tIOc7bo%5B101-125%5D

最佳答案

是的。

顺便说一句, undefined symbol 扩展为 0在预处理器表达式中,所以你可以这样写:

#if __STDC_VERSION__ >= 199901L

另一方面,声称符合 C99(或 C11)的实现可能仍支持 <stdint.h>作为扩展。

关于c - stdint.h 和 C99,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37107259/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com