<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 26, 2017 at 5:44 PM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><span class="gmail-"><div dir="ltr">On Thu, Oct 26, 2017 at 3:18 PM Don Hinton <<a href="mailto:hintonda@gmail.com" target="_blank">hintonda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 26, 2017 at 2:48 PM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Seems fine, it would be nice if the workflow could be improved a little bit so that all you have to do is say `clangdiag break —error=“-Wcovered-switch”` or something .  I think that gives the most intuitive usage for people, even it’s a bit harder to implement.<br></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>The idea was to break on actual diagnostics emitted, but if you want to break on diagnostic usage, i.e., when it was checked but not emitted, I suppose that's possible as well.  diagtool doesn't produce a mapping for this, but it could be added -- assuming tablegen produced enough info in the .inc files to support it.  I added the feature I'm using here a few months ago, which was an extension to what Alex added earlier.</div></div></div></div></blockquote><div><br></div></span><div>That was my idea too.  But still, wouldn't it be possible to say `clangdiag break --error="-Wcovered-switch"` and then have it break only when the -Wcovered-switch diagnostic is *emitted*?</div></div></div></blockquote><div><br></div><div>Please give it a try, e.g., here are a few I tried:</div><div><br></div><div>clangdiag enable covered-switch-default</div><div>clangdiag enable c++11-compat</div><div><br></div><div>You can't pass the "-W" part since argparse thinks it's an option (can probably fix that if it's a problem), and you must provide the entire name.  You can get the available names from diagtool, e.g.:</div><div><br></div><div>diagtool list-warnings</div><div><br></div><div>Please let me know what you think, and thanks for suggesting it.</div><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>The reason I keep using this syntax though is because clang developers always think in terms of the warning names.  If you want to find out why a warning is being emitted amidst a spew of other warnings and errors, you really want to be able to specify the name of the warning.  </div><div><br></div><div>Don't get me wrong though, I do think this is a nice feature, I'm just thinking of ways to make it more compelling by looking at it from the clang developer's perspective and how they will most likely want to use it.</div><div><br></div><div>Also, I still think it should go in lldb, not in clang.  That's kind of exactly what the lldb/examples folder is for.</div><div><br></div><div>That said, lgtm, but I'm still interested to see if the workflow can be streamlined down the line.  Perhaps after it gets checked in you can make a PSA on cfe-dev@ and mention that you want people to try it out and offer feedback ;-)</div></div></div>
</blockquote></div><br></div></div>