<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 6, 2016 at 3:28 PM, Eric Niebler via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@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"><span class="">On 6/3/16, 4:13 PM, "<a href="mailto:thakis@google.com">thakis@google.com</a> on behalf of Nico Weber" <<a href="mailto:thakis@google.com">thakis@google.com</a> on behalf of <a href="mailto:thakis@chromium.org">thakis@chromium.org</a>> wrote:<br>
>On Fri, Jun 3, 2016 at 7:07 PM, Eric Niebler <<a href="mailto:eniebler@fb.com">eniebler@fb.com</a>> wrote:<br>
>>On 6/3/16, 3:24 PM, "<a href="mailto:thakis@google.com">thakis@google.com</a> on behalf of Nico Weber" <<a href="mailto:thakis@google.com">thakis@google.com</a> on behalf of <a href="mailto:thakis@chromium.org">thakis@chromium.org</a>> wrote:<br>
>>> On Fri, Jun 3, 2016 at 6:14 PM, Eric Niebler <<a href="mailto:eniebler@fb.com">eniebler@fb.com</a>> wrote:<br>
>>>> I just checked, and warnings are not emitted from files in an -isystem path. I didn’t have to do anything special to get that behavior.<br>
>>>> I don’t know about -imsvc. Is that a clang-cl thing? I can’t say at this point why the diagnostics system treats -isystem and –imsvc<br>
>>>> differently.<br>
>>>><br>
>>>> How about this: I can change the diagnostic to not warn about filenames if the file is found in a system include path, regardless of<br>
>>>> the location of the #include directive.<br>
>>><br>
>>> That sounds like a good idea to me!<br>
>><br>
>> On second thought, this warning isn’t living up to its potential if it doesn’t warn on `#include <IoStReAm>`. And if we don’t help people<br>
>> find misspellings of IOKIt, we haven’t done much good at all.<br>
>><br>
>> Once I sort out the -imsvc thing, how bad would it be to leave it alone? Probably pretty bad for folks in the Windows world, huh?<br>
><br>
> Yes, the warning is completely unusable there atm.<br>
<br>
</span>Here’s my current thinking on the issue:<br>
<br>
1) By default, warn only for user includes and the known standard headers (C/C++/posix).<br>
2) Add an additional switch that controls warning for nonportable paths to system includes (disabled by default).<br>
<br>
Thoughts?</blockquote><div><br></div><div>Rather than identifying specific known standard headers, could we instead identify the directory containing the standard library implementation? We know which one it is when we're initially forming the list of header search directories. The downside is this probably means yet another flavour of -iblah flag for the frontend. =(</div></div></div></div>