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

Address (most) warnings on Clang #61

Merged
merged 7 commits into from
Oct 17, 2020

Conversation

drbenmorgan
Copy link
Contributor

In building Bayeux for SuperNEMO with the latest Clang compiler, a huge number of warnings are emitted through it implementing a stricter set of checks than GCC (at least up to GCC7). These are mostly straightforward and related to missing overrides on overriden virtual functions, unused variables, and avoiding copies in range-based for loops. The remaining warnings will be noted in Issues here and bxdecay0, and cross-referenced.

For reference, clang-tidy implements the use of override per the CPP Core Guidelines, and discussion at these links:

The move from virtual fun(); to fun() override; may look odd at first, but the first link makes the rationale clear.

Classes should use override keyword to mark overriden virtual
functions.

Remove i_clonable macros from mygsl classes that do not use these
and do not inherit from i_cloneable anyway.
Classes inhertiing from i_serializable require override of virtual
get_serial_tag member function. However, some classes do not inherit
this base class and so must not mark this member function as override.

Create seperate macros for the override/non-override cases and apply
to classes as needed.
Use override consistently for overriden virtual functions. Use tidy
and ISO C++ Core Guideline C.128 so that destructors are treated
the same way. See:

- http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rh-override
- isocpp/CppCoreGuidelines#1448
- isocpp/CppCoreGuidelines#1446
- isocpp/CppCoreGuidelines#721 (comment)
- Missing overrides
- const auto& in loops
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