Of course, it was not the first stage of digit capacity change. That’s enough to recollect the transition from 16-bit systems to 32-bit. It’s natural that the acquired experience had a good influence on the stage of migration to 64-bit systems.
But the migrate to 64-bit systems had it’s own peculiarities in the result of which there appeared a number of investigations and publications on these problems, for example [5, 6, 7].
The mistakes of the following kinds were pointed out by the authors of those times:
- Packing of pointers in the types of a smaller digit capacity. For example, placing the pointer into int type in the system with LP64 database will result in truncation the pointer value and impossibility to use it further on.
- Using magic numbers. The danger consists in using such numbers as 4, 32, 0x80000000 and some others instead of special constants or using the sizeof() operator.
- Some shift operations that do not take into account the increase of digit capacity of a number of types.
- Using incorrect unions or structures not taking into account the alignment on different systems with different digit capacity.
- Mistakes of the work with bit fields.
- Some arithmetic expressions. Example:
int x = 100000, y = 100000, z = 100000; long long s = x * y * x; |
Some other more rare mistakes were also considered, but the main ones are mentioned in the list.
On the ground of the investigation of the question of verification of 64-bit code some solutions were offered that provide the diagnostics of dangerous constructions. For example, such verification was realized in Gimpel Software PC-Lint (http://www.gimpel.com) and Parasoft C++test (http://www.parasoft.com) static analyzers.
The question arouses: if 64-bit systems exist for such a long time, as well as article devoted to this problem, and even program tools that provide the control of dangerous constructions in the code, why should we get back to this question?
Unfortunately, yes, we should. The reason is the program that has taken place during these years in the sphere of informational technologies. And the urgency of this question is connected with fast spreading of 64-bit versions of OS Windows.
The existing informational support and tools in the field of 64-bit technologies development went out of date and need fundamental reprocessing. But you will object, saying that there are many modern articles (2005-2007) in the Internet devoted to the problems of 64-bit applications development in C/C++ language. Unfortunately, they turn out to be no more than retelling older articles concerning new 64-bit Windows version without taking into consideration its specific character and the changes in the technology.
Comments