<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jan 7, 2014 at 8:33 PM, 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 class="im"><br>
On 08/01/2014 04:21, Argyrios Kyrtzidis wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Jan 7, 2014, at 7:56 PM, Alp Toker <<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 08/01/2014 01:48, Argyrios Kyrtzidis wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Jan 6, 2014, at 1:47 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a> <mailto:<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>><u></u>> wrote:<br>

<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
One view on this is simply: -Wsystem-headers means "don't give system headers special treatment when emitting diagnostics”.<br>
</blockquote>
This is it exactly. “Treat all headers like normal headers"<br>
</blockquote>
We don't have a flag to treat all headers as normal headers at the moment. It'd be very simple to implement compared to -Wsystem-headers which somewhat intricate.<br>
</blockquote>
Could you elaborate, AFAICT '-Wsystem-headers' is treated specially, it's outside the diagnostic group machinery, and acts essentially as a flag.<br>
If you'd like to have something like '-fwarn-on-system-headers' or something instead, that's another discussion, but as far as the PR is concerned I don't see why we need to change what -Wsystem-headers is currently doing.<br>

</blockquote>
<br></div>
PR18327 reports a valid corner-case bug in the way a very small number (around 8 in total) diagnostics are upgraded from warnings/extensions to errors, and then were forgetting to downgrade them back to warnings as all the other diagnostics are seen. So it's just an implementation detail that was leaking and manifesting as errors in a context where it should have been impossible.<br>
</blockquote><div><br></div><div>These diagnostics are set up as 'errors that we suppress in system headers' (they're suppressed because they actually happen in some system headers).</div><div><br></div><div>If the viewpoint is that '-Wsystem-headers' means 'don't suppress diagnostics in system headers', then issuing errors in these cases seems correct to me. If the viewpoint is that '-Wsystem-headers' means 'warn on problems in system headers', then issuing warnings, not errors, in these cases seems correct. It depends on what the user of the flag intends it to mean.</div>
<div><br></div><div>I think the former option makes a little more sense for system header developers -- if their system headers contain ill-formed code, they probably want to know about that with more urgency than if their system headers merely contain dubious code. But we still don't know what the person who filed the original PR was trying to do, and maybe there's a use case where the latter view makes more sense.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Remember that this flag doesn't control the very many isInSystemHeader() and isInSystemMacro() checks that happen earlier than the diagnostic machinery. A -fno-system-headers flag to just disable the whole system header machinery would be separately useful though, agreed.</blockquote>
<div><br></div><div>I agree. If we want this flag to mean 'there are no system headers', it does not go far enough.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
Alp.</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Alp.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That would seem to make perfect sense to people developing system headers, and is our current behavior. What is the use case that leads to enabling -Wsystem-headers but not wanting that to lead to errors? PR18327 doesn't make that obvious.<br>

</blockquote>
Not sure I’m following that report, if one doesn’t like that that diagnostic is by default mapped to an error, maybe map it to a warning on the command-line or discuss whether it should not be mapped to error by default ?<br>

I don’t see a need to complicate what -Wsystem-headers does.<br>
<br>
</blockquote>
-- <br>
<a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
the browser experts<br>
<br>
</blockquote></blockquote>
<br>
-- <br>
<a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
the browser experts<br>
<br>
</div></div></blockquote></div><br></div></div>