Consider a char or bool used in an arithmetic expression. Although both are integer types, neither is used directly for arithmetic: each narrow integer type is promoted first, typically to signed int with the same value. section 5.2
The rule has three important consequences:
- Promotion occurs before arithmetic and comparison. section 5.2
- The promoted value is usually a signed int, regardless of whether the narrow type was signed. section 5.2
- The exact widths and ranges of the wider types remain implementation-defined, so platform assumptions require care. section 5.2
Table 5.1. Base types according to the four main type classes. Types with a gray background don’t allow for arithmetic; they are promoted before doing arithmetic. Type char is special since it can be unsigned or signed, depending on the platform. All types in this table are considered to be distinct types, even if they have the same class and precision. (view table figure)
| Class |
Systematic name |
Other name |
Rank |
|
|---|---|---|---|---|
| Integers | Unsigned | _Bool | bool | 0 |
| unsigned char | 1 | |||
| unsigned short | 2 | |||
| unsigned int | unsigned | 3 | ||
| unsigned long | 4 | |||
| unsigned long long | 5 | |||
| [Un]signed | char | 1 | ||
| signed char | 1 | |||
| signed short | short | 2 | ||
| Signed | signed int | signed or int | 3 | |
| signed long | long | 4 | ||
| signed long long | long long | 5 | ||
| Floating point | Real | float | ||
| double | ||||
| long double | ||||
| Complex | float _Complex | float complex | ||
| double _Complex | double complex | |||
| long double _Complex | long double complex | |||
Use the base-type table to distinguish narrow types, such as bool, unsigned char, and short, from unpromoted integer types. section 5.2

