Thread overview
[Issue 13658] Array length type is not size_t
Oct 27, 2014
Sobirari Muhomori
Oct 27, 2014
Mike Parker
Oct 27, 2014
Sobirari Muhomori
Oct 27, 2014
Mike Parker
October 27, 2014
https://issues.dlang.org/show_bug.cgi?id=13658

--- Comment #1 from Sobirari Muhomori <dfj1esp02@sneakemail.com> ---
size_t is not always ulong, it's uint in 32-bit mode and ulong in 64-bit mode.

--
October 27, 2014
https://issues.dlang.org/show_bug.cgi?id=13658

Mike Parker <aldacron@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |aldacron@gmail.com
         Resolution|---                         |INVALID

--- Comment #2 from Mike Parker <aldacron@gmail.com> ---
This comes from D's compatibility with C. size_t does not have a predefined type size (in the C99 standard it is defined as an unsigned integer of at least 16 bytes in size). What you find on modern compilers is that it will be 32-bits on 32-bit platforms and 64-bits on 64-bit platforms. So in D it is an alias for uint on 32-bit and ulong on 64.

--
October 27, 2014
https://issues.dlang.org/show_bug.cgi?id=13658

--- Comment #3 from Sobirari Muhomori <dfj1esp02@sneakemail.com> ---
(In reply to Mark Isaacson from comment #0)
> For reference, the precise line of code that breaks: https://github.com/facebook/flint/blob/master/Checks.d#L3016

size_t[] specialTokenHead = [];
size_t[] lhsExprHead = [0];

--
October 27, 2014
https://issues.dlang.org/show_bug.cgi?id=13658

--- Comment #4 from Steven Schveighoffer <schveiguy@yahoo.com> ---
(In reply to Mike Parker from comment #2)
> (in the C99 standard it is defined as an unsigned integer of at
> least 16 bytes in size).

bit, byte, same thing pretty much ;)

--
October 27, 2014
https://issues.dlang.org/show_bug.cgi?id=13658

--- Comment #5 from Mike Parker <aldacron@gmail.com> ---
(In reply to Steven Schveighoffer from comment #4)
> (In reply to Mike Parker from comment #2)
> > (in the C99 standard it is defined as an unsigned integer of at
> > least 16 bytes in size).
> 
> bit, byte, same thing pretty much ;)

Yeah, yeah. You say potato... :)

--