Could we agree to disagree and come together on improvements andclean-up?
vincent at vinc17.org
Sun Jun 1 11:26:39 CEST 2008
On 2008-05-31 17:11:59 +0200, Jan Wielemaker wrote:
> Hopefully without starting another flamewar, let us conclude there is
> only one party to blame. If any other (read smaller) party would have
> done this, they would have been completely ignored by developers. And
> completely right. When I learned C, the biggest int was a long and long
> always fitted pointers (yes, I've seen 8,16,32 and 64 bits).
AFAIK, the C standard has never required this (BTW, even if a pointer
size is not larger than the size of a long, the pointer-to-integer
conversion is implementation-defined and possibly undefined, so that
you can't deduce anything about it in portable code).
> Breaking this, certainly in the light that 32-bits are getting small
> as a general purpose integer, is unforgivable.
No, a code based on such an undefined behavior and meant to work on
any C implementation (e.g. a future implementation) is buggy, just
like code that assumes that signed integer arithmetic and pointer
arithmetic is done modulo 2^(size of the data type).
Note: Other people could complain that old implementations had a long
that was always 32-bit and breaking that would be unforgivable. So,
to make everyone happy, integer types larger than 32 bits would not
have been possible.
Vincent Lefèvre <vincent at vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
More information about the gmp-discuss