www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Phobos not 64bit aware

reply Benjamin Herr <ben 0x539.de> writes:
Hello, D.

I am rather certain that Walter is aware that phobos is not currently 
portable to 64bit architectures. (For example, internal/gc/gc.d does 
often assume that uint.sizeof == void*.sizeof == ulong.sizeof/2 == 32 
bit, which is not true on some architectures that I would like to see D 
be usable on.)

I assume this issue is not a priority and likely will not receive any 
attention before the 1.0 release is out, but I would like to ask how 
deeply such assumptions are embedded in dmd and the low-level parts of 
phobos, and perhaps to get an estimate when they will be adressed.


Thanks,
   -ben
Feb 02 2005
parent reply "Unknown W. Brackets" <unknown simplemachines.org> writes:
I may be wrong, but I remember the spec being fairly clear that a uint 
is a uint is a uint - on 64 bit architectures... it's the same size as 
on 32 bit ones.

Please see:
http://www.digitalmars.com/d/type.html

Forgive me if I'm mistaken.

-[Unknown]

 I am rather certain that Walter is aware that phobos is not currently 
 portable to 64bit architectures. (For example, internal/gc/gc.d does 
 often assume that uint.sizeof == void*.sizeof == ulong.sizeof/2 == 32 
 bit, which is not true on some architectures that I would like to see D 
 be usable on.)
Feb 02 2005
parent reply Thomas Kuehne <thomas-dloop kuehne.THISISSPAM.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

|> I am rather certain that Walter is aware that phobos is not currently
|> portable to 64bit architectures. (For example, internal/gc/gc.d does
|> often assume that uint.sizeof == void*.sizeof == ulong.sizeof/2 == 32
|> bit, which is not true on some architectures that I would like to see
|> D be usable on.)

| I may be wrong, but I remember the spec being fairly clear that a uint
| is a uint is a uint - on 64 bit architectures... it's the same size as
| on 32 bit ones.

The trouble is: void*.sizeof == uint.sizeof
And I am sure that uint is quite often used instead of the correct size_t.

Thomas
-----BEGIN PGP SIGNATURE-----

iD8DBQFCAcj13w+/yD4P9tIRAq8BAKDOhGz/2r6CnZBABBzhSbBN1FCKSwCgplot
TKiUn+TVYBVh8mOFan7mUTU=
=J8+y
-----END PGP SIGNATURE-----
Feb 02 2005
parent "Unknown W. Brackets" <unknown simplemachines.org> writes:
My mistake.  I saw uint and ulong but I fear I read it a bit too quickly.

-[Unknown]


 The trouble is: void*.sizeof == uint.sizeof
 And I am sure that uint is quite often used instead of the correct size_t.
 
 Thomas
Feb 02 2005