Skip to content
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

Support recent GCC and Clang compilers #4426

Merged
merged 16 commits into from
Jan 24, 2022
Merged

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Jan 20, 2022

Description of changes:

  • improve code quality and compiler support
    • fix new compiler warnings revealed by GCC 12.0.0 and Clang 13.0.0
    • fix all compiler warnings that lead to build failures on Fedora 36 (effectively porting changes from rpms/espresso#4)
    • fix compiler and Clang-Tidy warnings -Wmissing-brace, -Wunused-variable, -bugprone-narrowing-conversions, bugprone-reserved-identifier, -modernize-return-braced-init-list
    • add support for CppCheck and fix most of its warnings
  • improve testing
    • implement unfinished unit tests (revealed by -Wunused-variable)
    • register es_math.py in the test suite (was never executed in CI)
    • create additional script interface unit tests

jngrad added 13 commits January 19, 2022 20:43
Fix shadowed global variables, use STL algorithms, remove
superfluous extern declarations, remove unused variables,
reduce scope of temporary variables.
Remove unused functions, arguments, struct members, local variables
and global variables (fixes all -Wunused-variable warnings and some
of the -Wunused-function and -Wunused-parameter warnings).
Macro names with leading underscores are protected.
ESPResSo feature guards only work when config.hpp is included.
Rename include guards to avoid leading underscores (triggers the
Clang-Tidy bugprone-reserved-identifier warning) and disambiguate
header files with similar names.
Make use of Utils::Vector3d::broadcast(), Vector comparison
operators and streaming method. Refactor IBM function. Fix
some of the -Wunused-parameter warnings and implicit float
conversions, including all -bugprone-narrowing-conversions.
Fix -modernize-return-braced-init-list and update list of
Clang-Tidy rules based on Clang 13.0.0.
@jngrad jngrad added this to the Espresso 4.2 milestone Jan 20, 2022
@jngrad jngrad marked this pull request as ready for review January 20, 2022 15:52
@jngrad jngrad requested a review from reinaual January 20, 2022 15:52
@jngrad jngrad changed the title Support modern compilers Support recent GCC and Clang compilers Jan 20, 2022
reinaual
reinaual previously approved these changes Jan 24, 2022
void GetIBMInterpolatedVelocity(const Utils::Vector3d &pos, Utils::Vector3d &v,
Utils::Vector3d &forceAdded) {
template <bool ReturnVelocity>
Utils::Vector3d GetIBMInterpolatedVelocity(Utils::Vector3d const &pos) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It is out of the scope for this PR but this function clearly is in a really bad state...

Factor out code duplication, convert unreachable throw statements
to assertions and reduce branching in LB, ELC, MDLC, P3M and DP3M
code. Add test cases for actor exceptions.
@jngrad jngrad added the automerge Merge with kodiak label Jan 24, 2022
@kodiakhq kodiakhq bot merged commit a59cdfa into espressomd:python Jan 24, 2022
@jngrad jngrad deleted the code-quality branch January 26, 2022 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants