<div dir="ltr">On Thu, Feb 27, 2014 at 6:57 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5"><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">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><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">
<div><div><br></div></div><div>
This patch provides the initial implementation of 'remarks'. It includes the actual definiton of the remark nodes, their printing as well as basic parameter handling. We are reusing the existing diagnostic parameters which means a remark<br>



can be enabled with normal '-Wdiagnostic-name' flags and can be upgraded to an error using '-Werror=diagnostic-name'.<br></div></blockquote><div><br></div><div>For the record, I strongly recommend that the syntax to enable a remark should be "-Wremark=diagnostic-name", and that "-Wdiagnostic-name" should (continue to) mean "upgrade this diagnostic to a warning".</div>


<div>However, I have no objection to the current semantics for an initial checkin, as long as nobody uses it as an excuse to keep those semantics forever.</div></div></div></div></blockquote><div><br></div></div></div><div>
I'm not following something here. If it makes sense for a diagnostic to be upgraded to an error, why would it be a remark rather than a warning? Put another way, if a remark describes something that might indicate a problem, then what is the difference between a remark and a warning, and why do we need a new kind of thing in the first place?</div>
</div></div></div></blockquote><div><br></div><div>Errors stop the build; warnings and remarks don't.</div><div>Warnings and errors are printed to the user by default; remarks require a little extra effort on the user's part.</div>
<div><br></div><div>The OP's use-case, IIUC, is that he wants to be notified whenever the compiler fails to vectorize a loop that has been annotated for vectorization; but he doesn't want the diagnostic to be as severe as a warning. (Although, now that I think about it, I'm not sure why he couldn't just add a new warning -Wvectorization-failed that was disabled by default; this use-case is pretty much orthogonal to remarks.)</div>
<div> <br></div><div>EDG's use-case was that a "warning" was something that would likely be useful to everyone; a "remark" was something that would likely be of interest to everyone but too spammy to turn on by default (for example, "switch case fallthrough" or "method declared without the virtual keyword is nevertheless virtual"); and "silent" was for things that weren't of general interest (for example "C-style cast in C++" or "recursive functions are disallowed by MISRA").</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I would have thought that the difference is that a remark indicates something that *isn't* a problem, and is just informational. That being the case, it doesn't make sense to me to upgrade remarks to warnings or to errors.</div>
</div></div></div></blockquote><div><br></div><div>A user wants to stop the build when a particular diagnostic is issued. The way you do that in most compilers (Clang included) is to pass "-Werror=the-diagnostic". Whether the diagnostic started out as a remark or a warning is irrelevant to the user.</div>
<div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> It would seem bizarre to me if -Werror converts remarks to errors (and indeed, in this patch, it does not).</div>
</div></div></div></blockquote><div><br></div><div>Agreed. Unadorned "-Werror" should remain a synonym for "-Werror=warnings".</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> I think we should also reject -Werror=some-remark.</div></div></div></div></blockquote><div><br></div><div>Disagreed; how else would a user promote some-remark to the build-stopping "error" severity level?  (Assuming that we keep the concept of "remarks" at all, that is.)</div>
<div><br></div><div>–Arthur</div></div></div></div>