fix: gcc-11 build issues/warnings in thread-pool-cpp - #6
Merged
Conversation
- undeclared symbol pow in thread_pool_options.hpp - warning about catching polymorphic exception by value (WorkerStoppedException) in worker.hpp - warning about test assertion comparing signed non-negative literal to unsigned result in tests fixed_function.t.cpp and thread_pool_options.t.cpp - invalid type argument of unary * operator due to dereferencing an already dereferenced pointer in test thread_pool.t.cpp
jasper-yeh
commented
Jun 14, 2022
| inline ThreadPoolOptions::BusyWaitOptions::IterationFunction ThreadPoolOptions::BusyWaitOptions::defaultIterationFunction() | ||
| { | ||
| return [](size_t i) { return std::chrono::microseconds(static_cast<size_t>(pow(2, i))*1000); }; | ||
| return [](size_t i) { return std::chrono::microseconds(static_cast<size_t>(std::pow(2, i))*1000); }; |
Member
Author
There was a problem hiding this comment.
probably only ever worked because our own usages included <cmath> and imported the std namespace?
jasper-yeh
commented
Jun 14, 2022
| } | ||
| } | ||
| catch (WorkerStoppedException) | ||
| catch (WorkerStoppedException const&) |
Member
Author
There was a problem hiding this comment.
catch polymorphic exception by reference
jasper-yeh
commented
Jun 14, 2022
| ASSERT_EQ(0u, cop); | ||
| ASSERT_EQ(6u, mov); | ||
| ASSERT_EQ(0u, cop_ass); | ||
| ASSERT_EQ(0u, mov_ass); |
Member
Author
There was a problem hiding this comment.
these would raise warnings about comparison between signed (the literal) and unsigned (the variable of type size_t)
doxxx
approved these changes
Jun 15, 2022
stewartbright
approved these changes
Jun 15, 2022
jasper-yeh
deleted the
synaptive/dev/jasper/COM-822-fix-gcc-11-build-issues
branch
June 15, 2022 15:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes some build issues/warnings encountered under gcc-11.
Also updates googletest submodule to release tag 1.11.0 (also to resolve gcc-11 build warnings)