libc++ patch for max_align_t

Howard Hinnant howard.hinnant at gmail.com
Sun Feb 16 06:39:26 PST 2014


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.
> 

Howard





More information about the cfe-commits mailing list