From f70d9ae6adc6ed7952806056349ba9f8ba3c65c8 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 31 Mar 2017 11:00:42 +0200 Subject: 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 --- newlib/libc/stdio/local.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'newlib/libc/stdio/local.h') diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h index 471442e26..5f6995501 100644 --- a/newlib/libc/stdio/local.h +++ b/newlib/libc/stdio/local.h @@ -306,7 +306,7 @@ _VOID _EXFUN(__sinit_lock_release,(_VOID)); /* Types used in positional argument support in vfprinf/vfwprintf. The implementation is char/wchar_t dependent but the class and state tables are only defined once in vfprintf.c. */ -typedef enum { +typedef enum __packed { ZERO, /* '0' */ DIGIT, /* '1-9' */ DOLLAR, /* '$' */ @@ -319,7 +319,7 @@ typedef enum { MAX_CH_CLASS /* place-holder */ } __CH_CLASS; -typedef enum { +typedef enum __packed { START, /* start */ SFLAG, /* seen a flag */ WDIG, /* seen digits in width area */ @@ -335,7 +335,7 @@ typedef enum { MAX_STATE, /* place-holder */ } __STATE; -typedef enum { +typedef enum __packed { NOOP, /* do nothing */ NUMBER, /* build a number from digits */ SKIPNUM, /* skip over digits */ -- cgit v1.2.3