From df082835cb4d3488aff930b2e1a2bc8cdeaacea4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 18 Oct 2015 22:18:49 -0700 Subject: [PATCH] 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 --- ChangeLog | 7 +++++++ lib/stdalign.in.h | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ae7ec70..a17429b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-10-18 Paul Eggert + + 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 maint.mk: sc_tight_scope: remove extraneous expressions diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h index 9a7d5ed..227eaf3 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 + . */ +#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \ + || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9))) # ifdef __cplusplus # if 201103 <= __cplusplus # define _Alignof(type) alignof (type) -- 2.1.0