Can I port code to a 64-bit platform under a 32-bit platform?

Andrey Karpov
Articles: 552

Yes, you can do this if you use a cross-compiler that creates a native code for a platform different from that on which your code is executed.

For Visual C++, for example, you can use X86_amd64 and X86_IA64 cross-compilers included into the Windows SDK pack to create 64-bit binary files in a 32-bit Windows.

Remember that mere recompilation (even if you checked all the compiler warnings) is usually not enough for correct port of a real project to another platform. A code that has been working correctly on the initial platform may become incorrect after being recompiled for another platform.

Detection of porting errors should be started at the stage of code editing/recompilation already - it is possible if you use the static analysis methodology, for example. It will allow you to carry out the initial project migration stage using the cross-compiler without launching the program on the target platform.

References



Use PVS-Studio to search for bugs in C, C++, C# and Java

We offer you to check your project code with PVS-Studio. Just one bug found in the project will show you the benefits of the static code analysis methodology better than a dozen of the articles.

goto PVS-Studio;

Andrey Karpov
Articles: 552


Bugs Found

Checked Projects
412
Collected Errors
14 132
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site. Learn More →
Accept