aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2014-12-12 17:51:03 -0800
committerPaul Eggert2014-12-12 17:54:02 -0800
commit7fc616afcfbaebea1658149da269110da94d6e59 (patch)
treefdf883b06477996b4705ebe64fa08795fa3e9715
parent67a48edb27172ae78182b13edf18789c2c79b7ac (diff)
downloademacs-7fc616afcfbaebea1658149da269110da94d6e59.tar.gz
emacs-7fc616afcfbaebea1658149da269110da94d6e59.zip
Replace union hack with C11-style max_align_t
* admin/merge-gnulib (GNULIB_MODULES): Add stddef, for max_align_t. * lib/gnulib.mk: Regenerate. * src/alloc.c (XMALLOC_BASE_ALIGNMENT): Use max_align_t instead of a hack involving a union.
-rw-r--r--ChangeLog8
-rwxr-xr-xadmin/merge-gnulib2
-rw-r--r--lib/gnulib.mk2
-rw-r--r--src/alloc.c3
4 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 9d9aea676c4..85edd9faf18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
12014-12-13 Paul Eggert <eggert@cs.ucla.edu>
2
3 Replace union hack with C11-style max_align_t
4 * admin/merge-gnulib (GNULIB_MODULES): Add stddef, for max_align_t.
5 * lib/gnulib.mk: Regenerate.
6 * src/alloc.c (XMALLOC_BASE_ALIGNMENT): Use max_align_t instead of
7 a hack involving a union.
8
12014-12-12 Paul Eggert <eggert@cs.ucla.edu> 92014-12-12 Paul Eggert <eggert@cs.ucla.edu>
2 10
3 Git ignore lib/std*.h 11 Git ignore lib/std*.h
diff --git a/admin/merge-gnulib b/admin/merge-gnulib
index dc3cd6cf541..64514f79bdd 100755
--- a/admin/merge-gnulib
+++ b/admin/merge-gnulib
@@ -35,7 +35,7 @@ GNULIB_MODULES='
35 intprops largefile lstat 35 intprops largefile lstat
36 manywarnings memrchr mkostemp mktime 36 manywarnings memrchr mkostemp mktime
37 pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat 37 pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat
38 sig2str socklen stat-time stdalign stdio 38 sig2str socklen stat-time stdalign stddef stdio
39 strftime strtoimax strtoumax symlink sys_stat 39 strftime strtoimax strtoumax symlink sys_stat
40 sys_time time time_r timer-time timespec-add timespec-sub 40 sys_time time time_r timer-time timespec-add timespec-sub
41 unsetenv update-copyright utimens 41 unsetenv update-copyright utimens
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index c54b8117842..740ebb1e96c 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -21,7 +21,7 @@
21# the same distribution terms as the rest of that program. 21# the same distribution terms as the rest of that program.
22# 22#
23# Generated by gnulib-tool. 23# Generated by gnulib-tool.
24# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stdio strftime strtoimax strtoumax symlink sys_stat sys_time time time_r timer-time timespec-add timespec-sub unsetenv update-copyright utimens vla warnings 24# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stddef stdio strftime strtoimax strtoumax symlink sys_stat sys_time time time_r timer-time timespec-add timespec-sub unsetenv update-copyright utimens vla warnings
25 25
26 26
27MOSTLYCLEANFILES += core *.stackdump 27MOSTLYCLEANFILES += core *.stackdump
diff --git a/src/alloc.c b/src/alloc.c
index 35a5ee2784f..43287457c8d 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -534,8 +534,7 @@ buffer_memory_full (ptrdiff_t nbytes)
534/* Define XMALLOC_OVERRUN_SIZE_SIZE so that (1) it's large enough to 534/* Define XMALLOC_OVERRUN_SIZE_SIZE so that (1) it's large enough to
535 hold a size_t value and (2) the header size is a multiple of the 535 hold a size_t value and (2) the header size is a multiple of the
536 alignment that Emacs needs for C types and for USE_LSB_TAG. */ 536 alignment that Emacs needs for C types and for USE_LSB_TAG. */
537#define XMALLOC_BASE_ALIGNMENT \ 537#define XMALLOC_BASE_ALIGNMENT alignof (max_align_t)
538 alignof (union { long double d; intmax_t i; void *p; })
539 538
540#if USE_LSB_TAG 539#if USE_LSB_TAG
541# define XMALLOC_HEADER_ALIGNMENT \ 540# define XMALLOC_HEADER_ALIGNMENT \