<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">I don't think we can change the ordering because VC/include is typically included in the INCLUDE environment variable, and that directory contains MSVC's *mmintrin.h headers, which are compiler-specific. We need clang's intrinsic headers to win out over MSVC's. It sounds like you can work around the issue by passing /I., though, right?</div><div class="gmail_quote"><br></div><div class="gmail_quote">Thanks for the report, though, always excited to hear about new user experiences. :)</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Fri, Aug 19, 2016 at 5:09 AM, Jay Foad via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</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="gmail_quote"><div dir="ltr">Hi,<div><br></div><div>I ran into a problem when switching from cl.exe to clang-cl.exe (3.8.1) for building a large proprietary Windows application. I'm not sure if this counts as a bug in clang-cl, but I thought I should report it anyway.</div><div><br></div><div>Our app:</div><div>- has its own header called cpuid.h</div><div>- for obscure reasons, includes all its own headers using angle brackets instead of double quotes: #include <cpuid.h></div><div><br></div><div>The problem goes like this:</div><div><br></div><div>$ cat foo.c</div><div>#include <cpuid.h></div><div>T x;</div><div><br></div><div>$ cat cpuid.h</div><div>typedef int T;</div><div><br></div><div>$ INCLUDE=. cl /c foo.c # works</div><div><br></div><div>$ INCLUDE=. clang-cl /c foo.c # doesn't work</div><div>foo.c(2,1) :  error: unknown type name 'T'<br></div><div><br></div><div>... because it has picked up the cpuid.h shipped with clang-cl, not the one in the current directory.</div><div><br></div><div>A few experiments with cl suggest that it looks for headers in these directories, in this order:</div><div>1. /I command line options</div><div>2. INCLUDE environment variable</div><div>3. C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include</div><div><br></div><div>Whereas clang-cl -Xclang -v tells me it is looking in:</div><div><div>1. /I command line options</div><div>2. C:\Program Files\LLVM\bin\..\lib\clang\3.<wbr>8.1\include</div><div>3. INCLUDE environment variable</div><div><br></div></div><div>Any chance of swapping 2 and 3 round, to better match cl?</div><div><br></div><div>Thanks,</div><div>Jay.</div></div></div></div>
<br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>