有任何 C 编译器实现 C1X 功能吗?

发布于 2024-12-02 05:18:26 字数 64 浏览 5 评论 0原文

有任何 C 编译器实现 C1X 功能吗?

PS:有没有办法在当前的 C 编译器中模拟其中一些功能

Do any c compilers implement any of the C1X features?

P.S.:Is there a way to emulate some of these features in current c compilers

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

李白 2024-12-09 05:18:26

GCC 4.6 对 C1X 功能有一些实验性支持:

现在对即将推出的 ISO C 标准 C1X 修订版中的某些功能提供实验性支持。可以使用 -std=c1x 或 -std=gnu1x(对于带有 GNU 扩展的 C1X)来选择此支持。请注意,此支持是实验性的,为了与 C1X 标准草案的更改保持一致,在未来版本中可能会发生不兼容的更改。如 C1X 的 N1539 草案中所述,新支持以下功能(更改已在 2011 年 3 月的 WG14 会议上达成一致);一些其他功能已经得到支持,无需更改编译器,或者有一些支持,但不完全符合 N1539(经修订)。

  • 静态断言(_Static_assert 关键字)
  • Typedef 重新定义
  • 中的新宏
  • 匿名结构和联合

GCC 4.6 has some experimental support for C1X features:

There is now experimental support for some features from the upcoming C1X revision of the ISO C standard. This support may be selected with -std=c1x, or -std=gnu1x for C1X with GNU extensions. Note that this support is experimental and may change incompatibly in future releases for consistency with changes to the C1X standard draft. The following features are newly supported as described in the N1539 draft of C1X (with changes agreed at the March 2011 WG14 meeting); some other features were already supported with no compiler changes being needed, or have some support but not in full accord with N1539 (as amended).

  • Static assertions (_Static_assert keyword)
  • Typedef redefinition
  • New macros in <float.h>
  • Anonymous structures and unions
冷默言语 2024-12-09 05:18:26

除了 gcc 之外,clang 也开始添加对 C1x 功能的支持。特别是,支持 _Generic_Static_assert。其他一些功能也可能会实现,但我还没有尝试过。

Besides gcc, clang has started to add support for C1x features. In particular, there is support for _Generic and _Static_assert. Some other features may be implemented as well, but I haven't tried them.

何以心动 2024-12-09 05:18:26

基于对列表和 gcc 测试套件的仔细阅读(ls gcc/gcc/testsuite/gcc.dg/c1x*):

Based on perusal of the lists and the gcc testsuite (ls gcc/gcc/testsuite/gcc.dg/c1x*):

  • I looks like _Noreturn is coming in gcc-4.7.
  • From the testsuite it looks like unicode strings will be too.
  • It also looks like CMPLX macros are being worked on too.
  • Maybe _Generic is coming in gcc-4.8.
街角卖回忆 2024-12-09 05:18:26

您可能需要查看 Pelles C(仅适用于 Windows)。

You may want to check Pelles C out (Only availble for Windows).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文