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

Aaron Ballman aaron at aaronballman.com
Tue Aug 9 16:11:39 PDT 2011


On Tue, Aug 9, 2011 at 5:49 PM, Douglas Gregor <dgregor at apple.com> wrote:

>>> This, of course, is predicated on the thought that having individual
>>> warning numbers is useful to the majority of people.  From personal
>>> experience, I like having a warning number because it makes it easier
>>> to Google for others who've had the same issue.  Most diagnostics
>>> contain source-specific information, and so Google searches become a
>>> guessing game of what keywords are important.  YMMV
>>
>> But yes, this is the selling point for having numbered diagnostics.
>
> This is the selling point of having a unique searchable name. It doesn't have to be an otherwise-meaningless number.

Definitely agreed.  I think the hard part is the uniqueness of the
names.  You don't run into that with meaningless numbers.  But as was
pointed out, suppressing random numbers in code isn't exactly the best
thing ever either.  So in that regard, unique names are definitely
preferred.

>> I
>> do actually prefer the named diagnostics that clang uses in both
>> compiler output and pragma suppressions - they're more
>> self-documenting (when I look through a make file & see suppressions
>> for 3 different VC warnings as just numbers - they either have to have
>> comments or I have to google up the docs to see what they do. With
>> clang I don't get random numbers in my compiler messages, instead I
>> get a nice string telling me the name of the warning so I can suppress
>> it if I want (or turn it on if I'm not seeing that in another build)).
>>
>> & the names clang uses should be fairly searchable (obviously as clang
>> usage increases & these sort of questions turn up in documentation,
>> forums, etc, more)
>
>
> Yeah, agreed on all points.

I'm sold.  :-)

~Aaron




More information about the cfe-dev mailing list