如何开发使用Visual Studio 2010 C 3 [英] How to develop C with Visual Studio 2010?
问题描述
有一个发展与Visual Studio 2010中的纯ANSI C的方式?
Is there a way to develop pure ANSI C with Visual Studio 2010?
推荐答案
是的,这是可能的。 MSDN这里提供了一些信息:符合ANSI C
Yes, it's possible. MSDN provides some information here: ANSI C Compliance.
第一步是设置编译器生成C code,而不是C ++ code。做到这一点从项目的属性。展开C / C ++头,然后单击高级。设置编译为属性编译为C code(这是与指定的 / TC
切换在命令行)。更容易是只使用 *。ç
扩展名的文件。
Step one is setting the compiler to produce C code, rather than C++ code. Do that from your project's Properties. Expand the C/C++ header, and click on "Advanced". Set the "Compile As" property to "Compile as C Code" (this is the same as specifying the /TC
switch on the command line). Even easier is to just name your files with a *.c
extension.
第二步是禁用微软扩展ANSI标准。这些是由 / ZA
和<$ C管辖$ C> /泽编译器开关。您可以找到这些在项目的属性,以及。 / ZA
导致编译器发出错误的语言结构不符合ANSI标准。在 /泽
开关使Microsoft特定的扩展;要确保这个人是原来的关闭的
Step two is disabling Microsoft's extensions to the ANSI standards. These are governed by the /Za
and /Ze
compiler switches. You can find these in your project's Properties, as well. /Za
causes the compiler to emit an error for language constructs that are not compliant with the ANSI standard. The /Ze
switch enables Microsoft-specific extensions; you want to make sure that this one is turned off.
虽然我不认为微软的完全的支持C99标准。见(投票支持!)在MS连接这个bug报告,的this博客条目和的为那里是缺乏支持变得明显一个具体的例子此页。它,然而,有对C90标准的全面支持。
Although I don't believe that Microsoft fully supports the C99 standard. See (and vote for!) this bug report on MS Connect, this blog entry from the VC++ team, and this page for a concrete example of where that lack of support becomes evident. It does, however, have full support for the C90 standard.
这篇关于如何开发使用Visual Studio 2010 C 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!