Re: Integers on 64-bit machines

Marco van de Voort <marcov@stack.nl>
Fri, 6 Jul 2007 05:45:21 +0000 (UTC)

          From comp.compilers

Related articles
[3 earlier articles]
Re: Integers on 64-bit machines emailamit@gmail.com (Amit Gupta) (2007-07-05)
Re: Integers on 64-bit machines DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-07-05)
Re: Integers on 64-bit machines anton@mips.complang.tuwien.ac.at (2007-07-05)
Re: Integers on 64-bit machines mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2007-07-05)
Re: Integers on 64-bit machines gah@ugcs.caltech.edu (glen herrmannsfeldt) (2007-07-05)
Re: Integers on 64-bit machines bobduff@shell01.TheWorld.com (Robert A Duff) (2007-07-05)
Re: Integers on 64-bit machines marcov@stack.nl (Marco van de Voort) (2007-07-06)
Re: Integers on 64-bit machines DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-07-06)
Re: Integers on 64-bit machines DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-07-06)
Re: Integers on 64-bit machines DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-07-06)
Re: Integers on 64-bit machines anton@mips.complang.tuwien.ac.at (2007-07-06)
Re: Integers on 64-bit machines marcov@stack.nl (Marco van de Voort) (2007-07-08)
Re: Integers on 64-bit machines cfc@shell01.TheWorld.com (Chris F Clark) (2007-07-08)
[12 later articles]
| List of all articles for this month |
From: Marco van de Voort <marcov@stack.nl>
Newsgroups: comp.compilers
Date: Fri, 6 Jul 2007 05:45:21 +0000 (UTC)
Organization: Stack Usenet News Service
References: 07-07-007 07-07-021
Keywords: C, arithmetic
Posted-Date: 06 Jul 2007 01:50:48 EDT

On 2007-07-05, Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
> For a C-like language (i.e., where integers have some connection to
> pointers, e.g., pointer arithmetic), the main integer type should have
> the same size as a pointer; for your 64-bit machines, it should be 64
> bits.


In C, integers have no connection to pointers, long has. However the
current situation of multiple models in use for 64-bit architectures
probably has to do with code that doesn't follow the exact guidelines.


> As for having a zoo of integer types like C, that's a bad idea in my
> experience. It causes lots of portability bugs; in contrast, in Forth
> there's one dominant integer type, the cell, which can also contain an
> address; in Forth portability bugs between 32-bit and 64-bit systems,
> and between different byte orders are very rare.


You need a range of fixed types ints anyway to be able to define a
structure that maps (at least nearly) any external structure, so that
you can communicate without marshalling.


[Jeez, I thought we got away from the abomination of pointers that are
longer than ints when we left the 286 large mode. No such luck, huh? -John]



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.