Sign in to follow this  
Karpov2007

Issues of porting C++ code on the 64-bit platform

Recommended Posts

Our team is work on the subject of 64-bit developing. We write new article for 64-bit developers: 20 issues of porting C++ code on the 64-bit platform. See: 20 issues of porting C++ code on the 64-bit platform (PDF) We hope the article has been useful for you and will help to simplify the development and debugging of 64-bit applications. We will be glad to receive your opinions, remarks, corrections, additions and will surely include them in the next version of the article. Annotation. Program errors occurring while porting C++ code from 32-bit platforms on 64-bit ones are observed. Examples of the incorrect code and the ways to correct it are given. Methods and means of the code analysis which allow to diagnose the errors discussed, are listed. In the article you will learn about: * typical errors of programming which occur on 64-bit systems; * the reasons for appearing of these errors and the corresponding examples; * methods of correcting the listed errors; * the review of methods and means of searching errors in 64-bit programs. The given information will allow you: * to learn the differences between 32-bit and 64-bit systems; * to avoid errors while writing the code for 64-bit systems; * to speed up the process of migration of a 32-bit application on the 64-bit architecture with the help of the great reducing of the time of debugging and testing; * to forecast the time of porting the code on the 64-bit system more accurately and seriously. Article is observing the type errors which occur while porting programs on the 64-bit architecture. List of themes: * Off-warnings * Use of the functions with a variable number of arguments * Magic numbers * Storing of integers in double type * Bit shifting operations * Storing of pointer addresses. * Memsize types in unions * Change of an array type * Virtual functions with arguments of memsize type * Serialization and data exchange * Bit fields * Pointer address arithmetic * Arrays indexing * Mixed use of simple integer types and memsize types * Implicit type conversions while using functions * Overload functions * Data alignment * Exceptions * Explicit type conversions The diagnosis of the errors occurring while porting 32-bit programs on 64-bit systems is a difficult task. The port of a not very quality code written without taking into account peculiarities of other architectures, may demand a lot of time and efforts. We pay some attention to the description of methods and means which may simplify this task. ---- Viva64 team, www.Viva64.com

Share this post


Link to post
Share on other sites
Pretty nice stuff (to sum it up).


Your alignment seems a bit screwed up, though.

And it would be nice if you write something about 64bit file operations.
Like howto write 2gb in one ride. Howto jump >2gb.

Also, there are several standard functions that are non-standard in their 64-bit form.

Share this post


Link to post
Share on other sites
Your idea to write about "porting patterns" (in analogy to design patterns) is interesting. Maybe the layout needs some work (use LaTeX). Page numbers would also be nice.

You should split the article into two parts, a section of general issues (which would also account for porting from/to 8/16/32 bit) and a 32->64 bit specific section.

In section 1 (off-warnings) there are two lines with "32-bit system", but the second one is actually for 64 bit, right ? Also the description of the problem is somewhat short and vague.

You have other references than just internet-pages (which are usually not citeable) ?

Also, what happens to enumerations in 64 bit mode ? What problems can occur ?

Share this post


Link to post
Share on other sites
Quote:
Original post by nmi
In section 1 (off-warnings) there are two lines with "32-bit system", but the second one is actually for 64 bit, right ? Also the description of the problem is somewhat short and vague.

Yes. Thanks.

Quote:
Original post by nmi
You have other references than just internet-pages (which are usually not citeable) ?

Visit:
http://www.Viva64.com/links.php
http://www.viva64.com/articles.php

Quote:
Original post by nmi
Also, what happens to enumerations in 64 bit mode ? What problems can occur ?


Nothing. sizeof (enum) = 4 on 32/64 bit system(LP64, LLP64)
(I am possible has not understood a question.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this