-
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 -
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 -
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 -
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 -
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