
David Abrahams writes:
Aristid Breitkreuz <aribrei@arcor.de> writes:
You can't assume short is 16-bits (but that's more or less academic).
Academic or no, I'd love to hear your reasoning on that one.
The standard is clear that short must be /at least/ 16 bits, but you certainly can't assume that the following assert will not fire: unsigned short i = 32768; i *= 2; assert( i == 0 ); In practise, except on esoteric embedded DSPs where sizeof(almost anything) is 1 and char is 32 bits, I can't imagine that assert firing any time in the next 20 years (In 20 years time, I expect 128 bit platforms to appear, and short *might* start meaning /32 bits/). -- Martin Bonner Martin.Bonner@Pitechnology.com Pi Technology, Milton Hall, Ely Road, Milton, Cambridge, CB4 6WZ, ENGLAND Tel: +44 (0)1223 203894