• 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"??

  • 相关阅读:
    时装画基础知识--如何画人体
    马士兵java视频学习顺序
    Mysql 中文字符乱码问题
    zendstudio 设置默认编码 utf-8 gbk
    MYSQL 本地无ROOT权限 忘记密码
    windows 3389 远程
    windows 老掉牙CMD的命令
    mysql-常用注入渗透手法
    ubuntu 添加多个IP
    windows下简单配置apache
  • 原文地址:https://www.cnblogs.com/emituofo/p/2600741.html
Copyright © 2020-2023  润新知