This is an archive of the discontinued LLVM Phabricator instance.

[PATCH] Add a CERT category for clang-tidy checkers
ClosedPublic

Authored by aaron.ballman on Oct 1 2015, 9:45 AM.

Details

Summary

CERT produces a set of secure coding rules and recommendations for both C (https://www.securecoding.cert.org/confluence/display/c/SEI+CERT+C+Coding+Standard) and C++ (https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=637). One of the tasks we've been doing lately is mapping existing checks to our rules, as well as coming up with new checks where there is insufficient existing coverage for a rule.

This patch adds a new module so that users can enable CERT-specific checkers by using -checks=-*,cert-*. Currently, this is remapping existing checkers under a new name that matches the CERT guideline the checker matches. However, this also is a convenient place for us to hang CERT-specific rules that do not apply elsewhere.

This patch does not come with any tests because the only thing we could test is the name change for reported diagnostics, and I wasn't certain whether that was worth testing.

One thing this patch does not do is enable tests for static analyzer checkers under new names. For instance, I would like to have a way to map clang-analyzer-unix.Malloc to cert-mem34-c, but that seems slightly more involved, and so I intend to do this in a follow-up patch.

~Aaron

Diff Detail

Event Timeline

aaron.ballman retitled this revision from to [PATCH] Add a CERT category for clang-tidy checkers.
aaron.ballman updated this object.
aaron.ballman added reviewers: alexfh, sbenza.
aaron.ballman added a subscriber: cfe-commits.
klimek accepted this revision.Oct 2 2015, 6:24 AM
klimek added a reviewer: klimek.
klimek added a subscriber: klimek.

lg

This revision is now accepted and ready to land.Oct 2 2015, 6:24 AM
aaron.ballman closed this revision.Oct 2 2015, 6:30 AM

Thanks! I've commit in r249130.

Do we want to have code owners for this sort of thing, or is that too fine-grained of a concept? If we do want them, I am (obviously) happy to be the code owner for anything in the CERT directory.

~Aaron

klimek added a comment.Oct 2 2015, 6:59 AM

I dont think we need finer grained code owners, but I also don't have real
objections.