GNU99 和 C99 (Clang) 有什么区别? [英] What's the difference between GNU99 and C99 (Clang)?

查看:38
本文介绍了GNU99 和 C99 (Clang) 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了编译器选项 GNU99 和 C99.他们有什么区别?有详细的文档吗?(Clang、Xcode、Mac OS X)

解决方案

各种标准模式的区别

<块引用>

clang 支持 -std 选项,它改变了 clang 使用的语言模式.C 支持的模式是 c89、gnu89、c94、c99、gnu99 和这些模式的各种别名.如果没有指定 -std 选项,clang 默认为 gnu99 模式.

所有 c* 和 gnu* 模式的区别:

  • c* 模式定义 __STRICT_ANSI__.
  • 没有下划线前缀的目标特定定义,例如linux",在 gnu* 模式下定义.
  • 在 gnu* 模式下,Trigraphs 默认关闭;它们可以通过 -trigraphs 选项启用.
  • 解析器识别asm";和类型"作为 gnu* 模式中的关键字;__asm____typeof__ 变体可在所有模式下识别.
  • 苹果的障碍"在某些平台上的 gnu* 模式下默认识别扩展名;可以使用 -fblocks 选项在任何模式下启用它.

更多链接

I have saw the compiler option GNU99 and C99. What's the difference of them? Any detail documentation? (Clang, Xcode, Mac OS X)

解决方案

Differences between various standard modes

clang supports the -std option, which changes what language mode clang uses. The supported modes for C are c89, gnu89, c94, c99, gnu99 and various aliases for those modes. If no -std option is specified, clang defaults to gnu99 mode.

Differences between all c* and gnu* modes:

  • c* modes define __STRICT_ANSI__.
  • Target-specific defines not prefixed by underscores, like "linux", are defined in gnu* modes.
  • Trigraphs default to being off in gnu* modes; they can be enabled by the -trigraphs option.
  • The parser recognizes "asm" and "typeof" as keywords in gnu* modes; the variants __asm__ and __typeof__ are recognized in all modes.
  • The Apple "blocks" extension is recognized by default in gnu* modes on some platforms; it can be enabled in any mode with the -fblocks option.

More links

这篇关于GNU99 和 C99 (Clang) 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆