<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 5/23/2018 1:46 PM, Jason Liu via
cfe-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAMz9_ob2BnmQBYm8vMQL0sjOacxvuK5MftKEUAnXkDNKJJEnEw@mail.gmail.com">
<div dir="ltr">
<p
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe
UI",Helvetica,Arial,sans-serif,"Apple Color
Emoji","Segoe UI Emoji","Segoe UI
Symbol";font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Currently
Clang implements<span> </span><code
style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation
Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0.2em
0.4em;margin:0px;background-color:rgba(27,31,35,0.05);border-radius:3px">pragma
pack</code><span> </span>mostly in the same way of what
Microsoft Windows compiler does:<span> </span><a
href="https://msdn.microsoft.com/en-us/library/2e70t5y1.aspx"
rel="nofollow"
style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none"
moz-do-not-send="true">https://msdn.microsoft.com/en-us/library/2e70t5y1.aspx</a><br
style="box-sizing:border-box">
However, there are platforms where<span> </span><code
style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation
Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0.2em
0.4em;margin:0px;background-color:rgba(27,31,35,0.05);border-radius:3px">pragma
pack</code><span> </span>has different syntax/semantics. For
example,<br style="box-sizing:border-box">
<a
href="https://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.2/com.ibm.xlc131.aix.doc/compiler_ref/pragma_pack.html"
rel="nofollow"
style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none"
moz-do-not-send="true">https://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.2/com.ibm.xlc131.aix.doc/compiler_ref/pragma_pack.html</a></p>
</div>
</blockquote>
<br>
As far as I know, the current implementation of pragma pack in clang
is compatible with both MSVC and gcc. "-fapple-pragma-pack" is a
compatibility flag for transitioning old code which expected Apple
gcc semantics (which was different from the regular gcc rules).<br>
<br>
If you need -faix-pragma-pack, that's okay; there isn't really any
better approach. (You can turn it on by default for AIX targets in
the clang driver, if you think that's appropriate?)<br>
<br>
<blockquote type="cite"
cite="mid:CAMz9_ob2BnmQBYm8vMQL0sjOacxvuK5MftKEUAnXkDNKJJEnEw@mail.gmail.com">
<div dir="ltr">
<p
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe
UI",Helvetica,Arial,sans-serif,"Apple Color
Emoji","Segoe UI Emoji","Segoe UI
Symbol";font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">There
are two options I can try to pursue here:</p>
<ol
style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe
UI",Helvetica,Arial,sans-serif,"Apple Color
Emoji","Segoe UI Emoji","Segoe UI
Symbol";font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">
<li style="box-sizing:border-box;margin-left:0px">Implement
the new stack effect model for all platforms.<br
style="box-sizing:border-box">
Pros : new mental model behind the stack effect might make
more sense for some users.<br style="box-sizing:border-box">
Cons: but it would break existing user code (if user are
actually using those<span> </span><code
style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation
Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0.2em
0.4em;margin:0px;background-color:rgba(27,31,35,0.05);border-radius:3px">pragma
align</code>). Hopefully<span> </span><code
style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation
Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0.2em
0.4em;margin:0px;background-color:rgba(27,31,35,0.05);border-radius:3px">pragma
align</code><span> </span>is not used pervasively on
existing platforms, otherwise, it is a deal breaker.</li>
<li
style="box-sizing:border-box;margin-top:0.25em;margin-left:0px">Implement
the new stack effect only on specific platform(AIX), keep
existing behavior for existing platforms.<br
style="box-sizing:border-box">
Pros: no existing user code will get break.<br
style="box-sizing:border-box">
Cons: it might be ugly to have different stack effect for
different platforms.</li>
</ol>
<p
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe
UI",Helvetica,Arial,sans-serif,"Apple Color
Emoji","Segoe UI Emoji","Segoe UI
Symbol";font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">I’m
leaning towards on option 1 at this time because it’s cleaner
solution if people think the new mental model is better, and
are okay with the fact that some user code will get compiled
differently if they use<span> </span><code
style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation
Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0.2em
0.4em;margin:0px;background-color:rgba(27,31,35,0.05);border-radius:3px">pragma
align</code><span> </span>and<span> </span><code
style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation
Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0.2em
0.4em;margin:0px;background-color:rgba(27,31,35,0.05);border-radius:3px">pragma
pack</code><span> </span>together already.</p>
<p
style="box-sizing:border-box;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe
UI",Helvetica,Arial,sans-serif,"Apple Color
Emoji","Segoe UI Emoji","Segoe UI
Symbol";font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;margin-bottom:0px">Please
let me know if there are any concerns or questions about my
current proposal and design. Your feedback is appreciated.</p>
<br>
</div>
</blockquote>
<br>
We can't change the stack rules for pragma align on Apple targets;
it's very likely to break existing code.<br>
<br>
-Eli<br>
<pre class="moz-signature" cols="72">--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
</body>
</html>