-
Notifications
You must be signed in to change notification settings - Fork 17
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
Clang tidy cleanup #276
Clang tidy cleanup #276
Conversation
0025788
to
4e84151
Compare
src/main.c
Outdated
@@ -86,10 +86,12 @@ static void usage(void) | |||
|
|||
} | |||
|
|||
#define WARN_ON_INVALID_CHECK_ID(id, desc)\ |
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.
I the do {} while(0)
trick seems tolerable when the macro isn't already a block, but I'm not really clear why it adds value here rather than just increasing the indent. What exactly is clang-tidy upset about?
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.
It's not a clang-tidy lint, but while looking at the empty statements warnings I also looked for macros with control flow logic to protect them against potential dangling-else problems.
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.
Doesn't using the
if (condition) {
code
}
style instead of
if(condition)
code
already protect against dangling else problems?
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.
Yes, it does.
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.
Then I think my preference would be to drop this commit. I'd love to take the rest of the PR if you want to push a version dropping this commit.
Not really relevant for single-threaded selint, but pleases clang-tidy.
Needed for size_t and strrchr(3) while processing with a LSP.
Drop unnecessary OOM check.
4e84151
to
91f3587
Compare
Merged, thanks! |
No description provided.