stdalign: work around pre-4.9 GCC x86 bug
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 19 Oct 2015 05:18:49 +0000 (22:18 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 19 Oct 2015 05:45:21 +0000 (22:45 -0700)
* 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

ChangeLog
lib/stdalign.in.h

index ae7ec704b2e6d2b10cdf2260e457a9250149f194..a17429b42bed0e4f3dea11381487d941c8596560 100644 (file)
--- 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
index 9a7d5edd95e87762264e7b976f049763341746ca..227eaf3981d53cee6234de19db98186115986ec8 100644 (file)
 #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)