summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-10-18 22:18:49 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-10-18 22:45:21 -0700
commit82e0ec5306119206d85a223a1e61196440188ff6 (patch)
tree00dff4d9a1a0f4bc24a1ecb0c17de553d0bd0e3e
parent2a8b497f35cbc9548eff83752c37fc0ff0ab25cc (diff)
downloadgnulib-82e0ec5306119206d85a223a1e61196440188ff6.tar.gz
stdalign: work around pre-4.9 GCC x86 bug
* lib/stdalign.in.h (_Alignof): Work around bug in pre-4.9 GCC on x86, when -std=gnu11 is used. Problem reported by Jim Meyering in: http://lists.gnu.org/archive/html/bug-gnulib/2015-10/msg00038.html
-rw-r--r--ChangeLog7
-rw-r--r--lib/stdalign.in.h5
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ae7ec704b2..a17429b42b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-10-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ stdalign: work around pre-4.9 GCC x86 bug
+ * lib/stdalign.in.h (_Alignof): Work around bug in pre-4.9 GCC on
+ x86, when -std=gnu11 is used. Problem reported by Jim Meyering in:
+ http://lists.gnu.org/archive/html/bug-gnulib/2015-10/msg00038.html
+
2015-10-18 Pádraig Brady <P@draigBrady.com>
maint.mk: sc_tight_scope: remove extraneous expressions
diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h
index 9a7d5edd95..227eaf3981 100644
--- a/lib/stdalign.in.h
+++ b/lib/stdalign.in.h
@@ -52,7 +52,10 @@
#undef _Alignas
#undef _Alignof
-#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023
+ <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
+#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
+ || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9)))
# ifdef __cplusplus
# if 201103 <= __cplusplus
# define _Alignof(type) alignof (type)