<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 9, 2014 at 2:39 PM, Marshall Clow <span dir="ltr"><<a href="mailto:mclow.lists@gmail.com" target="_blank">mclow.lists@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="im">On Jan 9, 2014, at 2:20 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>> wrote:<br>
</div><div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="im">On Thu, Jan 9, 2014 at 7:25 AM, 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote></div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 It's not fair on the user or the system header maintainers to bring up unexpected errors with this flag.<br>
</blockquote><div><br></div><div>I don't think this is clear. If the code in the system header is ill-formed, I would expect the system header maintainers to be *grateful* that we flag it as an error and not just as a warning. But I'll wait to hear what they have to say about that.</div>
</div></div></div></div></blockquote><div><br></div><div>A few points, in no particular order:</div><div><br></div></div><div>* If we have ill-formed code in system headers, I would expect it to fail to compile whether the user specifies -<span style="font-family:LucidaGrande">Wsystem-headers </span>or not.</div>
</div></blockquote><div><br></div><div>And yet in some cases we don't, because we deliberately support some flavors of broken system headers. Given that, would you want -Wsystem-headers to make such code produce an error or only a warning?</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>* If a user has a clean build, and then rebuilds with -<font face="LucidaGrande">Wsystem-headers, I would expect to get warnings - not errors. [ Isn’t that what PR</font>18327 is all about? ]</div>
</div></blockquote><div><br></div><div>Do you expect this because the flag starts with -W? (Maybe that's the problem here -- it's *not* a warning flag in the sense that the other -W flags are. But that's not unprecedented -- nor is -Werror.)</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span style="font-family:LucidaGrande">* There are some “interesting” language features which are only enabled for system headers, and cause warnings if used in user code.</span></div>
<div><font face="LucidaGrande">[ User-defined suffixes that do not start with an underscore, for example. ]</font></div></div></blockquote><div><br></div><div>This is a really great example, thanks. So it seems there are at least three different classes of errors that we might think about producing in system headers:</div>
<div><br></div><div> 1) warnings that the user has turned into errors with -Werror or -Werror=foo</div><div> 2) errors for ill-formed code that we suppress by default in system headers as a workaround for a system header bug</div>
<div> 3) errors for code that is ill-formed outside system headers but valid within system headers (using reserved names, adding names to namespace std, that sort of thing)</div><div><br></div><div>With -Wsystem-headers enabled, I think (1) should be an error, (3) should remain suppressed (not even a warning), and (2) should be either a warning or an error (and your first two bullets don't give me a clear idea of which way these cases should go).</div>
</div></div></div>