zoukankan      html  css  js  c++  java
  • VC++对C标准的支持


    写在前面:VC++的C编译器,只支持C89,不支持C99和C11。而且微软也不打算在未来的VC++版本中支持C99和C11,他们把更多的精力放在C++上。


    以下内容摘自wiki:Visual C++

    Microsoft Visual C++ (often abbreviated as MSVC or VC++) is a commercial (free version available), integrated development environment (IDE) product from Microsoft for the C, C++, and C++/CLI programming languages.

    VC++是一个支持 C, C++, 和 C++/CLI的IDE(集成开发环境)。
    Although the product originated as an IDE for the C programming language, the compiler's support for that language conforms only to the outdated original edition of the C standard, dating from 1989. The later revisions of the standard, C99 and C11, are still not supported at all.[more] According to Herb Sutter, the C compiler is only included for "historical reasons" and is not planned to be further developed.

    VC++,尽管开始作为C语言的IDE,但是至今只支持标准C(C89),不支持C99和C11,而且微软也不打算在未来支持。

    Users are advised to either use only the subset of the C language that is also valid C++, and then use the C++ compiler to compile their code, or to just use a different compiler such as Intel C++ Compiler or the GNU Compiler Collection instead.

    如果你想要尝试一下C99和C11,建议你使用GCC或者ICC等其他编译器。


    最后来做个实验吧

    标准C规定变量声明必须放在语句块的开头。而C99和C++则没有这条限制。

    ps:

    1.我用的是VC++ 2010, /TP选项指定VC++使用C++编译器编译文件

    2.其实标准C也是不支持// 开头的单行注释(你可以在gcc实验这点,"gcc -Wall -ansi -pedantic test.c")。不过VC++的C编译器好像支持。


    结束语:VC++的Language Standards Supported by GCC VC++?? 弄得我有一点始终不明白。。。VC++的C编译器到底是像wiki说的只用了C90,还是像某些网站所说的"C90 with a few features for C99"??

  • 相关阅读:
    提升Android编译速度
    NYOJ 158 省赛来了
    浅谈 ZipArchive 类
    块状元素的text-align对齐属性
    BestCoder Round #2 1001 TIANKENG’s restaurant
    Saltstack运行cmd.run重新启动tomcat后出现日志乱码(15)
    【HRS项目】Axure兴许问题解决---与SVN结合
    软件质量之道:PCLint之中的一个
    字典树 一种高速插入查询数据结构
    【JS】JavaScript引擎的内部执行机制
  • 原文地址:https://www.cnblogs.com/emituofo/p/2600741.html
Copyright © 2011-2022 走看看