diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-03-31 11:00:42 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2017-04-03 10:26:33 +0200 |
commit | f70d9ae6adc6ed7952806056349ba9f8ba3c65c8 (patch) | |
tree | 7f7bf82f57459b1d13032c7d0c92194463b62e3c /newlib/libc/stdlib/mbtowc_r.c | |
parent | 571c69656aad95df54a8c42e7b33f961a35dbef6 (diff) | |
download | cygnal-f70d9ae6adc6ed7952806056349ba9f8ba3c65c8.tar.gz cygnal-f70d9ae6adc6ed7952806056349ba9f8ba3c65c8.tar.bz2 cygnal-f70d9ae6adc6ed7952806056349ba9f8ba3c65c8.zip |
Use enum __packed in favour of -fshort-enums
Some architectures like ARM encode the short enum option state in the
object file and the linker checks that this option is consistent for all
objects of an executable. In case applications use -fno-short-enums,
then this leads to linker warnings. Use the enum __packed attribute for
the relevent enums to avoid the -fshort-enums compiler option. This
attribute is at least available on GCC, LLVM/clang and the Intel
compiler.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Diffstat (limited to 'newlib/libc/stdlib/mbtowc_r.c')
-rw-r--r-- | newlib/libc/stdlib/mbtowc_r.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/newlib/libc/stdlib/mbtowc_r.c b/newlib/libc/stdlib/mbtowc_r.c index 116b4d82f..9d782566f 100644 --- a/newlib/libc/stdlib/mbtowc_r.c +++ b/newlib/libc/stdlib/mbtowc_r.c @@ -55,11 +55,11 @@ _DEFUN (__ascii_mbtowc, (r, pwc, s, n, state), } #ifdef _MB_CAPABLE -typedef enum { ESCAPE, DOLLAR, BRACKET, AT, B, J, +typedef enum __packed { ESCAPE, DOLLAR, BRACKET, AT, B, J, NUL, JIS_CHAR, OTHER, JIS_C_NUM } JIS_CHAR_TYPE; -typedef enum { ASCII, JIS, A_ESC, A_ESC_DL, JIS_1, J_ESC, J_ESC_BR, +typedef enum __packed { ASCII, JIS, A_ESC, A_ESC_DL, JIS_1, J_ESC, J_ESC_BR, INV, JIS_S_NUM } JIS_STATE; -typedef enum { COPY_A, COPY_J1, COPY_J2, MAKE_A, NOOP, EMPTY, ERROR } JIS_ACTION; +typedef enum __packed { COPY_A, COPY_J1, COPY_J2, MAKE_A, NOOP, EMPTY, ERROR } JIS_ACTION; /************************************************************************************** * state/action tables for processing JIS encoding |