[PATCH] Define max_align_t in C++11 and C11 mode

David Majnemer david.majnemer at gmail.com
Fri Oct 18 10:22:41 PDT 2013


This implementation of max_align_t disagrees with gcc. They have something
like:
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long
long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long
double))));
} max_align_t;

as their definition while you have something like:

typedef long double max_align_t;

For a 32-bit x86 target, this means that:
gcc's alignof(max_align_t): 8
clang's alignof(max_align_t): 4

-- 
David Majnemer


On Fri, Oct 18, 2013 at 9:58 AM, Hristo Venev <mustrumr97 at gmail.com> wrote:

> Add a definition of max_align_t in stddef.h
> Done by gcc 4.9 and required by libstdc++ 4.9.
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131018/9e9d2f12/attachment.html>


More information about the cfe-commits mailing list