libc++ patch for max_align_t

Richard Smith metafoo at gmail.com
Mon Feb 17 20:00:50 PST 2014


On Sun Feb 16 2014 at 6:39:32 AM, Howard Hinnant <howard.hinnant at gmail.com>
wrote:

> On Feb 16, 2014, at 2:13 AM, Richard Smith <richard at metafoo.co.uk> wrote:
>
> > This seems to be going in the wrong direction.
> >
> > * max_align_t needs to be in <stddef.h> as well as in <cstddef>
> > * <stddef.h> is provided by the compiler, not by the standard library
> > * max_align_t is de facto part of the platform's ABI. It's not enough to
> get the alignment right, you also need to get the size and mangled name of
> the type right (and possibly other things too).
> >
> > IMO, the right thing to do here is to add a definition to max_align_t to
> Clang's lib/Headers/stddef.h, and add a using declaration to libc++'s
> cstddef to pull it into namespace std.
> >
>
> On Feb 9, 2014, at 2:50 PM, Howard Hinnant <howard.hinnant at gmail.com>
> wrote:
>
> > Features:
> >
> > 1. If <__config> defines _LIBCPP_C_HAS_MAX_ALIGN_T, then max_align_t is
> grabbed from the global namespace / <stddef.h>.  Currently no platform in
> <__config> defines _LIBCPP_C_HAS_MAX_ALIGN_T.  C11 introduces max_align_t
> in <stddef.h>.  I expect that eventually all platforms will migrate to this
> option.
>

Sorry, I missed that part =) That general approach sounds right to me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140218/a295bf25/attachment.html>


More information about the cfe-commits mailing list