<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 23, 2018 at 4:12 PM John McCall <<a href="mailto:rjmccall@gmail.com">rjmccall@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">On Mon, Apr 23, 2018 at 6:32 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br></div><div dir="ltr"><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">On Mon, Apr 23, 2018 at 3:29 PM John McCall via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<br><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">rjmccall added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D45766#1076176" rel="noreferrer" target="_blank">https://reviews.llvm.org/D45766#1076176</a>, @dblaikie wrote:<br>
<br>
> Is there anything else in the "-w" namespace other than the literal "-w" so<br>
>  far?<br>
<br>
<br>
No. This would be novel.<br></blockquote><div><br></div></span><div>Ah, I see.</div><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> I mean, I could imagine it might make more sense to default these warnings<br>
>  off & users can turn them on for non-test code, potentially? So<br>
>  "-Wnon-test" might make sense.<br>
<br>
That's an interesting idea, but it's still not a warning group, because you shouldn't get the self-assign warnings unless `-Wself-assign` is enabled.<br></blockquote></span><div><br>You shouldn't?</div></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I wouldn't think so.  Remember that the goal of the option is to be a single thing that users can add to their unit-test CFLAGS to disable these noisy-in-tests cases.  So if we add an opt-in/experimental `-Wunpredictable-foozits` warning, and it has a unit-test carve-out, passing `-wtest -wno-test` or whatever shouldn't turn on the carved-out special case of `-Wunpredictable-foozits`.</div><div><br></div><div>It's probably not the worst thing to just use a `-W` spelling anyway; not everything in that namespace is (e.g. `-Werror`).  It could be `-Wnoisy-in-tests` and `-Wno-noisy-in-tests`, with a documentation note that `-Wnoisy-in-tests` is just a cancellation of `-Wno-noisy-in-tests` and doesn't actually enable any warnings by itself.  We could have the diagnostic printer add `-Wnoisy-in-tests` to the diagnostic-group annotation for diagnostics that would be suppressed under `-Wno-noisy-in-tests`, analogously to how it adds `-Werror` for diagnostics that have been promoted to an error.</div></div></div></div></blockquote><div><br>That sort of sounds pretty plausible to me. Poked Richard about his opinion here too.<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><br></div><div>John.</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><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_quote"><div>But yeah, it's tricky either way - either you get them all, then opt out of all the warnings for test code you don't generally want.</div><div><br>I'll leave it to you, then - don't feel too strongly. Maybe worth seeing if Richard has an opinion, but up to you.<br><br>- Dave<br> </div><span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D45766" rel="noreferrer" target="_blank">https://reviews.llvm.org/D45766</a><br>
<br>
<br>
<br>
</blockquote></span></div></div>
</blockquote></div></div></div></blockquote></div></div>