This is an archive of the discontinued LLVM Phabricator instance.

Split -Wmicrosoft into many detailed warnings.
ClosedPublic

Authored by thakis on Jul 25 2015, 3:10 PM.

Details

Reviewers
majnemer
rnk
Summary

-Wmicrosoft currently covers many different areas, some more useful than others. Split it into many targeted flags, so that projects can choose to enable only a subset of these warnings. This is also useful for incrementally fixing and turning on these warnings.

-Wno-microsoft still disables all these warnings, and -Wmicrosoft still enables them all. After this change, it's possible to pass -Wno-microsoft -Wmicrosoft-unqualified-friend to only enable -Wmicrosoft-unqualified-friend, and -Wmicrosoft -Wno-microsoft-unqualified-friend to enable all other Microsoft warnings.

I put all the template-related warnings behind -Wmicrosoft-template; if that turns out to be too coarse we can make that finer later on. (In practice, I haven't seen the template-related warnings fire frequently.)

We might want to tweak -Wmicrosoft-enum-value in the future, it's the only of all of the -Wmicrosoft warnings that doesn't seem useful in practice.

Diff Detail

Event Timeline

thakis updated this revision to Diff 30637.Jul 25 2015, 3:10 PM
thakis retitled this revision from to Split -Wmicrosoft into many detailed warnings..
thakis updated this object.
thakis added a reviewer: rnk.
thakis added a subscriber: cfe-commits.
rnk edited edge metadata.Jul 27 2015, 10:46 AM

This feels too fine-grained to me, but I could be convinced either way. Someone somewhere will probably be thankful that they can turn off *just* -Wmicrosoft-void-pseudo-destructor. @majnemer, what do you think?

include/clang/Basic/DiagnosticGroups.td
722

I think we can merge this with MicrosoftExceptionSpec, they are both about EH specification relaxations.

724

Let's kill this, we can use the -Wignored-pragmas group for it.

include/clang/Basic/DiagnosticParseKinds.td
944

Let's put this in the IgnoredPragmas group.

In D11504#212667, @rnk wrote:

This feels too fine-grained to me, but I could be convinced either way. Someone somewhere will probably be thankful that they can turn off *just* -Wmicrosoft-void-pseudo-destructor. @majnemer, what do you think?

Fairly fine-grained flags are consistent with the -Wgnu flags and clang's warning flags philosophy in general. Merging the ones you pointed out sounds good to me though.

thakis updated this revision to Diff 30709.Jul 27 2015, 11:15 AM
thakis edited edge metadata.
thakis marked 3 inline comments as done.

Address comments.

rnk accepted this revision.Jul 27 2015, 3:30 PM
rnk edited edge metadata.

Sounds good, let's go with these then.

This revision is now accepted and ready to land.Jul 27 2015, 3:30 PM
thakis closed this revision.Jul 27 2015, 7:38 PM

r243371