[cfe-commits] r140574 - in /cfe/trunk: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td test/SemaCXX/warn-literal-conversion.cpp test/SemaCXX/warn-string-conversion.cpp

Chandler Carruth chandlerc at google.com
Mon Sep 26 18:10:14 PDT 2011


On Mon, Sep 26, 2011 at 4:39 PM, John McCall <rjmccall at apple.com> wrote:

> > The string literal to boolean conversion is a new warning.  There was
> > some discussion of where to put it, from literal-conversion or
> > bool-conversion.  I was moving it to its own flag so we can have the
> > warning while we figure out which of these places would be best for
> > it.
>
> 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.


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.

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110926/1e09c287/attachment.html>


More information about the cfe-commits mailing list