64 bit linux on Intel T9600
James Knott
james.knott-bJEeYj9oJeDQT0dZR+AlfA at public.gmane.org
Sat Jun 20 11:45:04 UTC 2009
Lennart Sorensen wrote:
> On Fri, Jun 19, 2009 at 02:39:18PM -0400, D. Hugh Redelmeier wrote:
>
>> I like architectural diversity. It can be used to help C programmers
>> (like me) discover where they've written unportable code. ("all the
>> world's a VAX" disease). Unfortunately the x86-64 ABI panders to this
>> disease (evidence: sizeof(int) == 4!).
>>
>
> How is that a problem? As long as size(long) == 8 on a 64bit machine,
> then you should be happy. Windows unfortunately does NOT do that.
> They have a special long type for storing pointer size things on 64bt
> systems.
>
> After all, short int and int just have to be at least 16bit, and long
> has to be at least 32bit. long long has to be at least 64bit if it is
> even supported on a system. Linux seems to have decided to make it:
> short is 16bit
> int is 32bit
> long is equal in size to pointers (so 32 or 64bit depending on cpu)
> long long is 64bit
>
Many years ago, I took a C programming course. In class, we used
Borland's Turbo C++ on DOS. At home, I used Borland C++ for OS/2. I
occasionally got bitten by the difference in "int" length, which was 16
bits in Turbo C++ and 32 on Borland C++. My code would work fine at
home, but bomb out in class because I'd overflow some variable.
--
The Toronto Linux Users Group. Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
More information about the Legacy
mailing list