summaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
authorLirong Yuan <yuanzi@google.com>2021-04-01 12:37:23 -0700
committerLirong Yuan <yuanzi@google.com>2021-05-03 09:44:51 -0700
commit578048167390ef4ea2b8d8b904ad42ccf8df98ef (patch)
tree0d92f2ca915f964264045e595f1304137533f745 /locale
parent9e72d1ac52e571b21cb5224a9a2fd11439e9bae7 (diff)
downloadglibc-578048167390ef4ea2b8d8b904ad42ccf8df98ef.tar.gz
locale: Align _nl_C_LC_CTYPE_class and _nl_C_LC_CTYPE_class32
Otherwise, programs that use character classification macros such as isspace may observe unaligned pointers.
Diffstat (limited to 'locale')
-rw-r--r--locale/C-ctype.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/locale/C-ctype.c b/locale/C-ctype.c
index 9397a1ec22..6a7b257853 100644
--- a/locale/C-ctype.c
+++ b/locale/C-ctype.c
@@ -18,6 +18,7 @@
#include "localeinfo.h"
#include <endian.h>
+#include <stdalign.h>
#include <stdint.h>
#include "C-translit.h"
@@ -30,7 +31,7 @@
In the `_nl_C_LC_CTYPE_class' array the value for EOF (== -1)
is set to always return 0 and the conversion arrays return EOF. */
-const char _nl_C_LC_CTYPE_class[768] attribute_hidden =
+alignas (uint16_t) const char _nl_C_LC_CTYPE_class[768] attribute_hidden =
/* 0x80 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
/* 0x86 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
/* 0x8c */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
@@ -96,7 +97,7 @@ const char _nl_C_LC_CTYPE_class[768] attribute_hidden =
/* 0xf4 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
/* 0xfa */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
;
-const char _nl_C_LC_CTYPE_class32[1024] attribute_hidden =
+alignas (uint32_t) const char _nl_C_LC_CTYPE_class32[1024] attribute_hidden =
/* 0x00 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
/* 0x03 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
/* 0x06 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"