Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 01 Aug 2008 15:06:08 +0100
From:      Dieter <freebsd@sopwith.solgatos.com>
To:        freebsd-amd64@freebsd.org
Subject:   Re: app programming on freebsd amd64 
Message-ID:  <200808012206.WAA24853@sopwith.solgatos.com>
In-Reply-To: Your message of "Fri, 01 Aug 2008 12:57:43 EDT." <48934087.2070407@telenix.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> I spent some enjoyable
> hours last night working out the 64 bit problems with my project, I have a fair
> chance of working it all out later on today (I hope).  Thanks for the help.

Assuming this is in C, the main things are to use function prototypes
(turn on the compiler warnings and fix anything it whines about),
and remember that on 32 bit int, long and pointer are all 32 bit (ILP32)
while on 64 bit ints remain 32 bit, long and pointer are 64 bit (LP64).
If you're porting someone else's code, they might assume that an int
can hold a long or pointer.  The compiler can catch most of the stuff
that causes problems, if people would bother to fix the stuff it warns
about.

This isn't rocket science, yet there is a lot of code out there that
assumes all the world is ILP32.  Not just code from 25 years ago,
but recent code as well.  Don't they teach portability in school?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808012206.WAA24853>