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

making clang-tidy work properly again #3664

Merged
merged 13 commits into from Feb 7, 2019
Merged

making clang-tidy work properly again #3664

merged 13 commits into from Feb 7, 2019

Conversation

sithhell
Copy link
Member

@sithhell sithhell commented Feb 5, 2019

This PR makes sure that the code is properly checked with the below enabled checks:

 - All of bugprone except:
    - bugprone-assert-side-effect
    - bugprone-exception-escape
    - bugprone-forward-declaration-namespace
    - bugprone-macro-parentheses
 - Removing removed tests

This PR includes the fixes that appeared.

 - All of bugprone except:
    - bugprone-assert-side-effect
    - bugprone-exception-escape
    - bugprone-forward-declaration-namespace
    - bugprone-macro-parentheses
 - Removing removed tests
casting (double + 0.5) to integer leads to incorrect rounding; consider using
lround (#include <cmath>) instead [bugprone-incorrect-roundings,-warnings-as-errors]
casting (double + 0.5) to integer leads to incorrect rounding; consider using
lround (#include <cmath>) instead [bugprone-incorrect-roundings,-warnings-as-errors]
…ve constructors [bugprone-forwarding-reference-overload]
@@ -3,11 +3,19 @@
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Checks: '-*,modernize-use-nullptr,misc-use-after-move,misc-virtual-near-miss,misc-multiple-statement-macro,misc-move-constructor-init,misc-move-forwarding-reference,misc-assert-side-effect,misc-dangling-handle,misc-non-copyable-objects,misc-forwarding-reference-overload,misc-unused-raii'
Copy link
Contributor

Choose a reason for hiding this comment

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

Are all of the misc-* checks (except for misc-non-copyable-objects) part of bugprone-* now?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@@ -132,7 +132,7 @@ int hpx_main(variables_map& vm)
HPX_TEST(!any1.empty());
any any2(std::move(any1));
HPX_TEST(!any2.empty());
HPX_TEST(any1.empty());
HPX_TEST(any1.empty()); // NOLINT
Copy link
Contributor

Choose a reason for hiding this comment

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

What warnings did this cause?

Copy link
Member Author

Choose a reason for hiding this comment

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

use after move, which this code is explicitly testing for.

@@ -133,7 +133,7 @@ namespace hpx { namespace util
"[hpx]",
"location = ${HPX_LOCATION:$[system.prefix]}",
"component_paths = ${HPX_COMPONENT_PATHS}",
"component_base_paths = $[hpx.location]"
"component_base_paths = $[hpx.location]" // NOLINT
Copy link
Contributor

Choose a reason for hiding this comment

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

What warning did this cause?

Copy link
Member Author

Choose a reason for hiding this comment

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

use after move, which this code is explicitly testing for.

Copy link
Contributor

Choose a reason for hiding this comment

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

The one in tests/unit/util/any.cpp I get, but this? No test here...

Copy link
Member Author

Choose a reason for hiding this comment

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

grr, sorry. actually readin where you commented helps ;)
This was:
/home/heller/programming/hpx/src/util/runtime_configuration.cpp:136:13: error: suspicious string literal, probably missing a comma [bugprone-suspicious-missing-comma,-warnings-as-errors]

Copy link
Contributor

@msimberg msimberg left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

@sithhell sithhell merged commit 6213b68 into master Feb 7, 2019
@sithhell sithhell deleted the clang_tidy branch February 7, 2019 06:39
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.

None yet

2 participants