2 ms·
> because you can never know for sure whether those types are "smaller than int" and thus get promoted to signed types when you do any arithmetic You can deduc
by wahern 7y ago
> because you can never know for sure whether those types are "smaller than int" and thus get promoted to signed types when you do any arithmetic
You can deduce the width (number of sign + value bits) of the standard integer types from their limits (e.g. INT_MAX, INT_MIN, etc). The problem has been that this is non-trivial if not impossible to do from the preprocessor. The next C standard will include width constants (e.g. INT_WIDTH) for the standard integer types.