|
From: Roger H. <rog...@mi...> - 2007-05-25 12:14:04
|
On 24 May, 2007, at 19:41, James Walker wrote: > > OK, I'm convinced now. There are only a few enumerations containing > negative values: TQ3CSGObjectID, TQ3RaveVendorID, TQ3RaveEngineID, > TQ3Error, TQ3Warning, TQ3Notice. I'll fix them, though SourceForge > CVS > is broken at the moment. Good, they're the ones I had too. > > Incidentally, it is not clear to me whether Xcode is in compliance > with > the standard. The relevant sentence is: "It is implementation-defined > which integral type is used as the underlying type for an enumeration > except that the underlying type shall not be larger than int unless > the > value of an enumerator cannot fit in an int or unsigned int." Each > enumerator of TQ3CSGObjectID can fit into an int or unsigned int, but > you can't pick just one of int and unsigned int and fit every > enumerator > of TQ3CSGObjectID into it. Yes I see what you mean, the specifiers may have had just this situation in mind. However, long term I suspect int will become the same size as a pointer when most developers start to go to 64 bit addressing. As I got to C/C++ via Apple Pascal (earlier Fortran IV, Algol 60, BCPL and Coral 66 and a few others along the way as well as assembly and raw machine code), I have not used int much anyway, just char, short and long. I've also used word lengths of 36, 60, 24, 18, 48, 8, 16, 32 and soon 64 bits, and bytes of 9, 3 and 8 bits, as well as 2's complement, 1's complement, decimal and sterling (pounds shillings and pence) arithmetic and three or four measurement systems (Imperial, Centimeters/Grams/Second, modern Systeme International (SI) units as well as some US units), so I'm quite flexible. Roger |