|
|
|||
![]() PVS-Studio Static Code Analyzer for 64-bit and parallel C/C++ code
|
|||
![]() ![]() ![]() ![]() ![]()
28.06.2010
Why is the number of the line where an issue was found sometimes absent in the Error List in PVS-Studio? Sometimes 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.»
07.06.2010
Communication between developers and users Abstract When developing software products, developers need very much to get feedback from users of their programs.» ![]()
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.» ![]()
22.07.2010
We released a new version of PVS-Studio code analyzer - PVS-Studio 3.61»
10.06.2010
We released a new version of PVS-Studio code analyzer - PVS-Studio 3.60. »
19.05.2010
Our workers visited the GDC2010 conference that was held on May, 14-16, 2010, in Moscow and talked to many developers who participated there.»
|
Terminology![]() Address arithmeticAddress arithmetic is a method of calculating the address of an object with the help of arithmetic operations on pointers and use of pointers in comparison operations. Address arithmetic is also called pointer arithmetic. According to C and C++ language standards, the result address must remain strictly within the bounds of a single array object (or just after it). Adding or subtracting from a pointer moves it by a multiple of the size of the data type it points to. For example, assume we have a pointer to an array of 4-byte integers. Incrementing this pointer will increment its value by 4 (the size of the element). This effect is often used to increment a pointer to point at the next element in a contiguous array of integers. Pointer arithmetic cannot be performed on void pointers because the void type has no size, and thus the pointed address cannot be added to. However, there are non-standard compiler extensions allowing byte arithmetic on void* pointers. Pointers and integer variables are not interchangeable. Null constant is the only exception from this rule: it can be assigned to the pointer, and the pointer can be compared to null constant. As a rule, to show that null is a special value for the pointer, NULL constant is written instead of number "0". Pointer arithmetic provides the programmer with a single way of dealing with different types: adding and subtracting the number of elements required instead of the actual offset in bytes. In particular, the C definition explicitly declares that the syntax A[i], which is the i-th element of the array A, is equivalent At the same time, powerful pointer arithmetic can be a source of errors. Address arithmetic is a restrictive stage in the process of mastering 64-bit systems for the old C/C++ program code can contain a lot of errors relating to the use of pointers. To learn more about this problem see the article "20 issues of porting C++ code on the 64-bit platform". Because of the challenges of using pointers, many modern high level computer languages (for example, Java or C#) do not permit direct access to memory using addresses. References
| ||