Martin
Martin

Reputation: 900

/analyze flag in Visual Studio 2010 Professional

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?

Upvotes: 2

Views: 851

Answers (3)

Bruce Dawson
Bruce Dawson

Reputation: 3482

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/

Upvotes: 0

Garen
Garen

Reputation: 961

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.

Upvotes: 1

Alex Budovski
Alex Budovski

Reputation: 18446

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.

Upvotes: 1

Related Questions