<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>