Visual Studio 2010 Professional 中的 /analyze 标志
运行 Visual Studio 2008 Professional 可以使用 /analyze 标志启用静态代码分析(尽管根据 文档)。
在 Visual Studio 2010 Professional 中,这不再起作用。相反,添加了一个默认的 /analyze- 标志(我找不到该标志的 GUI 设置)。这不像 VS2008 版本那么有效(或者根本没有)。
任何人都可以阐明这一点吗?新的 /analyze- 标志有什么作用?有什么方法可以启用旧的分析?
Running Visual Studio 2008 Professional it is possible to enable static code analysis using the /analyze flag (even though this is not supported for the Professional version according to the documentation).
In Visual Studio 2010 Professional this no longer works. Instead there is a default /analyze- flag added (one I can't find a GUI setting for). This does not work as well as the VS2008 version (or at all).
Can anyone shed some light into this? What does the new /analyze- flag do and is there any way to enable the old analysis?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
2010年的编译器是非企业版的。 VS 2008 碰巧附带了企业编译器。 (比较
cl /?
的输出)/analyze-
关闭静态分析。您可以做的是查看最新的 Platform SDK 是否附带企业编译器(过去是这样),并在 VS 中配置您的路径以使用它们。The compiler in 2010 is the non-enterprise one. VS 2008 happened to ship with the enterprise compiler. (Compare the output of
cl /?
)/analyze-
turns off static analysis. What you could do is see if the latest Platform SDK ships with the enterprise compilers (they did in the past), and configure your paths in VS to use them instead.仍然可以通过使用 SDK 并安装最新的编译器更新来完成,请参阅:
http://randomascii.wordpress.com/2011/10/15/try-analyze-for-free/
请注意,如果您使用的是 x64 系统,则需要手动设置将您的环境设置为 x86 模式(默认为 x64)以使 /analyze 正常工作。
It can still be done by using the SDK and installing the latest compiler update, see:
http://randomascii.wordpress.com/2011/10/15/try-analyze-for-free/
Note that if you're using an x64 system, you'll need to manually set your environment to x86 mode (as x64 is the default) to get /analyze to work.
升级到 VS 2012 或 VS 2013。它们支持专业 SKU 中的 /analyze,并且支持 32 位和 64 位的 /analyze。有关详细信息,请参阅我的 /analyze 博客文章:
http://randomascii .wordpress.com/2011/10/15/try-analyze-for-free/
Upgrade to VS 2012 or VS 2013. They support /analyze in the professional SKU and it supports /analyze for both 32-bit and 64-bit. See my /analyze blog post for details:
http://randomascii.wordpress.com/2011/10/15/try-analyze-for-free/