when is a GDC/D2/Phobos bug a GDC bug?

bearophile bearophileHUGS at lycos.com
Tue Nov 23 14:12:02 PST 2010


Daniel Gibson:

> Not necessary (at least for these problems), people just have to use size_t 
> instead of (u)int for indexes and such more consequently ;)

Elsewhere I have suggested to turn uint and size_t into two different types (like with a typedef):
http://d.puremagic.com/issues/show_bug.cgi?id=5063
But Walter has answered me:

> Code that compiles on 32 bits but fails to compile on 64 bits with an
> appropriate message is not much of a problem. Making size_t its own type rather
> than an alias brings along a whole host of other problems.
> 
> Besides, it is perfectly legitimate to use an int to index an array on 64 bits.

So a simple type system solution is not enough. I don't know what better solutions there are.

Bye,
bearophile


More information about the Digitalmars-d mailing list