<div dir="ltr">If people are using ms_struct and non-standard layouts without thinking about it then perhaps it is reasonable to force them to think about it?  The ms_struct pragma is an ABI change, which has somewhat wide-reaching consequences.  I suspect that the most common use case is to read serialized data directly into memory.  I'm assuming that the data was serialized by code generated by the cl.exe (which is why they're using ms-struct in the first place) and so they're likely to get ms layout for non-standard layout types in the serialized data and might have bugs.<div>
<br></div><div>-Warren</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Sep 1, 2013 at 5:11 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.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"><div class="im">On Fri, Aug 30, 2013 at 1:36 PM, Warren Hunt <span dir="ltr"><<a href="mailto:whunt@google.com" target="_blank">whunt@google.com</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">Now that I'm putting finishing touches on the Microsoft Record Layout patch (<a href="http://llvm-reviews.chandlerc.com/D1026" target="_blank">http://llvm-reviews.chandlerc.com/D1026</a>) there are some subtle issues that are cropping up with respect to compatibility with the ms_struct pragma/mms-bitfields flag.<div>


<br></div><div>The issues is that behavior of ms_struct/mms-bitfields is to use the Itanium layout rules for everything except alignment of long long, bitfields and bitfield padding.  This results in something that is Win32 ABI compatible for standard layout C++ structures but not otherwise.</div>


<div><br></div><div>It would be a maintenance win if we could remove all Microsoft related layout code from the Itanium builder and simply use the Microsoft builder when ms_struct or mms-bitfields is set.</div><div><br></div>


</div><div style="font-family:arial,sans-serif;font-size:13px">Does anyone object to making mms-bitfields/ms_struct mean "use Microsoft record layout" so we can deprecate the hybrid code?</div></div></blockquote>

<div><br></div></div><div>These are equivalent for standard-layout classes, right?<br><br></div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<div style="font-family:arial,sans-serif;font-size:13px">

<div><br></div><div>When using mms-bitfields/ms_struct should we throw an error if the record is not standard layout?<br></div></div></div></blockquote><div><br></div></div><div>Please be cautious here; even if we just consider clang on the Mac, ms_struct is widely used, and some people probably use it on non-standard-layout classes, either by accident or just without thinking about it.  And I'm sure a few people who haven't really considered the consequences use -mms-bitfields as well.<span class="HOEnZb"><font color="#888888"><br>

</font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-Eli<br></div></font></span></div></div></div>
</blockquote></div><br></div>