'int' is enough for 'length' to migrate code from x86 to x64
H. S. Teoh via Digitalmars-d
digitalmars-d at puremagic.com
Thu Nov 20 07:53:18 PST 2014
On Thu, Nov 20, 2014 at 11:22:00AM -0300, Ary Borenszweig via Digitalmars-d wrote:
> On 11/20/14, 5:02 AM, Walter Bright wrote:
[...]
> >As for me personally, I like having a complete set of signed and
> >unsigned integral types at my disposal. It's like having a full set
> >of wrenches that are open end on one end and boxed on the other :-)
> >Most of the time either end will work, but sometimes only one will.
> >
> >Now, if D were a non-systems language like Basic, Go or Java,
> >unsigned types could be reasonably dispensed with. But D is a systems
> >programming language, and it ought to have available types that match
> >what the hardware supports.
> >
>
> Nobody is saying to remove unsigned types from the language. They have
> their uses. It's just that using them for an array's length leads to
> subtle bugs. That's all.
Using unsigned types for array length doesn't necessarily lead to subtle
bugs, if the language was stricter about mixing signed and unsigned
values.
T
--
Recently, our IT department hired a bug-fix engineer. He used to work for Volkswagen.
More information about the Digitalmars-d
mailing list