<div dir="ltr">On Wed, May 29, 2013 at 3:49 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On Wed, May 29, 2013 at 7:35 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div class="im"><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">
-Wunreachable-code doesn't warn on empty statement bodies for the<br>
switch.  So, for instance:<br>
<br>
int main() {<br>
  int i = 0;<br>
  switch(i) {}<br>
}<br>
<br>
yields no warnings in clang with -Wunreachable-code (or -Wall), but at<br>
/W3 in MSVC you get: warning C4060: switch statement contains no<br>
'case' or 'default' labels.  Will it catch lots of bugs?  Probably<br>
not.  But it also should have basically no false positives either.  It<br>
would be nice for people who want their code to also be warning-free<br>
under MSVC.</blockquote><div><br></div></div><div>I think we need more justification for adding the warning than this.</div><div><br></div><div>It doesn't seem reasonable to expect us to implement the union of all warnings which every existent compiler produces. Some of those warnings are really dumb. For instance, /W3 also enables C4800, which I don't think we will ever want to implement.</div>
</div></blockquote><div><br></div><div style>I agree that warning (forcing value to bool) is really, really bad, and I hope most serious projects turn it off.</div><div style><br></div><div style>However, I can say it's pretty annoying if you're working on cross-platform project and have to push to another platform to build just to get some compiler warnings for a compiler which you're expected to keep warning clean, value judgements about its diagnostic quality aside.  That cycle is long and painful, and if you skip it people often yell at you.</div>
<div style><br></div><div style>While clang will never be able to paper over the differences between platforms, having some off-by-default diagnostics like this could save users some time and increase the likelihood that their changes Just Work on the first push.</div>
</div></div></div>