<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 15, 2014 at 3:17 AM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div><div class="h5">
<br>
<div>On 15/01/2014 05:59, Nico Weber wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Tue, Jan 14, 2014 at 11:13 AM, Alp
Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: alp<br>
Date: Tue Jan 14 13:13:00 2014<br>
New Revision: 199247<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=199247&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=199247&view=rev</a><br>
Log:<br>
Clarify driver/frontend -fms-compatibility help text<br>
<br>
Better describe the flag that enables drop-in MSVC
compatibility, including<br>
ability to parse MS standard headers. This is intended to
distinguish it from<br>
-fms-extensions, the more established and 'gentler' flag
also supported by GCC.<br>
<br>
The new wording matches up with the internal description
introduced in r198936.<br>
Still room for improvement (e.g. C++ is part of the
product name, yet the flag<br>
also applies to C) but it's a step forward from "Microsoft
mode".<br>
<br>
Modified:<br>
cfe/trunk/include/clang/Driver/Options.td<br>
<br>
Modified: cfe/trunk/include/clang/Driver/Options.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=199247&r1=199246&r2=199247&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=199247&r1=199246&r2=199247&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Driver/Options.td (original)<br>
+++ cfe/trunk/include/clang/Driver/Options.td Tue Jan 14
13:13:00 2014<br>
@@ -575,9 +575,9 @@ def fmessage_length_EQ :
Joined<["-"], "<br>
def fms_extensions : Flag<["-"], "fms-extensions">,
Group<f_Group>, Flags<[CC1Option]>,<br>
HelpText<"Accept some non-standard constructs
supported by the Microsoft compiler">;<br>
def fms_compatibility : Flag<["-"],
"fms-compatibility">, Group<f_Group>,
Flags<[CC1Option]>,<br>
- HelpText<"Enable Microsoft compatibility mode">;<br>
+ HelpText<"Enable full Microsoft Visual C++
compatibility">;<br>
</blockquote>
<div><br>
</div>
<div>Isn't "full" too strong? I thought this was more
"enough to parse ms sdk headers and link to mscrt", not
"full" compatibility.</div>
</div>
</div>
</div>
</blockquote>
<br></div></div>
It isn't perfect, but we ran through a lot of options and this is
the only one that standard.<br>
<br>
In so far as it enables the "full" set of compatibility features
this one works well.<br>
<br>
<br>
Other options evaluated:<br>
<br>
<ul>
<li>"drop-in": Sounds like a knock off or clone, and could be
taken literally (I deleted cl.exe and dropped it in!)</li>
<li>"seamless": Implies subtlety and non-breaking of existing
code, which isn't always the case.</li>
<li>No word: Same problem as 'seamless'. "Compatible with existing
code, or compatible with MSVC?"</li>
<li>"mode": There are other modes which only make minor changes to
the parser -- this didn't work out in past</li>
<li>"Microsoft system headers": none -fms-compatibility is
currently restricted to system headers -- it fully changes the
behaviour of the compiler in various ways.</li></ul></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><br>
Also, facepalm link:<br>
<br>
"Clang does't compile gcc compatible c++ code? -fms-compatibility
is your friend"<br>
<a href="http://codingdave.blogspot.co.uk/2012/08/clang-doest-compile-gcc-compatible-c.html" target="_blank">http://codingdave.blogspot.co.uk/2012/08/clang-doest-compile-gcc-compatible-c.html</a><br>
<br>
<i>"Although this parameter was introduced to make clang compile
visual c++ headers, it also fixes problems like the one above."</i><br>
<br>
That's why we'd do well to move away from the "ms sdk header"
wording (even if it's the current goal).<br></div></blockquote><div><br></div><div>Yeah. With the "full compat" text, I'm afraid that people will keep doing this and file bugs on clang if their code doesn't build with -fms-compat even though it builds with cl.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">I think it's about right now, but suggestions on the back of a
postcard welcome.<br></div></blockquote><div><br></div><div>To me the difference between -fms-extensions and -ms-compat is that the first enables some relatively harmless things, while the latter enables things that actively contradict the standard, so I'd try to express this in the help text somehow.</div>
<div><br></div><div>(But I realize this is a bikeshed topic, so I'll be happy with whatever you decide to do, including "no action".)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<br>
Alp.<div class="im"><br>
<br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
def fmsc_version : Joined<["-"], "fmsc-version=">,
Group<f_Group>, Flags<[CC1Option,
CoreOption]>,<br>
- HelpText<"Version of the Microsoft C/C++ compiler to
report in _MSC_VER (0 = don't define it (default))">;<br>
+ HelpText<"Microsoft compiler version number to
report in _MSC_VER (0 = don't define it (default))">;<br>
def fdelayed_template_parsing : Flag<["-"],
"fdelayed-template-parsing">, Group<f_Group>,<br>
HelpText<"Parse templated function definitions at
the end of the "<br>
"translation unit">,
Flags<[CC1Option]>;<br>
<br>
<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>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<br>
</div><span class="HOEnZb"><font color="#888888"><pre cols="72">--
<a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a>
the browser experts
</pre>
</font></span></div>
</blockquote></div><br></div></div>