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

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

问题描述

我已经看到了编译器选项GNU99和C99。什么是他们的区别呢?任何一个细节的文件? (铛,X code,Mac OS X中)


各种标准模式 解决方案

差异H2>

  

铛支持-std选项,从而改变模式铛使用什么样的语言。对于C支持的模式有C89,gnu89,C94,C99,gnu99和各种别名这些模式。如果没有指定-std选项,铛默认为gnu99模式。


  
  

所有的C *和GNU *模式之间的差异
  
  


      
  • C *模式定义 __ __ STRICT_ANSI

  •   
  • 目标特定的定义不是用下划线pfixed $ P $,如LINUX,在GNU定义*模式。

  •   
  • 三字母默认为在GNU *模式被关闭;他们可以通过 -trigraphs 选项来启用。

  •   
  • 解析器承认汇编和typeof运算,如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(锵)有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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