<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Sep 26, 2011, at 6:10 PM, Chandler Carruth wrote:</div><blockquote type="cite"><div class="gmail_quote">On Mon, Sep 26, 2011 at 4:39 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
<div class="im">> The string literal to boolean conversion is a new warning.  There was<br>
> some discussion of where to put it, from literal-conversion or<br>
> bool-conversion.  I was moving it to its own flag so we can have the<br>
> warning while we figure out which of these places would be best for<br>
> it.<br>
<br>
</div>Okay, as long as it doesn't stay there.  And for next time, it's fine to just let it sit in one or the other until the discussion is done, I think.</blockquote></div><br><div>This was largely my request to Richard. Essentially, -Wliteral-conversion fires a great deal, with a high false-positive rate. We're considering turning it on anyways, but I can imagine a lot of code may never be interested in turning that set of warnings on.</div>
<div><br></div><div>However, -Wbool-conversion and this new warning Richard added were based on specific bug reports. We've found hundreds of bugs with these two warnings, and very few false-positives. I originally suggested just putting both of these under 'bool-conversion' even though one is converting from a bool to a pointer, and the other from a pointer to a bool. I would be happy with consolidating them into any flag name that seems appropriate and sufficiently descriptive. My only real goal is to keep the extremely high-value warnings available even when -Wliteral-conversion (much less the even more noisy variants) aren't feasible for a codebase.</div>
</blockquote></div><br><div>So let me turn this around.  False-to-pointer and string-literal-to-bool conversions are both clearly under the rubric of -Wliteral-conversion.  I can understand not wanting to turn on a category with massive false positives, but, well, massive false positives are a fixable problem.  Why don't we just put the noisy cases into their own categories, not part of -Wliteral-conversion, and then move them back in if/when we fix their problems?</div><div><br></div><div>John.</div></body></html>