public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/google/grte/v5-2.27/master] locale: Align _nl_C_LC_CTYPE_class and _nl_C_LC_CTYPE_class32
@ 2021-08-28 0:38 Fangrui Song
0 siblings, 0 replies; 2+ messages in thread
From: Fangrui Song @ 2021-08-28 0:38 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5e46b24985ea66f379add529b27c1e7e54395183
commit 5e46b24985ea66f379add529b27c1e7e54395183
Author: Lirong Yuan <yuanzi@google.com>
Date: Thu Apr 1 12:37:23 2021 -0700
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.
Diff:
---
locale/C-ctype.c | 5 +++--
1 file 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"
^ permalink raw reply [flat|nested] 2+ messages in thread
* [glibc/google/grte/v5-2.27/master] locale: Align _nl_C_LC_CTYPE_class and _nl_C_LC_CTYPE_class32
@ 2021-05-03 17:04 Lirong Yuan
0 siblings, 0 replies; 2+ messages in thread
From: Lirong Yuan @ 2021-05-03 17:04 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=578048167390ef4ea2b8d8b904ad42ccf8df98ef
commit 578048167390ef4ea2b8d8b904ad42ccf8df98ef
Author: Lirong Yuan <yuanzi@google.com>
Date: Thu Apr 1 12:37:23 2021 -0700
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.
Diff:
---
locale/C-ctype.c | 5 +++--
1 file 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"
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-28 0:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28 0:38 [glibc/google/grte/v5-2.27/master] locale: Align _nl_C_LC_CTYPE_class and _nl_C_LC_CTYPE_class32 Fangrui Song
-- strict thread matches above, loose matches on Subject: below --
2021-05-03 17:04 Lirong Yuan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).