[NTLUG:Discuss] Need some inputs on porting.

Steve Baker sjbaker1 at airmail.net
Tue Sep 30 08:03:53 CDT 2003


Vaidya, Harshal (Cognizant) wrote:

> If you have anything else to say about this. It is most welcome.

You'll find out more in the first 24 hours of actually trying to
do this than you'll find out here.   I strongly suggest spending
a *little* effort just seeing what happens when you type 'make' before
you launch into major planning of effort levels.

gcc 3.3 is more picky than most C++ compilers I've worked with.
Some of the things it warns about are just annoying (eg: File does
not end with a blank line) - some found bugs in our code that we
never knew we had.

Going from 32 to 64 bits should be a zero risk activity if your
code is well written to start with.  However, if your code assumes
that a pointer fits into an integer - or switches between 'long' and
'int' all over the place - then you'll be in deep trouble.

Going from Solaris to Linux is also easy if you are already using
autoconf/automake tools - but harder if not. You may have a fair
amount of Makefile tweaking to do.

If you are writing binary structures to disk or to the network then
your data won't (in general) port between machines because structure
padding is likely to be different between compilers and between CPU's.

Porting programs like this is very likely to show up bugs that were
always there - but you just never noticed before.  That's a good thing,
but it can be frustrating.  When your program works under Solaris but
crashes under Linux - you spend a lot of time wondering whether
there is a bug in some library - or in the compiler - or in the OS...
only to discover that the bug is actually in your application - but
through some amazing series of coincidences just manages not to notice
the bug on the old platform.  "How the heck did this program ever
work?" is a common thing to hear while porting!

So - the short answer is that nobody can predict how hard this will
be because it mostly depends on the quality of the code that you are
porting.

---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1 at airmail.net>    WorkEmail: <sjbaker at link.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net    http://tuxaqfh.sf.net
            http://tuxkart.sf.net http://prettypoly.sf.net
-----BEGIN GEEK CODE BLOCK-----
GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M-
V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++
-----END GEEK CODE BLOCK-----




More information about the Discuss mailing list