<div>We need to figure out what -Wsystem-headers should do in some corner cases. In particular:</div><div><br></div><div> * If I -Werror= a warning, and I have -Wsystem-headers, and the warning occurs in a system header, what should happen?</div>
<div> * If I use -Werror=system-headers, and a DefaultError warning (like -Winvalid-constexpr) is issued in a system header, what should happen?</div><div> * If I use -Werror=system-headers, and a (non-promoted-to-error) warning occurs in a system header, what should happen?</div>
<div> * If I use -Werror globally, and I have -Wsystem-headers enabled, and a warning is produced in a system header, what should happen?</div><div><br></div><div>One possible approach would be to set the apparent severity of diagnostics in system headers to max(warning severity, -Wsystem-headers severity). So -Wsystem-headers would allow warnings (but not errors) to be produced in system headers, and -Werror=system-headers would also allow errors to be produced in system headers.<br>
</div><div><br></div><div>Another would be your current patch (never produce errors in system headers).</div><div><br></div><div>Another would be to treat all warnings in system headers as if they're controlled by the -Wsystem-headers flag (so -Werror=system-headers would promote them all to errors, as would -Werror -Wsystem-headers).</div>
<div><br></div><div>Maybe there's another, better, option.</div><div><br></div><div>Thoughts?</div><br><div>On Sun Dec 29 2013 at 7:01:45 AM, Alp Toker <<a href="mailto:alp@nuanti.com">alp@nuanti.com</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The -Wsystem-headers option was enabling warnings that got upgraded to<br>
errors<br>
through mappings like DefaultError. In a normal build these errors are fully<br>
suppressed.<br>
<br>
This patch makes -Wsystem-headers consistent with ordinary behaviour by<br>
restoring mapped errors in system headers to warnings, ensuring that the<br>
option<br>
can never cause build failures.<br>
<br>
The test case extends existing checks added in r169689 / PR14550.<br>
<br>
Alp.<br>
<br>
--<br>
<a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
the browser experts<br>
<br>
</blockquote>