Part 26. Peculiarities of creating installers for the 64-bit environment

When developing the 64-bit version of an application, you should also be very attentive to the issue of program distribution – you might encounter some peculiar problems when installing the program on a 64-bit operating system, and if you forget about them, you will get a non-working installation package. First of all you should understand that the program installer itself (the exe-file that launches the installation process) can technically be either a 32-bit application or a 64-bit one. Continue reading

Part 25. Optimization of 64-bit programs

Reducing amounts of memory being consumed

When a program is compiled in the 64-bit mode, it starts consuming more memory than its 32-bit version. This increase often stays unnoticed, but sometimes memory consumption may grow twice. The growth of memory consumption is determined by the following factors: Continue reading

PVS-Studio Delved into Linux Kernel (3.18.1)

Our team decided to analyze the Linux kernel with our static code analyzer. The difficulty of this task makes it especially interesting. Linux source code has been checked, and is still checked, by a number of different tools. So, finding anything new was hardly probable. Still, we managed to find quite a number of bugs.

linux-kernel Continue reading

Checking Qt 5 Framework

Static code analysis tools can help developers eliminate numbers of bugs as early as at the coding stage. With their help you can, for example, quickly catch and fix any typos. Well, some programmers are sincerely sure they never make typos and silly mistakes. But they are wrong; everyone makes mistakes. This article is a good evidence of that. Typos can be found even in high-quality and well tested projects such as Qt.

image1 Continue reading

Part 24. Phantom errors

We have finished studying the patterns of 64-bit errors and the last thing we will speak about, concerning these errors, is in what ways they may occur in programs.

The point is that it is not so easy to show you by an example, as in the following code sample, that the 64-bit code will cause an error when “N” takes large values: Continue reading

Part 22. Pattern 14. Overloaded functions

When porting a 32-bit program to a 64-bit platform, you may encounter changes in its logic related to the use of overloaded functions. If a function is overlapped for 32-bit and 64-bit values, the access to it with an argument of a memsize-type will be translated into different calls on different systems. This technique may be useful as, for example, in this code: Continue reading

Why using finalizers is a bad idea

Not so long ago we worked on a diagnostic rule related to the finalizer check. This provoked an argument on the details of the garbage collector work and the finalization of objects. Although we have been programming in C# for more than 5 years, we haven’t achieved any consensus as regards this question, so I decided to study it more thoroughly.

image1 Continue reading