-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add first .clang-tidy file #2847
Conversation
028b49b
to
91bb5f0
Compare
@JuergenReppSIT @AndreasFuchsTPM cirrus keeps failing on me, but otherwise the CI is happy. What do you think of this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seams to dislike leading _
This is especially bad in the cases of API incompatibilities.
@AndreasFuchsTPM TLDR; it is undefined behavior since those identifiers are reserved (for stdlib and compiler i guess). Here's what the C standard says (section 7.1.3):
And further:
Clang-tidy checks that via rule bugprone-reserved-identifier.
|
Understood. For the rest: I guess they make sense, BUT we'd need to roll 3.0 for this. The big question is: Is it worth to go to 3.0 over this ? |
Maybe we could first split the PR and extract the "real" bugfxes? |
1e31c32
to
3852344
Compare
@JuergenReppSIT Alright, I split the changes. The API braking changes are currently on joholl/tpm2-tss@clang_tidy_api_changes. I'm going to submit a PR once this is merged. We could roll that out when we roll a new major version anyway due to another API change (@AndreasFuchsTPM I assume you meant 5.0). Any more feedback? |
@joholl Scan-Build complains about
|
Add clang-tidy config which makes clang-tidy succeed for calling: run-clang-tidy-14 src/**/*.c Signed-off-by: Johannes Holland <johannes.holland@infineon.de>
Signed-off-by: Johannes Holland <johannes.holland@infineon.de>
Signed-off-by: Johannes Holland <johannes.holland@infineon.de>
Signed-off-by: Johannes Holland <johannes.holland@infineon.de>
Signed-off-by: Johannes Holland <johannes.holland@infineon.de>
Signed-off-by: Johannes Holland <johannes.holland@infineon.de>
Fixes: tpm2-software#2826 Signed-off-by: Johannes Holland <johannes.holland@infineon.de>
Signed-off-by: Johannes Holland <johannes.holland@infineon.de>
Signed-off-by: Johannes Holland <johannes.holland@infineon.de>
Add a
.clang-tidy
file with some of the less opinionated check. Fix the linting issues (one commit per check).For linting, I don't call clang-tidy directly, but the official python script for multi-core support. You can add
-fix
for automatic fixing.For now, I focused on
src/
, but nottest/
Fixes: #2826