Blog
-
Collection of interesting resources on C/C++ programming
16.05.2012I constantly study the Web regarding new articles on C/C++/C++11 programming. If I find them interesting, I post links to them in twitter @Code_Analysis, on Reddit /r/Viva64 and like them on StumbleUpon. If you are present on one of these websites, I invite you to follow me. You will find a lot of interesting articles in time. To get you interested, I decided to create a small selection of materials. Read more -
All about PVS-Studio
15.05.2012PVS-Studio is a static analyzer that detects errors in source code of C/C++/C++11 applications. The PVS-Studio tool integrates into the Visual Studio 2005/2008/2010 environment. Read more -
Farewell to #define private public
24.04.2012The C++ language, compilers and libraries are heading yet farther towards a stricter control over what programmers write. It is good. All of you probably heard jokes about #define true ((rand() % 100) < 95 ? true : false). But joking apart, the possibility to redefine keywords makes a program very difficult to understand or leads to strange errors. Read more -
Analyzing the Blender project with PVS-Studio
23.04.2012We go on analyzing open source projects and making the software world better. This time we have checked the Blender 2.62 package intended for creating 3D computer graphics. Read more -
I want to sell a PVS-Studio license to the Intel company
19.04.2012I cannot get rid of the urge to sell a PVS-Studio license to the developer team of Intel Performance Primitives Library. Read more -
What do static analysis and search engines have in common? A good "top"!
18.04.2012Developers of search engines like Google/Yandex and developers of static code analysis tools to some extent solve the same task. Both have to provide users with a certain selection of resources that meet users' wishes. Well, of course search engines' developers would like to confine themselves just to the button "I'm Feeling Lucky!", while developers of static code analysis tools want to generate a list of real errors only. But reality imposes constrains, as usual. Do you want to know how we fight the cruel reality while developing PVS-Studio?. Read more -
Wade not in unknown waters. Part three
11.04.2012I'm going on to tell you about how programmers walk on thin ice without even noticing it. Let's speak on shift operators <<, >>. The working principles of the shift operators are evident and many programmers even don't know that using them according to the C/C++ standard might cause undefined or unspecified behavior. Read more -
PVS-Studio command line tips
05.04.2012As a lesser portion of our users utilize the command line version comparing to the VS IDE version, I would like to point attention to several aspects of using the command line version, as these could be not quite obvious at a first glance. Read more -
Studying methods of attracting people to a software product's website
29.03.2012This article will be of interest to those who promote proprietary software products on the Internet. So, the article is of absolutely practical character. It is a report of what we have been doing for some time already to promote our product PVS-Studio. I will tell you about the things that work, the things that don't work, and share my thoughts related to this subject. Read more -
Checking WinMerge with PVS-Studio for the second time
28.03.2012The article continues the idea that static code analyzers are tools to be used regularly, not once. Read more -
The secret thing about PVS-Studio
21.03.2012There exists the PVS-Studio code analyzer. It integrates into the Visual Studio 2005/2008/2010 environment and allows you to detect errors in C/C++/C++11 programs (see samples of errors it can detect). Regarding its advantages, we can note usability, detailed documentation, on-the-fly analysis and the best diagnostics of 64-bit errors. Read more -
Verifying projects utilizing Marmalade SDK with PVS-Studio analyzer
19.03.2012Marmalade SDK (which was previously called AirPlaySDK) is a cross-platform SDK which allows the development of multi-platform applications for such mobile platforms, as iOS, Android, Symbian and several others. Read more -
An ideal static analyzer, or why ideals are unachievable
15.03.2012Being inspired by Eugene Laspersky's post about an ideal antivirus, I decided to write a similar post about an ideal static analyzer. And meanwhile think how far from being it our PVS-Studio is. Read more -
Licensing of PVS-Studio: why don't we have Single User License?
11.03.2012PVS-Studio has a rather simple licensing scheme now - the basic (usual) version is licensed for a team consisting of up to five developers. There is also the site license for large teams, but we won't dwell upon it here. Read more -
Analyzing the TrinityCore project with PVS-Studio
24.02.2012TrinityCore is a free project distributed under the GPL license. The project's purpose is to create alternative software to emulate a server of the multiplayer game World of Warcraft by Blizzard Entertainment. The main aim of the project is an educating one. The project is by no means intended to gain profit from its usage. The source code written in C and C++ is open, which means that it is distributed free and users are not imposed any obligations and responsibilities. Read more -
Analyzing the Dolphin-emu project
24.02.2012We are regularly asked to check various open-source projects with the PVS-Studio analyzer. If you want to offer some project for us to analyze too, please follow this link. Another project we have checked is Dolphin-emu. Read more -
FAQ for those who have read our articles
21.02.2012This post contains a FAQ for those who have read our articles. Read more -
Reanalyzing the Notepad++ project
13.02.2012More than a year has passed since we analyzed Notepad++ with PVS-Studio. We wanted to see how much better the PVS-Studio analyzer has become since then and which of the previous errors have been fixed in Notepad++. Read more -
Analyzing the Quake III Arena GPL project
06.02.2012As you know, the id Software company has laid out source codes of many of their games. We already checked some of these projects earlier. This time we decided to analyze the Quake III Arena GPL source code. Analysis was performed with PVS-Studio 4.54. Read more -
Wade not in unknown waters. Part two
01.02.2012This time I want to speak on the 'printf' function. Everybody has heard of software vulnerabilities and that functions like 'printf' are outlaw. But it's one thing to know that you'd better not use these functions, and quite the other to understand why. In this article, I will describe two classic software vulnerabilities related to 'printf'. You won't become a hacker after that but perhaps you will have a fresh look at your code. You might create similar vulnerable functions in your project without knowing that. Read more -
How we managed the task of implementing trial mode in the PVS-Studio code analyzer
01.02.2012Choosing and changing the model of trial mode is one of the most relevant and widely discussed tasks for many software developers. It is easy to make a model for some programs and difficult for others. And some people are haunted by the question: "Have we made everything right?" The task of choosing a trial-model is relevant to us, PVS-Studio developers, as well. We decided to share some of our ideas regarding this subject and tell you about a new alternative we have invented. We hope that our arguments and some ideas will be helpful to other developers too. Read more -
Wade not in unknown waters. Part one
27.01.2012We decided to write several small posts on how C/C++ programmers play with fire without knowing it. The first post will be devoted to an attempt to explicitly call a constructor. Read more -
Tips on speeding up PVS-Studio
15.12.2011This note is obsolete. Please read "Tips on speeding up PVS-Studio" in documentation.. Read more -
On the good of automated filtering of identical messages
14.12.2011From the very beginning duplicates of messages in our analyzer PVS-Studio have been eliminated. For example, if a diagnostic message is generated for a code in an .h-file included into several .cpp-files, our tool will generate it only once. Some other analyzers don't do that and when they check .cpp-files, they show you messages every time on the same strings in .h-files. So it turns out that our analyzer generates fewer messages compared to such tools. But we had no chance to estimate how useful it is before. Now we've got such an occasion, and the results are really impressive. Read more -
"Please check this project too..."
13.12.2011We believe that the best way of promoting our static code analyzer PVS-Studio is using it to check famous open source projects (like Chromium, Clang, WinMerge and many others) and writing articles on the check results. This task is not so simple because, unfortunately, PVS-Studio is just a tool, not a magical program that can find all the errors itself. People often write to us asking to check this or that project and write an article on it. Read more -
Windows Error Reporting dialog
08.12.2011As with any other native Windows program, there exists a possibility of an unhandled exception being raised during the operation of PVS-Studio analyzer (the PVS-Studio.exe process in particular), this can be because of the call stack overflow for example. The Windows family operating systems starting with Windows Vista would generate a special emergency shutdown dialog in case of an unhandled exception allowing you to debug or close such crashing program. Read more -
About our VivaCore library
06.12.2011Those who are interested in the code analysis technology most likely have heard about our library VivaCore. It is this library our static analyzer PVS-Studio is based on. Earlier one could download the library from our site, but we have removed it recently and do not distribute it any more. Read more -
What amazes me while developing the static code analyzer
28.11.2011When developing any programmer tool, be it a compiler or a static analyzer, or anything else, it is naturally that programmers use test projects the tool is constantly ran on. For example, when developing our static analyzer, we run it on 70 real projects. It allows us to make sure that everything is alright and nothing is broken. Besides, when we develop new diagnostic rules, we can see the code fragments where the new errors have been detected, after running the tests. Everything is logical and obvious. But why did I entitle the post in that way?. Read more -
PVS-Studio: analyzing Doom 3 code
25.11.2011The id Software company possesses a PVS-Studio license. However, we decided to test the source codes of Doom 3 that have been recently laid out on the Internet. The result is the following: we managed to find just few errors, but still they are there. I think it can be explained by the following fact. Read more -
Myths about static analysis. The fifth myth - a small test program is enough to evaluate a tool
07.11.2011While communicating with people on forums, I noticed there are a few lasting misconceptions concerning the static analysis methodology. I decided to write a series of brief articles where I want to show you the real state of things. Read more -
Myths about static analysis. The fourth myth - programmers want to add their own rules into a static analyzer
04.11.2011While communicating with people on forums, I noticed there are a few lasting misconceptions concerning the static analysis methodology. I decided to write a series of brief articles where I want to show you the real state of things. Read more -
Myths about static analysis. The third myth - dynamic analysis is better than static analysis
03.11.2011While communicating with people on forums, I noticed there are a few lasting misconceptions concerning the static analysis methodology. I decided to write a series of brief articles where I want to show you the real state of things. Read more -
Myths about static analysis. The second myth - expert developers do not make silly mistakes
02.11.2011While communicating with people on forums, I noticed there are a few lasting misconceptions concerning the static analysis methodology. I decided to write a series of brief articles where I want to show you the real state of things. Read more -
Myths about static analysis. The first myth - a static analyzer is a single-use product
01.11.2011While communicating with people on forums, I noticed there are a few lasting misconceptions concerning the static analysis methodology. I decided to write a series of brief articles where I want to show you the real state of things. Read more -
The largest and most interesting advertisement article (70 pages) about static code analysis
26.10.2011Of all the types of advertisement, only few of them are good for advertising programmer tools. Media advertising (television, radio, popular scientific issues) is too expensive (because you have to pay for presenting your ad to a potentially large audience or readership) and often misses the target (because there are very few programmers out of audience/readership). Advertising on specialized sites is often as inefficient, since, first, programmers instinctively skip ads and, second, they are aware of AdBlock. Another way is to make video guides on handling a program, but far not all the programs look bright and colorful to be interesting to watch videos about. Hence, it seems that the only way to tell the whole world about your product is to honestly and impartially show its good points by real examples. Read more -
PVS-Studio vs Chromium - Continuation
13.10.2011About half a year ago we checked the Chromium project and wrote an article about it. The PVS-Studio analyzer naturally keeps developing, and in the new Chromium version we have found some errors undetected before. Many errors, of course, refer not to the Chromium project itself but to libraries it employs. But in this article I want to show you how the analyzer's capabilities have improved and not tell you about what we have found in this or that part of Chromium. That's why I will give messages together. Read more -
Checking Intel IPP Samples for Windows - Continuation
12.10.2011The progress keeps on going. My favorite static code analyzer PVS-Studio is developing too. It has occurred to me recently that those projects we already checked, we can well check again. It would be strange if we wrote articles on this topic, and they would hardly be interesting. But I think we can write one: it will become one more argument for the idea that you can get real benefit from static analysis only using it regularly and not from time to time. So, let's see what new interesting things we have managed to find in the Intel IPP Samples project. Read more -
PVS-Studio Output Window vs plain text stdout
12.10.2011While communicating with programmers who ponder over the idea of using a static code analyzer, you may often here them say: "You don't need any special interface for a tool of that kind. A simple command line tool will do. And you can always save stdout into a file". I want to show you what is wrong about this way of thinking by the example of PVS-Studio's Output Window. Read more -
How to add a new diagnostic rule into PVS-Studio? Days from developers' life
14.09.2011We are often asked the question how one can add one's own diagnostic rule into our static analyzer PVS-Studio. And we always answer that it is very simple: "You just need to write us a letter with your request and we will add this rule into the analyzer". This interface of adding new rules is convenient to users. This is the best and most convenient interface actually. It's not so easy to do it on your own as it may seem. In this post, I will show you the bottom of the iceberg implied in the words "we have added this simple rule". Read more -
Ctrl+S and Visual Studio Output Window
12.08.2011One of PVS-Studio users forwarded a bug report to us containing the following:. Read more -
PVS-Studio vs Clang
05.08.2011By chance, we have checked the Clang project. I think some developers will be curious about the results. Read more -
How we have solved an engineering task for several years in PVS-Studio
03.08.2011At first I wanted to title this post "How PVS-Studio enables cheap integration of static code analysis into the development process" but I decided not to do it because of the ambiguous interpretation of the word "cheap". So I will tell you about one engineering problem we had to solve constantly to enable people to use our product. Going a bit ahead I want so say that we seem to have solved it. Read more -
Checking Intel Energy Checker SDK (IEC SDK) with PVS-Studio
28.07.2011Recently, while telling you about check of another project, I have constantly repeated that it is a very quality code and there are almost no errors in it. A good example is analysis of such projects as Apache, MySQL and Chromium. I think you understand why we choose such applications for analysis. They are known to all of us while nobody wants to hear about horrible things found in the diploma design of student Jack. But sometimes we check projects that just come to hand. Some of such projects leave painful impressions in my delicate and vulnerable soul. This time we checked Intel(R) Energy Checker SDK (IEC SDK). Read more -
Leo Tolstoy and static code analysis
21.07.2011This time we checked Apache HTTP Server with PVS-Studio. As we had expected, we found errors there. The errors are few. We expected this either. Read more -
Changes in PVS-Studio's licensing policy
15.07.2011The licensing policy of the PVS-Studio static code analyzer will be changed in the new version PVS-Studio 4.32. Read more -
Explanations to the article on Copy-Paste
28.06.2011Many readers liked my article "Consequences of using the Copy-Paste method in C++ programming and how to deal with it" [1]. Scott Meyers [2] noticed it too and asked me how static analysis proper helped us to detect the errors described in the article. This is his letter:. Read more -
PVS-Studio has learned to watch over your programming
24.06.2011This note is obsolete. Please read "PVS-Studio's incremental analysis mode" in documentation.. Read more -
Using PVS-Studio analyzer together with Microsoft Visual Studio 2010 incremental assembly
20.06.2011This note is obsolete. Please read "PVS-Studio's incremental analysis mode" in documentation.. Read more -
Static analysis and ROI
06.06.2011I regularly communicate with potential users who are worried about errors in C++ programs. Their worry is expressed in the following way: they try the PVS-Studio tool and start to write that it finds too few errors during tests. And although we feel that they find the tool interesting, still they their reaction is quite skeptical. Read more -
About our clients' practice of PVS-Studio integration
13.04.2011Sometimes our potential clients ask about examples of successful integration of PVS-Studio in various companies. Their interest is understandable. After Case Study by Microsoft in the form "the Formual-1 McLaren team has begun to use the new SQL Server and their results has become so much better that..." you really want to see benefit from a particular tool. Read more -
Why you should run static code analysis regularly and not from time to time (for instance, at "each release")
12.04.2011While developing and helping people to use static code analyzers, we constantly encounter an inefficient approach to using these tools. Developers would launch the tool, find and fix interesting software errors and then launch the tool only from time to time, for instance, when a new version is released. This approach is destined to fail. I will tell you why. Read more -
An eternal question of timing
30.03.2011It seemed that long forum debates about methods of measuring algorithm's running time, functions to use and precision that should be expected were over. Unfortunately, we have to return to this question once again. Today we will discuss the question how we should measure speed of a parallel algorithm. Read more -
It's difficult to make it right (of one subtle error)
22.03.2011Our PVS-Studio analyzer has existed for several years. But we are still coming across "initial" errors in it, i.e. errors that have existed there for the whole life-cycle. We have checked the source code of the Chromium project recently (the archive with source code only occupies a bit less than 1Gbyte). This is a solution with about 450 projects. One of the projects would not get checked and generated strange errors at the preprocessing stage. We are using Visual C++ as the preprocessor, so we cannot analyze code without preprocessing. Read more -
What is sizeof(&X) expression equal to, X being defined as "char *X[n];"?
15.03.2011Consider the following sample. Read more -
Knee-deep in C++ s... code
01.03.2011Perhaps many of you know the site govnokod.ru. If not, I recommend those of you who think of themselves as programmers to visit it. Good mood is guaranteed! This is how the site describes itself:. Read more -
Is it reasonable to use the prefix increment operator ++it instead of postfix operator it++ for iterators?
13.02.2011I decided to find out if there is practical sense in writing ++iterator instead of iterator++ when handling iterators. My interest in this question arouse far not from my love to art but from practical reasons. We have intended for a long time to develop PVS-Studio not only in the direction of error search but in the direction of prompting tips on code optimization. A message telling you that you'd better write ++iterator is quite suitable in the scope of optimization. Read more -
Free license for the PVS-Studio static analyzer for developers, bloggers and authors of articles in IT subject editions
25.01.2011Please, read about changes in trial-mode which allow using PVS-Studio without license.. Read more -
Cases when a static code analyzer may help you
24.12.2010The static code analysis method is the method of searching for places in program text that are highly probable to contain errors. Programmers use special tools called static code analyzers for this purpose. Having got a list of suspicious code lines, a programmer reviews the corresponding code and fixes errors detected. Read more -
Analysis of the Ultimate Toolbox project
23.12.2010While testing the general analyzer included into PVS-Studio 4.00, we checked several open-source projects from the CodeProject site. One of those was Ultimate ToolBox. Read more -
What is the reason for making PVS-Studio 4.00 a commercial solution? :-(
21.12.2010Unfortunately, we must make the PVS-Studio 4.00 static analyzer completely paid. We intended to make only the set of 64-bit rules paid while keeping the general analysis and OpenMP-software analysis free. But the world is stern and we've found no support. Read more -
Static analysis and regular expressions
09.12.2010I develop the PVS-Studio static code analyzer intended for analyzing C/C++ software. After we implemented general analysis in PVS-Studio 4.00, we received a lot of responses, both positive and negative. By the way, you are welcome to download a new version of PVS-Studio where we have fixed a lot of errors and defects thanks to users who told us about them. Read more -
Working with PVS-Studio in Visual Studio 2010 from under multiple Windows user accounts
09.12.2010The PVS-Studio installer allows you to setup up the analyzer for all of system's user accounts at once. But the restrictions of extension's deployment process for 2005 and 2008 Visual Studio versions allow the installation to be done only from administrator account for this IDEs, which can be inconvenient at times. Read more -
Issue with '(' and ')'characters in PATH system environmental variable while using PVS-Studio with Visual Studio 2008
08.12.2010At times the users of PVS-Studio static analyzer encounter the following issue while starting the analysis using Visual Studio 2008 IDE: the analysis does not start and only one message of the following kind is produced. Read more -
Let the world tremble! We've released PVS-Studio 4.00 with a general-purpose analyzer!
01.12.2010Programmers, meet a new tool to search for errors in source code of software written in C/C++. Within the scope of the PVS-Studio analyzer, we implemented a new set of general-purpose rules. Read more -
Static analysis: errors in media player and bugless ICQ
18.11.2010I'd like to continue our excursion of software errors and demonstration of static code analysis' utility. Read more -
Difference of code analysis approaches in compilers and specialized tools
01.11.2010Compilers and third-party static code analyzers have one common task: to detect dangerous code fragments. However, there is a great difference in the types of analysis performed by each kind of these tools. I will try to show you the differences between these two approaches (and explain their source) by the example of the Intel C++ compiler and PVS-Studio analyzer. Read more -
Static analysis of source code by the example of WinMerge
30.10.2010The today's post is devoted to the question why tools of static source code analysis are helpful regardless of programmer's knowledge and skill. I will demonstrate the benefit of static analysis by the example of the tool known to every programmer - WinMerge. Read more -
Of complicacy of programming, or won't C# save us?
26.10.2010Programming is hard. I hope no one would argue that. But the topic of new programming languages, or more exactly, search of a "silver bullet" is always highly popular with software developers. The most "trendy" topic currently is superiority of one programming language over the other. For instance, C# is "cooler" than C++. Although holy wars are not the reason why I'm writing this post, still it is a "sore subject" for me. Oh, come on, C#/lisp/F#/Haskell/... won't let you write a smart application that would interact with the outer world and that's all. All the elegance will disappear as soon as you decide to write some real soft and not a sample "in itself". Read more -
Searching for explicit conversion of a pointer to a 32-bit type
19.10.2010In Visual Studio C++ compiler, there is the warning C4311 ('variable' : pointer truncation from 'type' to 'type') intended to detect errors of casting a pointer to 32-bit data types. This warning corresponds to warning #810 in Intel C++. This is an example of the defect they diagnose:. Read more -
Issues of 64-bit code in real applications: and what about Linux?
11.10.2010While telling programmers about 64-bit issues they may encounter when porting their programs, I often hear reproaches: "Yes, surely - such is your Windows... How good it is that Linux has had no problems with 64-bit code for a long time!". Read more -
Intel VTune Amplifier XE 2011 beta under the programmer's strict eye
15.09.2010I decided to take a look at the new Intel VTune Amplifier XE 2011 beta and write an article with an example of using it. However, the emphasis was partly moved from using Amplifier to testing it while writing the article, but it's good too. I hope that Intel developers will take account of my feedback and bring modifications into the next version of the tool. And will criticize both themselves and others at all. :). Read more -
Feeling the new Intel Parallel Studio XE 2011 beta
02.09.2010So I've gotten to try the C++ compiler included into Intel Parallel Studio XE 2011 beta at last. Here is a brief report of my experiments. Read more -
Five days for fixing a two-character error, or a myth of almighty technologies aiding software development
30.08.2010In 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. Surely this all is true but no one should ignore the main tool - brain, for nothing can replace it. Today I will speak about a program error that took us two characters and five days of work to fix it. Read more -
d'Artagnan and Internet, or working on the problem of bad links
30.08.2010Friends, 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. It is high time we started to take care of people and not robots. It gets more and more unbearable to work on the Internet. Farms of autogenerated sites with shittexts (ladies pardon me) are flourishing and breeding. Because of them one cannot find even technical materials not to speak of common ones. I wouldn't take it so close to heart if they had correct links. But links die like flies and when you read a post written a year earlier in a forum or blog, you have very little hope that you will be able to go anywhere by the attached links. Read more -
64-bit programs and floating-point calculations
18.08.2010A developer who is porting his Windows-application to the 64-bit platform sent a letter to our support service with a question about using floating-point calculations. By his permission we publish the answer to this question in the blog since this topic might be interesting for other developers as well. Read more -
Big Brother helps you
13.07.2010I was convinced one more time that programmers write programs absolutely carelessly, so that their programs work not because of their skill but due to chance and care of Microsoft or Intel compiler developers. Right it is they who really care and put crutches under our lop-sided programs when necessary. Read more -
Why is the number of the line where an issue was found sometimes absent in the Error List in PVS-Studio?
28.06.2010Sometimes the PVS-Studio code analyzer seems to find an issue in the code on which it generates a message, specifies the file name but does not show the number of the line with the issue as shown in the figure. Read more -
New diagnostic functions implemented in PVS-Studio 3.60
11.06.2010The V303 diagnostic message. Read more -
The reasons why 64-bit programs require more stack memory
07.06.2010In forums, people often say that 64-bit versions of programs consume a larger amount of memory and stack. Saying so, they usually argue that the sizes of data have become twice larger. But this statement is unfounded since the size of most types (char, short, int, float) in the C/C++ language remains the same on 64-bit systems. Of course, for instance, the size of a pointer has increased but far not all the data in a program consist of pointers. The reasons why the memory amount consumed by programs has increased are more complex. I decided to investigate this issue in detail. Read more -
Communication between developers and users
07.06.2010When developing software products, developers need very much to get feedback from users of their programs. The article discusses various means of arranging communication for getting this feedback. In this article, by an example of the tool for software developers, we discuss efficiency of various methods to get feedback. Read more -
Attracting attention of potential customers with the help of articles
21.05.2010Many of those who have read my previous post "Receiving feedback from potential users" think that whatever we do to attract attention of potential customers, there is no result. But it is not so. There is some attention. We have already found one good way of attracting attention of potential users. It is our articles and blogs. But this source remains the only one, and it is this fact that worries us. So we are searching for new ways. Read more -
Receiving feedback from potential users
20.05.2010It is not very easy to receive feedback from potential customers if you are just a small startup. I believe it is much easier for a large company - you may spend money on marketing research. You may communicate with customers you already have that purchase other yet similar products or services. But when you are a fresh startup, there is no client base and no money either. You face the task of trying to get the maximum possible result from communicating with those who can potentially become your customers and adjust the way of your development if the demand in any way does not fit the supply. In other words, you must find out what you should fix and offer to people to make them most interested in you. Read more -
"What is it?" – a new option of PVS-Studio code analyzer
19.05.2010While developing, maintaining and selling the PVS-Studio analyzer of C/C++ code, we find it very interesting to communicate with potential users of our software product. The main topic of discussion (besides licensing and pricing policy) is what a particular message generated by the analyzer means. It is not a secret that any code analyzer is a complex tool and messages about errors in a program are not always clear to users. Moreover, it is not always obvious how to correct the code. Read more -
Developing code testing and verification tools
18.05.2010OOO "Program Verification Systems" develops and maintains the PVS-Studio tool intended for detecting 64-bit and parallel errors in the code of C/C++ applications. The PVS-Studio package is a set of specialized static code analyzers that allow to perform verification of source code at the stage of program designing already and therefore significantly reduce costs on program debugging, testing and maintenance. Read more -
How to disable IntelliSence in Visual Studio 2010?
13.05.2010The question how to disable IntelliSence in Visual Studio 2005 and Visual Studio 2008 was very popular among programmers some time ago. There was even a huge topic on the MSDN forum where this issue was discussed. Deleting the file feacp.dll appeared to be the right solution. Read more -
Parallel notes N5 - continuing to study OpenMP constructs
26.03.2010Here is the next post devoted to studying the parallel programming technology OpenMP. Here we will consider two directives: atomic, reduction. Read more -
Parallel notes N4 - continuing to study OpenMP constructs
11.03.2010In this post we will continue to introduce you into OpenMP technology and tell you about some functions and new directives. Read more -
Parallel notes N3 - base OpenMP constructs
02.03.2010Now we would like to start introducing you into OpenMP technology and show you the ways of using it. In this post we will discuss some base constructs. Read more -
In what way can C++0x standard help you eliminate 64-bit errors
28.02.2010Programmers see in C++0x standard an opportunity to use lambda-functions and other entities I do not quite understand :). But personally I see convenient means in it that allow us to get rid of many 64-bit errors. Read more -
CruiseControl.NET - build automation platform
26.02.2010While developing software products with a complicated structure, you come at some moment to the necessity of automating the processes of building and integrating the projects and distribution kits being developed. Continuous integration is the practice of software development that implies frequent (up to several times during the day) automatic build and testing of the current product version. This approach enables you to reduce the labor intensiveness of the integration as such and detect its defects and conflicts at the very early stages. Note that this methodology implies using a version control system (for example, CVSNT and Subversion) to store the source codes and all the other components needed to build and test the project. Read more -
Parallel notes N2 - toolkit for OpenMP
24.02.2010Before starting to study the technique of parallelizing programs with the help of OpenMP technology, let us discuss the toolkit we will need. And here is what we will need first of all - Visual Studio 2005/2008 and Intel Parallel Studio. Read more -
Supercomputer technologies in science, education and industry
17.02.2010Recently some respectable organizations, such as MSU, RAS and HPC Association of Russian Universities, have published the book "Supercomputer technologies in science, education and industry". The book was published under the editorship of academicians V.A. Sadovnichiy and G.I. Savin and RAS corresponding member Vl.V. Voevodin, i.e. also very respectable sirs. The book is devoted to the ways of practical use of those technologies which are usually associated with something "cosmic". But nowadays supercomputer technologies are not merely a scientific sphere - people begin to use them to solve applied tasks related to designing and manufacturing. I will cite several examples of applying supercomputers to real life from this book. Read more -
Description of the error of integrating Intel Parallel Studio Service Pack 1 into Visual Studio 2005/2008
13.02.2010We noticed an error of integrating Intel Parallel Studio Service Pack 1 into Visual Studio 2005/2008 and would like to describe it in this post and tell you how to fix it. We pursue several goals. First, we hope that Intel Parallel Studio developers will notice this error and fix it. Second, it may help those who use Intel Parallel Studio eliminate this or similar errors if any. Third, this error leads to an incorrect behavior of the analyzer PVS-Studio that we develop and that also integrates into Visual Studio environment. Read more -
"Improve your... Google?"
11.02.2010While developing the code analyzer PVS-Studio intended for searching issues in 64-bit and concurrent software, we came to the need of collecting fresh information on the Internet on some topics. For example, it is always useful to answer the questions of programmers who may be interested in our tool on various forums and blogs. While collecting the data we found out that there is much information on the Internet and therefore manual search might be very long and tiresome. Thus the task of automating the process of searching for fresh data appeared. In this post we will tell you how we do this. Read more -
/Wp64 switch and template processing error
05.02.2010While maintaining the analyzer Viva64 (included into PVS-Studio) we often comment upon the switch /Wp64 of Microsoft Visual C++. If you are out of the swim, let me remind you that this switch appeared in Visual Studio 2003 and was intended for preparing migration of applications to 64-bit systems. In Visual Studio 2008, the switch /Wp64 is considered deprecated because it is high time we began to compile 64-bit applications instead of preparing for it. I.e. compilation in 64-bit mode reveals all the same code errors and bugs that the switch /Wp64 does when building a 32-bit application. And in the case of 64-bit code it is much more thorough and precise. Read more -
Parallel notes N1 - OpenMP technology
03.02.2010In the next few posts we will tell you about using multi-core processors in practice. For whatever they say about the multi-core, you need to "teach" programs to efficiently use multiple cores anyway. And in this first post you will see the announcement of the next issues and the first introductory note. Read more -
64-bit technologies - one more trend in the modern software
29.01.2010In the blogs and forums, there is much discussion of multi-core processors as an evident step of computer system development. And it is so. But there is another important development line besides multi-core machines - 64-bit technologies. What is it? What are the advantages? What are the problems involved? Here are the viewpoints of users and programmers. Read more -
Visual Studio Team System, /analyze and D9040
19.01.2010The C++ compiler in Visual Studio Team System (unlike Visual Studio Standard or Professional editions) has the command line switch /analyze. This switch allows you to launch the static analysis module integrated into Team System to search for some errors in code. Read more -
Levels of Paralleling
19.01.2010A task solution can be paralleled at several levels. There are no definite boundaries between these levels, and it is difficult to refer a particular paralleling technology to any of them. The division given hereby is quite relative, and serves to demonstrate the diversity of approaches to the issue of paralleling. Read more -
Verification and validation
12.01.2010The terms verification and validation are related to software quality checking. We use these terms in our articles and reports. Very often we have heard various comments and debates concerning the question if static analysis of program source code should be referred to verification and validation and in what way these notions differ. On a whole, it seems that everyone means something different by these terms and it leads to a mutual misunderstanding. Read more -
Optimization in the world of 64-bit errors
11.01.2010In the previous blog-post I promised to tell you why it is difficult to demonstrate 64-bit errors by simple examples. We spoke about operator[] and I told that in simple cases even incorrect code might work. Here is such an example:. Read more -
Issues of 64-bit code in real programs: qsort
11.01.2010We continue the cycle of posts about 64-bit errors detected in real applications. Time passes, demands for memory being consumed grow more and more, and now the time has come when somebody decides to sort an array consisting of more than 2^31 items. For that purpose this person chooses the function qsort implemented in OpenBSD 4.5. The result is a 64-bit error detected. The post "library/6287: 64-bit unsafety of qsort(3)" describes this error and explains the way to fix it. Read more -
Search of 64-bit errors in array implementation
11.01.2010In PVS-Studio 3.43, we revised the way how Viva64 analyzer detects errors in the classes serving as containers (arrays). Before, we have stuck to the principle that if a class has operator[], its parameter must have memsize-type (ptrdiff_t, size_t) and not int or unsigned. We still recommend that you use memsize type as an argument for operator[]. It allows the compiler to build a more efficient code in some cases and avoid some 64-bit errors beforehand. Now we have changed the approach to working with classes that have operator[] what allows us to reduce the number of unnecessary diagnostic warnings. Let us consider an example that might contain an error if we want to work with large data amounts:. Read more -
Peculiarities of virtual functions
11.01.2010I decided to describe one thing related to virtual functions because I am afraid I can forget it and return to this question once again later :). Read more -
Embarcadero C++Builder and 64-bit code
28.12.2009Some time ago, we wrote several letters to Embarcadero offering them to collaborate with us and use our tools to test 64-bit C/C++ code. Our idea was to integrate PVS-Studio with C++Builder or implement some diagnosis rules right in their compiler. All the letters remained without answer and that is why we decided to post a brief note for those who would be interested in the topic of testing the code created in C++Builder on efficiency on 64-bit systems. Read more -
Many cores is good but a fast hard disk is good too
28.12.2009Developing the code analyzer PVS-Studio we consider the task of increasing the tool's performance. Such solutions are quite slow, so the programmer who possesses even a powerful computer sometimes gets bored while waiting for the analysis to be completed. PVS-Studio analyzer employs the abilities of multi-core processors and it allows you to increase the speed of analysis of a project in several times in comparison to single-core systems. However, it turned out that the disk subsystem may also impact the analysis speed. Read more -
The role of "Fibonacci numbers" in the history of parallel programming
28.12.2009Fibonacci numbers are the elements of the number sequence 1, 1, 2, 3, 5, 8, 13, 21, 34, ... where each following number equals the sum of the two previous ones. Fibonacci numbers can be seen in many nature objects, in the correlation of a body's proportions; Fibonacci spiral is presented in a shellfish's shell. Read more -
One of the Answers to the Question "Who Needs All that Parallelism at All?"
25.12.2009One can often find discussions on the net that multicore processors, as well as parallelism, are needless, and all this is tricks of one (two or three) companies, which need to sell new processors. Read more -
Program Errors That Do Not Exist
24.12.2009Not long ago, one user of our code analyzer PVS-Studio addressed us; he was complaining about the work of the tool during the verification of one of his projects. Our tool gave out such a message:. Read more -
Why A + B != A - (-B)
21.12.2009While developing Viva64 analyzer intended for detecting 64-bit errors, I sometimes encounter interesting ways of code behavior. I would like to show you one example that is not very interesting practically but might be helpful in understanding more complicated cases. Read more -
Does the result of static code analysis depend on the compiler being used?
17.12.2009At one of the many discussions of static code analyzers, we mentioned our tool PVS-Studio as usual :-) . One of the participants asked: "Does the result of a static code analyzer depend on the compiler being used at all?" The answer to this question is much more complicated than it seemed at first. That is why you see this post. Read more -
Issues in real programs - what errors are not there in the world
10.12.2009When testing the analyzer PVS-Studio on one of the projects we found an interesting error. This error does not refer to the topic of 64-bits although its consequences are diagnosed as 64-bit problems. But this error attracts attention due to its unusual character and we decided to describe it in the blog. Read more -
Tachyon and Parallel Lint
08.12.2009In the previous post "Cold Tachyon" we showed an alternative approach to detecting parallel errors with the static code analyzer PVS-Studio (VivaMP). The tool PVS-Studio (VivaMP) was compared to Intel Parallel Inspector. On this example, the both tools showed the same efficiency having diagnosed the errors in the code. Of course, this does not mean that the tools are interchangeable. Each of them has its own scope of use but on the example of Tachyon we found out that the both technologies (the static and dynamic analyses) have the same result. Read more -
Cold Tachyon
08.12.2009A bit more than a month ago, the first Russian online-seminar "Intel Parallel Studio workflow" by Intel took place. Kirill Mavrodiev, who was participating in the event, demonstrated how one can parallelize an application as a black box. In other words, a typical case was examined when a developer deals with an unfamiliar code that must be modified - for example, parallelized. As a demo-example, the program Tachyon was chosen implementing the algorithm of ray tracing and drawing a three-dimensional fractal on the screen. The parallel programming technology OpenMP, Intel C++ compiler, multithreaded application profiler Parallel Amplifier and the tool for searching for parallel errors Parallel Inspector were chosen as a toolkit. After the seminar a new note " On a hot scent of the online seminar "Intel(R) Parallel Studio workflow"" was added. Read more -
64-bit code issues in real programs: pointer type change
03.12.2009Explicit type conversions often mask errors related to a change of a pointer type. One of such errors is casting of a pointer to 32-bit objects into a pointer to 64-bit ones. Let us look at one example received from the users of our tool PVS-Studio (Viva64). The error shows after porting the code to the 64-bit Windows:. Read more -
A nice 64-bit error in C
19.11.2009In C language, you may use functions without defining them. Pay attention that I speak about C language, not C++. Of course, this ability is very dangerous. Let us have a look at an interesting example of a 64-bit error related to it. Below is the correct code that allocates and uses three arrays, 1 GB each:. Read more -
Be careful when working with atomic directive
16.11.2009I would like to tell you about an error that a person not familiar with OpenMP technology too well can easily make. The error is related to a wrong supposition about how atomic directive works. atomic directive works faster than critical sections because some atomic operations can be directly replaced with processor commands. And that is why it is convenient to use when calculating various expressions. But you should keep in mind that atomic in no way influences the calls of the functions used in the expression. Let us explain it by an example:. Read more -
PVS-Studio prints the error "Some diagnostic messages may contain incorrect line number for file ..." (continuation)
10.11.2009We have already written about the causes of the warning "Some diagnostic messages may contain incorrect line number for file ...". Let me remind you that multi-line #define directives are processed incorrectly due to the preprocessor error in Visual C++ 2005 (without SP1). This leads to the PVS-Studio positioning error. If you get this warning I recommend that you read this note to understand the reason for that and how to deal with it. Read more -
Are 64-bit errors real?
08.11.2009I often hear in various interpretations the phrase: "The given examples show not the code incorrect from the viewpoint of porting to x64 systems, but the code incorrect in itself". I would like to discuss and theorize a bit on this point in the blog. Please, take this note with a bit of humor. Read more -
Presentation of information on the site
22.10.2009I am addressing the blog's readers for a word of advice on how to lay out information on our site. With time, besides PVS-Studio code analysis program product we are developing and selling, www.viva64.com site has included articles and a blog for programmers, presentations/demonstrations/booklets about PVS-Studio code analyzer and solid information traditional for corporate sites. Read more -
64-bit world is getting closer
07.10.2009Being involved in creation of tools for 64-bit application developers, I follow the situation in the world. Processors being released, operating systems and technologies. I need it to understand the tendencies of this industry's development and make plans according to them. Read more -
Possible issues relating to stdafx.h when using PVS-Studio
15.09.2009Sometimes, when testing the code of applications with the help of PVS-Studio, you may face some problems with stdafx.h file which is a part of the mechanism "precompiled headers". For example, PVS-Studio can warn that this file cannot be found. Or, if there are several stdafx.h files, the wrong one will be used. But no problems occur during compilation in Visual C++. Read more -
Issues of 64-bit code in real programs: virtual functions
15.09.2009We have already written in our articles about one of the problems of code migration to 64-bit systems relating to incorrect overload of virtual functions. For example, our article "20 issues of porting C++ code on the 64-bit platform" was published in March, 2007 (although is still relevant). It described the issue of virtual functions. The point of the problem consists in the following. There is CWinApp class in MFC library which has WinHelp function:. Read more -
Cannot process the whole file "foo.cpp"
14.09.2009Sometimes PVS-Studio analyzer cannot analyze a file with a source code completely. There are various reasons. Perhaps, the analyzer did not manage to analyze an especially complex template or something of the kind. Rarely, but it happens. As a rule this is not crucial from the viewpoint of analysis as only a small fragment of code remains unanalyzed. That's why the warning "Cannot process the whole file" is generated by PVS-Studio analyzer only if "Pedantic mode" is enabled in the settings. Read more -
Processing of exceptions inside parallel sections
07.09.2009Some time ago I wrote in the blog about some problems (see note "OpenMP and exceptions") occurring when an exception excesses the boundaries of parallel sections. I have also told you that an exception can be generated by new operator and that is must be caught and processed before it leaves the parallel section. The constructions used for this are rather inconvenient and complicated. Not so long ago I was told that in this case the smartest solution is using new operator which does not generate exceptions. That is using of a "nothrow"-variant of new operator which returns NULL in case of failure and allows you to write a simpler OpenMP code. Read more -
Magic constants and malloc() function
07.09.2009Once again I would like to discuss the issue of using magic constants in code. We can eternally repeat that one should use sizeof() operator for correct calculation of the size of memory being allocated. But both this knowledge and correct writing of a new code will not help you detect an error already existing in the maze of the old code in large projects. Let's consider a typical example of an error:. Read more -
Problems of 64-bit code in real programs: magic constants
28.08.2009I would like to tell you about one more 64-bit error we have found in some program. It becomes a good tradition to publish information about interesting and specific programming errors for 64-bit systems and we will try to follow it. Read more -
PVS-Studio refers to error "Some diagnostic messages may contain incorrect line number for file ..."
28.08.2009Sometimes PVS-Studio code analyzer can refer to this error: "Some diagnostic messages may contain incorrect line number for file ...". It may occur when using Microsoft Visual Studio 2005 without Visual Studio Service Pack 1. It is an error and not a diagnostic warning. In this note we will tell you about this error and how to react to it. Read more -
Atavisms in large systems
06.08.2009Large old program systems developing for tens of years contain a lot of various atavisms and code sections which have been simply written with the use of popular paradigms and styles of different ages. You can watch evolution of programming languages - the oldest code sections are written in C and the most recent contain complex templates in Alexandrescu style. Read more -
Testing of Linux-applications with the help of PVS-Studio in Windows
06.08.2009Quite recently we have released a new program product PVS-Studio which united our two analyzers Viva64 and VivaMP. When Viva64 analyzer intended for developers of 64-bit applications was a separate product yet, we were asked this question: "Is there a version of Viva64 for Linux?". And although it is possible to create such a version (as development of a separate solution for a particular client) there is no Linux-version of the analyzer for the moment. Read more -
PVS-Studio and testing Loki
06.08.2009In PVS-Studio 3.10, support parsing of complex constructions based on templates will be improved what will allow you to efficiently search errors even in the code of those programs which use complex template libraries such as Loki. But let's start with the beginning. Read more -
The function of printing an expression's type
20.07.2009I very often meet debates in forums on what type this or that expression will have. So I decided to make a little note in the blog to refer to an example of code printing the type of an expression and information about it:. Read more -
OpenMP 3.0 and iterators
29.06.2009There is pleasant news for the developers who want to use iterators and OpenMP together in their programs. Not to say that these technologies have been incompatible until recently, but it was impossible to use them so that they could complement each other. Iterators allow you to elegantly arrange item; they are safer and so on. It has been written in many books about the advantages of iterators and we will not enumerate them here. Unfortunately, until recently OpenMP technology has imposed great limitations on the types which could be used for parallel loops. And it concerned not only iterators. In some implementations, there was no support of even such simple unsigned types as unsigned/size_t. And there could be no error - a loop written with the use of unsigned/size_t type was not just paralleled and was executed only in one thread [1]. Read more -
A course on static analysis
29.06.2009Some time ago we communicated with TEKAMA Company about developing a course on static analysis for one of their corporate clients. Unfortunately, the project has not been implemented but we are still ready to develop theoretical and practical courses in this sphere. If you are interested in courses in the saphere of increasing software quality and code verification, write to us, we are likely to find mutual interests. Read more -
OOO "Program Verification Systems"'s plans on developing its own software products
09.06.2009Since the beginning of the spring 2009 our company has been rapidly developing a new program product PVS-Studio which is a development of Viva64 and VivaMP code analyzers. Now it's high time it was announced. But before doing this I'll give a brief historical reference. Read more -
Our first practical research in the sphere of metrics calculation
09.06.2009Not so long ago we began to think about the question of analyzing program code not only from the viewpoint of presence of 64-bit or OpenMP errors in it but from the viewpoint of its complexity for adaptation for 64-bit and parallel systems as well. And we would like to tell you about our first practical experiments in this sphere. Read more -
Use of rand() in OpenMP parallel sections
27.05.2009I came across an interesting thread at RSDN forum where a specific error of rand() function use in OpenMP parallel sections is considered (http://www.viva64.com/go.php?url=433). I collect various errors which deal with OpenMP technology use so that to implement their troubleshooting in VivaMP static code analyzer in future. The error considered at the forum is perhaps a very specific one to implement a rule for its verification, so I decided just to write about it in the blog. Read more -
The first impression of Intel Parallel Inspector
18.05.2009I carried out some experiments with Intel Parallel Inspector in memory-error diagnosis mode. I can say that I liked the product and the work it does. I was especially impressed by perfect integration into Visual Studio and full support of 64-bit projects what will be appreciated by Bounds Checker users. Read more -
VivaCore, questions on documentation
18.05.2009We have been addressed several times already with the question where one can see documentation on VivaCore library. Unfortunately, I must tell you that there is no documentation on VivaCore library at present. Read more -
Change of type alignment and the consequences
29.04.2009When porting software one of the task a developer faces is to change types' sizes and rules of their alignments. Not so long ago we provided support of the diagnosing rule allowing you to detect data structures which use memory on 64-bit inefficiently in Viva64 analyzer. But there is still some research work to be carried out in this field and I look through the messages concerning this topic in forums with attention. Read more -
OpenMP and exceptions
16.03.2009We continue developing our static analyzer VivaMP and now we would like to speak about diagnosing errors relating to using C++ exceptions in parallel regions. By a parallel region we understand a program fragment which is divided into two threads executed parallel. Parallel executed threads are formed by such OpenMP directives as for and sections. Read more -
Search of explicit type conversion errors in 64-bit programs
09.03.2009On forums I'm constantly asked questions concerning search of incorrect explicit type conversion when porting code on a 64-bit platform. I decided to write this small note so that I could refer people to it and avoid writing the answer every time.The description of the problem looks approximately as shown below:. Read more -
Online checking of errors relating to using OpenMP technology and x64 architecture
02.03.2009I like various code analyzers which can be tried in online mode to see if they are worth more detailed investigation. A good example is an online version of PC-lint analyzer by Gimpel Software: http://www.viva64.com/go.php?url=432.Our company regularly comes to the question: "Shouldn't we create a similar page on our site?". One can try there the analyzers Viva64 and VivaMP online, which are part of PVS-Studio. But I don't know is it really interesting for developers. An online version still imposes some limitations and it is better to use demo versions of the products which are available for downloading on the site. Read more -
Peaceful coexistence of PC-Lint and VivaMP
23.02.2009We are asked different questions relating to using PC-Lint, VivaMP and other static analyzers for testing parallel programs, we are asked if these tools are competitors, and there are many other similar questions. This seems to relate to release of a new version of PC-Lint 9.0 in which support of parallelism analysis is announced (see PC-lint Manual. Section: 12. Multi-thread support). I decided to unite discussions on this topic in which I participated and present them in a form of two questions which I will answer in detail. Read more -
Viva64 for optimizing data structures
16.02.2009Finally I've come to implementation of diagnosis in Viva64 analyzer detecting structures with non-optimal arrangement of fields. Absence in VivaCore of support of type calculations for small data types as ST_CHAR, ST_SHORT restrained me from that. Earlier all the types smaller than 32-bit were called ST_LESS_INT. So the library users should download an updated version of VivaCore. Everything has been changed in it recently. Read more -
Ineffectiveness of last() in the real world
09.02.2009While studying at the institute and learning different data processing algorithms, I already knew that the necessity of using such a function as last() for one-way list can indicate an unfortunate choice of the data structure and lead to ineffective algorithm. Although I knew it long ago, I haven't faced this in practice until recently. Read more -
Problems of 64-bit code in real programs: FreeBSD
02.02.2009While telling people about problems and difficulties of developing 64-bit applications I often hear in response: "You just should write programs well and there will be no problems". What only have we done trying to persuade people that this view is absurd! We wrote articles, gave examples but there still were those who would stick to their opinion. Read more -
OOO "Program Verification Systems" Blog Launch
01.02.2009We pay much attention to writing and publishing articles here in OOO "Program Verification Systems". On the "Articles" page of out site more than 40 various articles concerning static code analysis, 64-bit and parallel applications development are laid out. Many of them are written by the company employees, but there are also articles written by other people. Read more