<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">(adding back cfe-commits, which I had accidentally dropped.)</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Thu, Jul 31, 2014 at 1:04 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div class="">On Thu, Jul 31, 2014 at 11:16 AM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">

<div>On Thu, Jul 31, 2014 at 9:45 AM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>></span> wrote:<br>
</div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">
<div class="gmail_quote">
Thanks!</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div>On Tue, Jul 29, 2014 at 10:40 AM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>+  // Diagnose the use of X86 fastcall on unprototyped functions.<br>


</div><div><br></div><div>We should also diagnose unprototyped stdcall functions, but I'm not sure if that would be too disruptive.  Currently we accept this and always call _f@0:</div>

<div><div>void __stdcall f();</div><div>int main() {</div><div>  f(1);</div><div>  f(1, 2);</div><div>  f(1, 2, 3);</div><div>}</div></div><div><br></div><div>MSVC rejects with "t.c(5) : error C2708: 'f' : actual parameters length in bytes differs from previous call or reference".</div>



</div></blockquote><div><br></div></div><div>I added a TODO for adding this and reshuffled the if to make this easy to add. I'll give it a try once this patch is in.</div></div></div></div></blockquote><div> <br></div>

</div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">

<div class="gmail_quote"><div>Actually, should this happen for all isCalleeCleanup() calling conventions? I suppose thiscall always has a prototype, but pascal(l :-P) might not?</div></div></div></div></blockquote><div><br>

</div></div><div>That sounds like the right predicate, considering we verifier-fail on this in plain C mode:<br><div>void __thiscall f();<br></div><div>int main() { f(1); }</div></div><div><br></div><div>MSVC rejects __thiscall in C mode, but we don't.</div>

</div></div></div>
</blockquote></div><br></div><div class="gmail_extra">I did give it a try, and rejecting stdcall fires on Windows SDK headers:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">...win8sdk/Include/um\imm.h(432,13) :  error(clang): function with no prototype cannot use stdcall calling convention</div>
<div class="gmail_extra">BOOL WINAPI ImmDisableLegacyIME();</div><div class="gmail_extra">            ^</div><div class="gmail_extra"><br></div><div class="gmail_extra">So the same mechanism doesn't work for stdcall. We could do the same thing for thiscall, but if msvc rejects that in C files, we should probably just do that too?</div>
</div></div>