[cfe-dev] proposal: every warning should have a -W flag

Chandler Carruth chandlerc at google.com
Wed Aug 10 15:32:32 PDT 2011


On Tue, Aug 9, 2011 at 4:58 PM, Ted Kremenek <kremenek at apple.com> wrote:

> (1) We aim to gradually put all existing warnings under a -W flag.
>  Multiple (related) warnings can be placed under the same -W flag (as they
> are often done now), but the main idea is to allow users to control these
> warnings.
>
> (2) We require all new warnings to include a -W flag the moment they are
> added to Clang.  We can enforce this by using diagtool in our tests (e.g.,
> verify that the set of warnings without flags hasn't changed).
>

I love this. It's been unwritten policy for the warnings we're adding, and I
think it'd be good to do it generally.

I'll particularly like that we can test and ensure that new warnings are
always given a flag. =] Hopefully we can help move some of the warnings
under flags that aren't yet.


Regarding the unique-ID-per-warning discussion (which was a bit of a
tangent), I think more data in the already busy warning messages would be
unfortunate. As we already print the flag name in most cases, I'd rather see
documentation use the flag name as a searchable bucket, and then a list of
example warning text and code triggering it so that people can quickly find
the warning they're hitting. Then we might provide facilities to re-generate
the documentation by re-running Clang over the examples, thus easing the
process of keeping the documentation up to date with the latest spelling of
the message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110810/d172ffb8/attachment.html>


More information about the cfe-dev mailing list