PreFast in VS 2010? - c++

Which version of VS 2010 has PreFast static code analyzer for native c++? I have downloaded VS 2010 Ultimate edition trial version in hope that it would contain all the features, but could not found inbuilt PreFast in it.
I tried to link VS 2010 to set it directories with WDK's PreFast and add "/analyze" in comand Line additional options but unable to get results.

it's in ultimate (I just tested it), but I don't think it's in pro.
help page http://msdn.microsoft.com/en-us/library/bb385907.aspx

I was looking for some memory leakage, thread dead locks kind of rules.
Prefast is static analysis tool. It checks for possible NULL derefferensing, buffer overruns and such. You are looking for dynamic analysis tool like Bounds Checker. Not sure, that it is available for VS 2010. Another option would be to use Application Verifyer.

Related

intellisense of vs2017 is slow with boost library and resharper c++ plugin

I use visual studio 2017 for my c++ projects. I am also fan with resharper plugin which has a similar style like Jetbrains Clion.
However, when a huge library is included, like Boost C++ Library into projects. The intellisense pops out too slowly, no matter resharper intellisense or vs native intellisense. Furthermore, sometimes vs2017 may misjudge incomplete input as errors for a time.
I have already known some seemly useless method mentioned in official tutorial and my computer is good enough of i7 and high volume memory/ssd no lack of machine performance.
So, anyone can help to increment performance for reshaper c++ in vs2017. Like switch some options like tool or project properties.

Using different compiler in Visual Studio

This maybe a beginner question but could not find proper answer on the internet.
I am curious can I use some other compiler (which I like) in Visual Studio 10?
As of Visual Studio 2010, it is conceptually possible to integrate another compiler. In the book ‘Inside the Microsoft Build Engine, Using MSBuild and Team Foundation Buid’ 2nd edition, on page 338, the chapter ‘Adding a New Platform and Platform Toolset’ the process of adding gcc to visual studio is explained.
However, while it is possible, it has always remained as a concept. To my awareness, nobody has actually been up to the task and publicly disclosed the results. But even with this support, you'd still be lacking debugging facilities. Which would require your compiler of choice to generate .pdb files and/or extend visual studio with a new local debugger
In summary it's quite a venture
You can use other compiler Intel c++ in VS. I don't think any other compiler supports VS.The main reason behind it is lack of plug-ins in VS. But you can use cmake scripts to compile your code in different compilers. With eclipse you can use most of the compilers (VS,gcc). Code blocks also allows you to choose the compilers.
Yes,you can use Intel C++,and even MATLAB 7.1 or later for sure..here is a reference to use MATLABIt gives a step by step procedure to use MATLAB with VS
You can also write Java programs and include javac compiler for it...you can refer this if needed..Including javac with VS
I kno this is surely possible from VS 2010 but not sure for the b4 editions..hope it helps..

Visual Studio Debugger displays wrong values for native types

I am writing a program in managed C++ and native C++ using Visual Studio 2008 (Version 9.0.30729.1 SP) and .NET 3.5.
When debugging, Visual Studio displays obviously wrong values for types like size_t and pointers that are native.
Using messageboxes, I can verify that the actual values are correct though.
Is there a way to fix this behaviour?
Here is a screenshot to clarify what I mean:
It seems that switching the Common Language Runtime Support under Configuration Properties from Pure MSIL Common Language Runtime Support (/clr:pure) to Common Language Runtime Support (
/clr) did the trick. I can now view native objects just fine.
Try installing KB957912 (Updates for Visual Studio 2008 SP1 debugging and breakpoints), it may help you.
I don't know what's the type of g_pGame, but it is possible to write extensions for Visual Studio so you can view the values of your custom types. Although that feature is mainly targeted for other use, like you have your own String container and you know it's internal details and you want to simply see the string value in it. So normally it is not for working around misbehavior. Also, writing such extension needs effort, and it won't help the problem with other types. But I want to let you know.

Windows application crash .dmp file analysis in visual studio

To get the dump file (for crashes) I am using the userModeProcessorDumper.exe. Now the question is how to read this file (to see the stack information). Regarding this I have couple of questions
Yes I know I can use WinDbg (related tools) to analyze the .dmp file. My question is - Can this be analyzed in Visual Studio? To be more specific - I am having Visual Studio Enterprise Edition 6 - In this particular pack - can the .dmp file be opened for analysis.
If Yes, Please help me with steps.
I see in web advice to use Visual Studio 2XXX version. So I am feeling that the same cannot be done using VS Enterprise Edition.
The application is built on MinGW, even these application - can we analyze in Visual Studio (what ever is the edition - i.e Visual Studio 2XXX or VS Enterprise Edition X.Y)? Should I take care of any additional setting for this.
Any material link on this topic would be very helpful to me.
Thanks a lot in advance for your advice.
PS : My application is a C++ based application.
From what I remembered, VS6 cannot be used to debug dumps. It's been a while since I last used it, and trying to verify me memory I came across a workaround that might allow you to debug those dumps after all: Visual C++ 6, and post-mortem (crash dump) debugging.
I don't have VC6 at hand, and have no idea if this really works. Other than that, I feel for you... There are IDEs so much better than VC6. Hope this inability gives you the push towards an upgrade. Debugging dumps is really easy with VC7 and above.

Static-code analyzer: unmanaged C++ Visual Studio 2008

I develop commercial unmanaged C++ app on Visual Studio 2008, and I want to add a static-code analysis tool.
Any recommendations?
I think it would be real nice if the tool can be integrated into MSVC.
I'm thinking about PC-Lint + Visual Lint
However, I have been taking a hard look at Coverity, Understand, and Klockwork as well.
Price isnt really the issue. I want opinions from people who actually used the tool for unmanaged C++ on MSVC, and they just absolutely loved it.
Lastly, VSTS and Intel Parallel Studio now also offer static code analysis. Nice~
Note: related post suggest Coverity is the best (?) (see last 2 posts)
Beyond all those you mentioned, VS Team Developer edition comes bundled with a nice static analysis tool called prefast. Its (obviously..) well integrated into the IDE, and accessible via the menus.
Its in fact a public release of an MS internal tool - a thin version of a tool called Prefix they run on their builds. Personally, when I faced the same decision, prefast sufficed.
I work for RedLizard building Goanna, a C++ static analysis plugin for Visual Studio. Its focus is on desktop use by a programmer. You can run it on individual files, just as you do the compiler, and it can give you results quickly.
There is a trial available. Right-click a file, select Run Goanna, and the results appear in the Visual Studio warnings list.
You can try CppDepend, a pretty complete c and c++ static analyzer, well integrated with VS 2008, 2010, 2012, 2013 and 2015.
I just started using cppcheck which I like very much due to the low noise.
Although it does not integrate directly with Visual Studio 2008, VS can be customized and you should be able to integrate it directly into the IDE.
I use PVS-Studio static code analyzer.
This static code analyzer good integrated with Visual Studio 2005, 2008, 2010, 2012, 2013.
It has many additional features:
Verification of files which were recently modified several days ago;
Verification of files by their filenames from within the text file
list;
version control systems integration; ability to operate fro m command line
interface;
«False Alarms» marking; saving and loading of analysis
results;
utilizing all available cores and processors;
etc...