summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio/local.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-03-31 11:00:42 +0200
committerCorinna Vinschen <corinna@vinschen.de>2017-04-03 10:26:33 +0200
commitf70d9ae6adc6ed7952806056349ba9f8ba3c65c8 (patch)
tree7f7bf82f57459b1d13032c7d0c92194463b62e3c /newlib/libc/stdio/local.h
parent571c69656aad95df54a8c42e7b33f961a35dbef6 (diff)
downloadcygnal-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/stdio/local.h')
-rw-r--r--newlib/libc/stdio/local.h6
1 files changed, 3 insertions, 3 deletions
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 */