-
Notifications
You must be signed in to change notification settings - Fork 66
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
Static Analysis #546
Static Analysis #546
Conversation
Transfering work in progress on handling broken promise exceptions between machines.
Changed the await() and await_for interface to take an rvalue references. Use `move()` or `copy()` when calling with an lvalue. (This change generated a lot of test changes!). Fixes to future coroutine support to correctly report exceptions. Check box items should be in a subsequent PR [] Support waiting for multiple futures directly.
Fixed up remaining clang-tidy issues. Added (back) await and await_for with implicit copy as deprecated APIs.
Just reading the summary it seems like a lot of changes that could've been separate PR's, for example, a clang tidy pass seems like a different topic from fixing the bug. |
Unfortunately, it doesn't work in .hpp files :-(
Yes - it should have been about 5 PRs. It started with "could clang-tidy find the same issue as Coverity" (answer, not that I've been able to determine) - and snowballed. |
FYI I ran clang-tidy locally over these changes and it seems to work. The presets are nice. Haven't had time yet to review the changes themselves, though. |
Going to take the heat for pushing my own oversized PR... |
This PR was started to address an issue reported by Covarity regarding the exception handling in the future reduction code. It led to a rewrite of the future reduction code, the inclusion of clang-tidy and clang-tidy fixes in the CMake setup, and several other changes:
API Changes
package()
will now reduce futures (future<future> -> future). All APIs that return futures now reduce the future.await()
andawait_for()
take thefuture
by rvalue-ref. They now take it by rvalue-ref with deprecated overloads for const-ref for compatibility. I'm moving away from implicit copies. Usestlab::copy()
orstd::move()
as appropriate to upgrade to the new interface.[[nodiscard]]
to many interfaces. In general, these should catch misuse.get_ready()
API tofuture
that can be used in a recover() clause or when the future is known to be ready. It asserts the future is ready and would be a race to invoke on a non-ready future.Fixes
task(const task&&)
is now deleted, which avoids a bad recursive runtime error if you attempt to copy a task.future<>
with C++20 coroutines, exceptions are now correctly reported.forest
is now atomic. Aconst forest
can be safely shared across threads.Improvements
cert-*
,performance-*
, andmodernize*-
checks for C++17.