This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] modernize-deprecated-headers should ignore system headers
ClosedPublic

Authored by steakhal on May 17 2022, 6:03 AM.

Details

Summary

The end-user has no way of 'fixing' bugs in the system library anyway.
Let's suppress these as well.

Diff Detail

Event Timeline

steakhal created this revision.May 17 2022, 6:03 AM
steakhal requested review of this revision.May 17 2022, 6:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2022, 6:03 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
clang-tools-extra/test/clang-tidy/checkers/modernize-deprecated-headers-extern-c.cpp
37

Where is this file? I can't find it in my tree.

D:\legalize\llvm\llvm-project\clang-tools-extra
> dir/s/b mysystemlib.h
File Not Found

Does this patch depend on some other unsubmitted patch?

steakhal updated this revision to Diff 430305.May 18 2022, 2:56 AM
steakhal marked an inline comment as done.
steakhal retitled this revision from [clang-tidy] modernize-deprecated-headers should ignore system headers to [clang-tidy] modernize-deprecated-headers should ignore system headers.

Rebased after changing the name of the option.

clang-tools-extra/test/clang-tidy/checkers/modernize-deprecated-headers-extern-c.cpp
37

D125209 should have included this file at clang-tools-extra/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/mysystemlib.h.

clang-tools-extra/test/clang-tidy/checkers/modernize-deprecated-headers-extern-c.cpp
37

OK, so it depends on D125209 .... why not just include these small changes in that?

Supposedly there is some way in phabricator to make one review dependent on another, but instead of being an expert in phabricator this change seems small enough to just fold into the other review, but perhaps opinions differ on that.

steakhal added inline comments.May 18 2022, 8:35 AM
clang-tools-extra/test/clang-tidy/checkers/modernize-deprecated-headers-extern-c.cpp
37

I set the 'parent revision', so the dependencies are present under the "Stack" tab. Sorry if I confused you.
I still think it's a logically separate issue, which should be addressed in a separate commit. That change is already quite confusing. I already had to ever it once, thus I want to keep the cognitive complexity as low as possible there. Same applies here.

Do you insist on merging these two?

clang-tools-extra/test/clang-tidy/checkers/modernize-deprecated-headers-extern-c.cpp
37

Nope, no insistence on my part. Just asking the question, which you've answered.

I never even noticed the "stack" tab in phabricator before.

Honestly, phabricator is not my favorite code reviewing tool, but it's what clang/llvm has chosen, so I live with it :)

steakhal marked 2 inline comments as done.May 18 2022, 9:31 AM

Thanks for the review @LegalizeAdulthood!
Can I consider this change accepted?

This revision is now accepted and ready to land.May 18 2022, 2:05 PM
This revision was landed with ongoing or failed builds.May 20 2022, 12:44 PM
This revision was automatically updated to reflect the committed changes.