In article <> Keith Thompson <kst-> writes:
> "Dik T. Winter" <> writes:
> > In article <. com>
> > "user923005" <> writes:
> [snip]
> > > How about where sizeof int is not evenly divisible by sizeof char?
> > > CDC Cyber UTexas C compiler
> [snip]
> > That is possible (but gives problems with floats that are also 60 bits).
> > But on those machines it is much more reasonable to have 48 bit ints
> > with the remaining 16 bits (possible) garbage. But integer arithmetic
> > on those machines had quite a few strange points. That is, I could
> > easily construct examples where:
> > (a + a) * 2 != a + a + a + a
> > in integer arithmetic, even when a < 2**48.
>
> I'm having trouble imagining that that's anything other than WRONG
> (assuming there's no overflow).
If the compiler tells you an int is 60 bits, there is no overflow, and
it is indeed wrong. If the copiler tells you an int is 48 bits, there
is overflow, and it is not wrong. So it is much more reasonable to tell
that ints are 48 bits. (The reason behind it is that the multiply
instruction used also serves as instruction to calculate the second half
of the product of two floating point numbers. When what is done depends
on the actual operands.)
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland;
http://www.cwi.nl/~dik/