Skip to content

Commit c025a23

Browse files
committed
Add definition of enum storage type
Some APIs use enum types in their definitions. The C specification does not define the size of the integer type used for storing and passing enum type variables. Provide a definition matching GCC's default behavior. Signed-off-by: Heinrich Schuchardt <[email protected]>
1 parent eb678d0 commit c025a23

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

riscv-elf.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,10 @@ A null pointer (for all types) has the value zero.
447447

448448
`_Float16` is as defined in the C ISO/IEC TS 18661-3 extension.
449449

450+
`enum` types use int as storage type if the value range fits into the value
451+
range of signed int or into the value range of unsigned int. If the value
452+
range is larger, they use long long as storage type.
453+
450454
`_Complex` types have the same layout as a struct containing two fields of the
451455
corresponding real type (`float`, `double`, or `long double`), with the first
452456
member holding the real part and the second member holding the imaginary part.

0 commit comments

Comments
 (0)