Thanks to visit codestin.com
Credit goes to github.com

Skip to content

added clang-tidy CI job and fixed warnings / added CMake option "DISABLE_CPP03_SYNTAX_CHECK" / CMake cleanups#248

Merged
danmar merged 12 commits into
cppcheck-opensource:masterfrom
firewave:clang-tidy
Aug 25, 2022
Merged

added clang-tidy CI job and fixed warnings / added CMake option "DISABLE_CPP03_SYNTAX_CHECK" / CMake cleanups#248
danmar merged 12 commits into
cppcheck-opensource:masterfrom
firewave:clang-tidy

Conversation

@firewave

@firewave firewave commented Mar 10, 2022

Copy link
Copy Markdown
Collaborator

The only interesting suppress warning is currently clang-analyzer-core.NullDereference since it depends on very complex value flow, might be a false positive and I didn't have the time to review it.

@firewave firewave force-pushed the clang-tidy branch 2 times, most recently from 60d1668 to 1f5572a Compare March 10, 2022 20:07
Comment thread simplecpp.cpp Outdated
}

simplecpp::TokenList::TokenList(const TokenList &other) : frontToken(nullptr), backToken(nullptr), files(other.files)
simplecpp::TokenList::TokenList(const TokenList &other)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to copy simplecpp in a separate PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped performance-move-constructor-init from this PR and will file a separate one.

@firewave firewave force-pushed the clang-tidy branch 2 times, most recently from 26a102f to 5f48d30 Compare March 14, 2022 12:58
@firewave

Copy link
Copy Markdown
Collaborator Author

@danmar This should be fine to merge now.

@firewave

Copy link
Copy Markdown
Collaborator Author

I disabled performance-inefficient-string-concatenation since that warning appears to have false positives - see llvm/llvm-project#54526. I was always curious about this warning but never had the time to properly look into it.

@danmar danmar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a small question

Comment thread simplecpp.cpp
return (filedata.find(header) != filedata.end()) ? simplecpp::simplifyPath(header) : "";
}

const std::string relativeFilename = getRelativeFileName(sourcefile, header);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wonder why you remove this const.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the performance-no-automatic-move check. If a variable is returned and it is declared const it cannot be moved but is copied instead.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the drawback is less safety. is a const reference a better solution perhaps?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will drop this for now.

@firewave

Copy link
Copy Markdown
Collaborator Author

This is ready for review again. I also updated and modernized the clang-tidy job.

Comment thread simplecpp.cpp
@danmar danmar merged commit ab59545 into cppcheck-opensource:master Aug 25, 2022
@firewave firewave deleted the clang-tidy branch August 25, 2022 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants