|
|
|||
![]() PVS-Studio Static Code Analyzer for 64-bit and parallel C/C++ code
|
|||
![]() ![]() ![]() ![]() ![]()
02.09.2010
Feeling the new Intel Parallel Studio XE 2011 beta So I've gotten to try the C++ compiler included into Intel Parallel Studio XE 2011 beta at last.»
30.08.2010
Five days for fixing a two-character error, or a myth of almighty technologies aiding software development In this blog, you may often read posts about how this or that software tool or software development technology helps make fewer errors, find them faster and correct them easier.»
30.08.2010
d'Artagnan and Internet, or working on the problem of bad links Friends, it is high time we stopped considering links only in the context of their number and buying/ selling and counting PR of the site they are laid out on.» ![]()
22.07.2010
Using PVS-Studio with continuous integration systems This article illustrates techniques required to employ the use of PVS-Studio static code analyzer together with continuous integration systems.»
06.07.2010
Comparing capabilities of PVS-Studio and Visual Studio 2010 in detecting defects in 64-bit programs In the article, we will compare three mechanisms of code analysis from the viewpoint of detecting 64-bit errors: the Visual C++ 2010 compiler, the Code Analysis for C/C++ component included into Visual Studio 2010 and Viva64 analyzer included into PVS-Studio 3.60.»
29.06.2010
A Collection of Examples of 64-bit Errors in Real Programs
This article is the most complete collection of examples of 64-bit errors in the C and C++ languages.» ![]() |
64-bit lessons![]() Lesson 8. Static analysis for detecting 64-bit errors
Static code analysisStatic code analysis is a methodology of detecting errors in program code relying on studying the code fragments marked by the static analyzer by the programmer. The marked code fragments are most likely to contain errors of some particular kind. In other words, a static analysis tool detects those places in the program text which are subject to errors or have bad formatting. Such code fragments are left for the programmer to study them and decide if they must be modified. Static analyzers may be general-purpose (for example, Microsoft PREFast, Gimpel Software PC-lint, Parasoft C++test) and special-purpose to search for some particular error classes (for example, Chord to verify concurrent Java programs). Usually static analysis tools are rather expensive and require that you know how to use them. They often provide rather flexible yet complicated subsystems of settings and false alarm suppression. Because of this static analyzers are used, as a rule, in companies providing a mature level of software development processes. In exchange for being complicated to use static code analyzers allow programmers to detect a lot of errors at the early stages of program code development. The practice of using static analysis also disciplines programmers and helps managers control young employees. The main advantage of static code analyzers is an opportunity to greatly reduce the costs of eliminating defects in a program. The earlier an error is detected, the less expensive it is to correct it. Thus, according to the book "Code Complete" by McConnell, correction of an error at the stage of testing the code is five times more expensive than at the stage of designing the code (coding): Figure 1 - Average costs of correcting defects depending upon the time of their appearance in the code and their detection (the data presented in the table are taken from the book 'Code Complete' by S. McConnell) Static analysis tools reduce the cost of development of the whole project by detecting many errors at the stage of designing the code. Static analysis for detecting 64-bit errorsLet us point out the advantages of static code analysis that make this method the most appropriate to detect errors in 64-bit code:
Viva64 analyzer included into PVS-StudioPVS-Studio is a package of static code analyzers to check contemporary resource-intensive applications. PVS-Studio includes a special static analyzer Viva64 intended for diagnosing 64-bit errors. PVS-Studio analyzer is designed for a Windows-platform. It integrates into Microsoft Visual Studio 2005/2008/2010 development environment (see Figure 2). PVS-Studio's interface allows you to filter diagnostic warnings using various techniques and also save and load warning lists. Figure 2 - PVS-Studio integrating into Microsoft Visual Studio The analyzer's system requirements coincide with those of Microsoft Visual Studio:
All the errors that can be diagnosed are thoroughly described in Help system that becomes available after you install PVS-Studio. You may also see Help system on PVS-Studio online on our site. The PVS-Studio distribution kit also contains special projects serving as examples of code flaws that will help you study the analyzer. You may download the demo-version and see the guide "PVS-Studio Tutorial" to get closer to PVS-Studio. The demo-version has several limitations:
At present, PVS-Studio analyzer provides the fullest diagnosis of 64-bit errors. You may study the comparison characteristics in the article "Comparing PVS-Studio with other code analyzers". While studying various patterns of errors in the next lessons, we will often refer to PVS-Studio to show you how to detect them. The course authors: Andrey Karpov (karpov@viva64.com), Evgeniy Ryzhkov (evg@viva64.com). The rightholder of the course "Lessons on development of 64-bit C/C++ applications" is OOO "Program Verification Systems". The company develops software in the sphere of source program code analysis. The company's site: http://www.viva64.com. Contacts: e-mail: support@viva64.com, Tula, 300027, PO box 1800. | ||