Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 23 Jun 2014 13:11:55 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: max_align_t mess

On Mon, Jun 23, 2014 at 09:51:35AM +0200, Szabolcs Nagy wrote:
> * Rich Felker <dalias@...c.org> [2014-06-23 00:48:07 -0400]:
> > 
> > TYPEDEF struct { _Alignas(N) struct { char __align_c[M]; }; } max_align_t;
> > 
> > where N and M are the correct alignment and size for the arch ABI.
> > 
> 
> I like this but unfortunately it only works if the compiler has _Alignas

Since max_align_t can only be defined portably with C11, I think it's
reasonable to expose it only under __STDC_VERSION__ >= 201112L. Or we
could add an #elif __GNUC__ using __attribute__((__aligned__)) but
from a namespace standpoint it's probably preferable to hide it for
pre-C11 anyway.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.