SPRAC71B February 2019 – October 2023
Integral values use twos-complement representation. Floating-point values are represented using IEEE 754.1 representation. Floating-point operations follow IEEE 754.1 to the degree supported by the hardware.
Table 2-1 gives the size and alignment of C data types in bits.
Type | Generic Name | Size | Alignment |
---|---|---|---|
signed char | schar | 16 | 16 |
unsigned char | uchar | 16 | 16 |
char | plain char | 16 | 16 |
bool (C99) | uchar | 16 | 16 |
_Bool (C99) | uchar | 16 | 16 |
bool (C++) | uchar | 16 | 16 |
short, signed short | int16 | 16 | 16 |
unsigned short | uint16 | 16 | 16 |
int, signed int | int16 | 16 | 16 |
unsigned int | uint16 | 16 | 16 |
long , signed long | int32 | 32 | 32 |
unsigned long | uint32 | 32 | 32 |
long long, signed long long | int64 | 64 | 32 |
unsigned long long | uint64 | 64 | 32 |
enum | -- | varies (see Section 2.9) | 32 |
float | float32 | 32 | 32 |
double | float64 | 64 | 32 |
long double | float64 | 64 | 32 |
pointer | -- | 32 | 16 |
Generic names in the table are used in this specification to identify types in a language-independent way.
The char type is unsigned by default. This is in contrast to the "signed char" and "unsigned char" types, which specify their sign behavior.
The integral types have complementary unsigned variants. The generic names are prefixed with 'u' (e.g. uint32).
The type bool uses the value 0 to represent false and 1 to represent true. Other values are undefined.
The additional types from C, C99 and C++ are defined as synonyms for standard types:
typedef unsigned long wchar_t;
typedef unsigned long wint_t;
typedef char * va_list;