<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On Feb 19, 2014, at 3:11 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Attached in my patch to do this minimum of work to get std::max_align_t. It's dirt simple, if deeply unfortunate in the specific definition in provides on many platforms. I think it is no worse than the current behavior.<div>
<br></div><div>If we want to support a host which is neither Clang nor GCC and does not provide a ::max_align_t, we can do so incrementally atop this I think.</div></div></blockquote><div><br></div><div>LGTM.</div><div><br></div><div>— Marshall</div><div><br></div><div><br></div><blockquote type="cite"><div dir="ltr"><div><br></div><div>-Chandler</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Feb 16, 2014 at 12:14 AM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">FYI, i'm preparing patches to this effect.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Feb 15, 2014 at 11:13 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This seems to be going in the wrong direction.<div><br></div><div>* max_align_t needs to be in <stddef.h> as well as in <cstddef></div>

<div>* <stddef.h> is provided by the compiler, not by the standard library</div>
<div>* 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).</div><div><br>


</div><div>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.</div></div><div class="gmail_extra">


<br><br><div class="gmail_quote"><div>On Mon, Feb 10, 2014 at 1:16 PM, Howard Hinnant <span dir="ltr"><<a href="mailto:howard.hinnant@gmail.com" target="_blank">howard.hinnant@gmail.com</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<div>On Feb 10, 2014, at 2:25 PM, Howard Hinnant <<a href="mailto:howard.hinnant@gmail.com" target="_blank">howard.hinnant@gmail.com</a>> wrote:<br>
<br>
>> It seems like the old behavior follows the standard more closely. If Len<br>
>> == 17, then _any_ c++ object with size no greater than Len includes<br>
>> objects of size 16 and some objects of size 16 maybe have an alignment<br>
>> requirement of 16.<br>
><br>
> Ok, I'm convinced, thanks.<br>
<br>
</div>I've enclosed a slightly updated patch.  I've added float as Kal suggested, but haven't added uintmax_t because of not wanting to couple <cstddef> to <cstddint>.  I have not modified the behavior, thanks to Kal.<br>



<br>
std::__find_max_align<std::__all_types, 1>::value = 1<br>
std::__find_max_align<std::__all_types, 2>::value = 2<br>
std::__find_max_align<std::__all_types, 3>::value = 2<br>
std::__find_max_align<std::__all_types, 4>::value = 4<br>
std::__find_max_align<std::__all_types, 5>::value = 4<br>
std::__find_max_align<std::__all_types, 6>::value = 4<br>
std::__find_max_align<std::__all_types, 7>::value = 4<br>
std::__find_max_align<std::__all_types, 8>::value = 8<br>
std::__find_max_align<std::__all_types, 9>::value = 8<br>
std::__find_max_align<std::__all_types, 10>::value = 8<br>
std::__find_max_align<std::__all_types, 11>::value = 8<br>
std::__find_max_align<std::__all_types, 12>::value = 8<br>
std::__find_max_align<std::__all_types, 13>::value = 8<br>
std::__find_max_align<std::__all_types, 14>::value = 8<br>
std::__find_max_align<std::__all_types, 15>::value = 8<br>
std::__find_max_align<std::__all_types, 16>::value = 16<br>
std::__find_max_align<std::__all_types, 17>::value = 16<br>
std::__find_max_align<std::__all_types, 18>::value = 16<br>
std::__find_max_align<std::__all_types, 19>::value = 16<br>
std::__find_max_align<std::__all_types, 20>::value = 16<br>
std::__find_max_align<std::__all_types, 21>::value = 16<br>
std::__find_max_align<std::__all_types, 22>::value = 16<br>
std::__find_max_align<std::__all_types, 23>::value = 16<br>
std::__find_max_align<std::__all_types, 24>::value = 16<br>
std::__find_max_align<std::__all_types, 25>::value = 16<br>
std::__find_max_align<std::__all_types, 26>::value = 16<br>
std::__find_max_align<std::__all_types, 27>::value = 16<br>
std::__find_max_align<std::__all_types, 28>::value = 16<br>
std::__find_max_align<std::__all_types, 29>::value = 16<br>
std::__find_max_align<std::__all_types, 30>::value = 16<br>
std::__find_max_align<std::__all_types, 31>::value = 16<br>
std::__find_max_align<std::__all_types, 32>::value = 16<br>
std::__find_max_align<std::__all_types, 33>::value = 16<br>
...<br>
<span><font color="#888888"><br>
Howard<br>
</font></span><br></div><div>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></div></blockquote></div><br></div>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
<span><fix-max-align-t.patch></span></blockquote></div><br></body></html>