[cfe-commits] [PATCH] Remove -Wdisabled-macro-expansion

Eli Friedman eli.friedman at gmail.com
Mon Oct 29 20:38:36 PDT 2012


On Mon, Oct 29, 2012 at 7:46 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> On Mon, Oct 29, 2012 at 5:53 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>> Per subject, remove -Wdisabled-macro-expansion.  It's triggering on
>> normal uses of stdbool.h in C++ (at least, however normal it is to use
>> stdbool.h in C++). Because we're trying to encourage people to use
>> -Weverything,
>
> I share Chandler's concerns about this. Why are you doing that?
>
> In my experience, -Weverything is a great tool for "I just found a
> bug, could you have told me about it?" but not for much else (from an
> end-user's perspective). We have plenty of warnings which simply don't
> make sense for a lot of people (for instance, almost any use of any
> C++11 feature will generate some kind of warning), and it's not
> reasonable to remove them just to make -Weverything more
> user-friendly.

I think there's a reasonable workflow for small projects which
involves using -Weverything and subtracting out the warnings which
don't make sense.  I agree that there are limits to what we can/should
do with -Weverything; I'm not trying to argue for getting rid of
warnings because they make -Weverything too noisy.  On the other hand,
I think we should have a high standard for the usefulness of
off-by-default warnings.  And I think that there's future
infrastructure work we can do both to help people write higher quality
code.

>> it isn't acceptable for it to trigger warnings for usage
>> of headers included with the compiler, and as far as I can tell, there
>> isn't any way to fix the header. (See patch for a testcase that
>> checks we don't trigger any warnings from stdbool.h.)
>>
>> I'm planning to commit this unless someone has an alternative suggestion.
>
> Could you suppress the warning if the spelling location for the token
> which would have been expanded is in a system header?

I think that would end up being more confusing than helpful because it
suppresses some, but not all, loops involving system macros.

I would put more effort into this if I thought it was generally
useful, but the fact that it isn't on by default, and that the headers
included with clang manage to trigger it, and there isn't any specific
class of users this is useful for, all indicate it isn't worth the
effort.

-Eli



More information about the cfe-commits mailing list