emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 7fc616a 2/2: Replace union hack with C11-style max_


From: Paul Eggert
Subject: [Emacs-diffs] master 7fc616a 2/2: Replace union hack with C11-style max_align_t
Date: Sat, 13 Dec 2014 01:55:17 +0000

branch: master
commit 7fc616afcfbaebea1658149da269110da94d6e59
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    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.
---
 ChangeLog          |    8 ++++++++
 admin/merge-gnulib |    2 +-
 lib/gnulib.mk      |    2 +-
 src/alloc.c        |    3 +--
 4 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9d9aea6..85edd9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-12-13  Paul Eggert  <address@hidden>
+
+       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.
+
 2014-12-12  Paul Eggert  <address@hidden>
 
        Git ignore lib/std*.h
diff --git a/admin/merge-gnulib b/admin/merge-gnulib
index dc3cd6c..64514f7 100755
--- a/admin/merge-gnulib
+++ b/admin/merge-gnulib
@@ -35,7 +35,7 @@ GNULIB_MODULES='
   intprops largefile lstat
   manywarnings memrchr mkostemp mktime
   pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat
-  sig2str socklen stat-time stdalign stdio
+  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
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index c54b811..740ebb1 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -21,7 +21,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# 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 --ma [...]
+# 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 --ma [...]
 
 
 MOSTLYCLEANFILES += core *.stackdump
diff --git a/src/alloc.c b/src/alloc.c
index 35a5ee2..4328745 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -534,8 +534,7 @@ buffer_memory_full (ptrdiff_t nbytes)
 /* Define XMALLOC_OVERRUN_SIZE_SIZE so that (1) it's large enough to
    hold a size_t value and (2) the header size is a multiple of the
    alignment that Emacs needs for C types and for USE_LSB_TAG.  */
-#define XMALLOC_BASE_ALIGNMENT                         \
-  alignof (union { long double d; intmax_t i; void *p; })
+#define XMALLOC_BASE_ALIGNMENT alignof (max_align_t)
 
 #if USE_LSB_TAG
 # define XMALLOC_HEADER_ALIGNMENT \



reply via email to

[Prev in Thread] Current Thread [Next in Thread]