diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2018-03-14 10:36:34 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2018-03-14 11:38:24 +0100 |
commit | 134f93f313db95c394b925716717031a05b2a6d3 (patch) | |
tree | 30d77a10c28dfd58f23d370dbb08086fad06bb2b | |
parent | edcf783dc2fc89f32a29443ceb5a362d0ee6910c (diff) | |
download | cygnal-134f93f313db95c394b925716717031a05b2a6d3.tar.gz cygnal-134f93f313db95c394b925716717031a05b2a6d3.tar.bz2 cygnal-134f93f313db95c394b925716717031a05b2a6d3.zip |
ctype: align size of category bit fields to small targets needs
E.g. arm ABI requires -fshort-enums for bare-metal toolchains.
Given there are only 29 category enums, the compiler chooses an
8 bit enum type, so a size of 11 bits for the bitfield leads to
a compile time error:
error: width of 'cat' exceeds its type
enum category cat: 11;
^~~
Fix this by aligning the size of the category members to byte
borders.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r-- | newlib/libc/ctype/categories.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/newlib/libc/ctype/categories.c b/newlib/libc/ctype/categories.c index db285d7a5..c237324ec 100644 --- a/newlib/libc/ctype/categories.c +++ b/newlib/libc/ctype/categories.c @@ -2,8 +2,8 @@ #include "categories.h" struct _category { - enum category cat: 11; - unsigned int first: 21; + enum category cat: 8; + unsigned int first: 24; unsigned short delta; } __attribute__((packed)); |