Allow char bit-fields

These are not required to be supported (only int, signed int, and
unsigned int are required), but most compilers support it.

https://port70.net/~nsz/c/c89/c89-draft.html#3.5.2.1
https://port70.net/~nsz/c/c89/c89-draft.html#A.6.5.8

For consistency with other integral types, plain `char` bit-fields
are unsigned, regardless of the `--signed-chars` option.

Fixes #1047
This commit is contained in:
Jesse Rosenstock
2020-08-30 20:47:25 +02:00
committed by Oliver Schmidt
parent 41cee0eb44
commit 4e4e4c2d21
6 changed files with 401 additions and 5 deletions

View File

@@ -807,6 +807,11 @@ This cc65 version has some extensions to the ISO C standard.
<tt/_Static_assert/ is also available as the macro <tt/static_assert/ in
<tt/assert.h/.
<item> cc65 supports bit-fields of any integral type that is int-sized or
smaller, and enumerated types with those types as their underlying
type. (Only <tt/int/, <tt/signed int/, and <tt/unsigned int/ are
required.)
<item> Computed gotos, a GCC extension, has limited support. With it you can
use fast jump tables from C. You can take the address of a label with
a double ampersand, putting them in a static const array of type void *.