894: Fix error-reporting crash in non-blocking connection. #895
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: #894
If construction of a non-blocking
connection
failed for a reason other than an out-of-memory error, then reporting of the error would fail. This happened because the error-reporting code tried to read the error message after it had already cleared the connection pointer. This means reading deallocated memory.There was an unrelated complication. In maintainer mode (extra-strict compiler options), the
binarystring
unit test elicits a warning from clang:binarystring
is deprecated. Yeah duh. There shouldn't be a warning because that piece of test code (like many others) is bracketed in "ignore deprecation" directives. In just this one case, for just this one compiler, that doesn't seem to do the trick. In the end I just disabled that one test for that one compiler. Hate to do it, but this is deprecated code so it's going away anyway.Oh, and the build also broke because clang 19 in C++17 and C++20 enables the feature test macro for the
assume
attribute... but then issues a warning in maintainer mode when you actually use the attribute. Which again in maintainer mode means that the build fails.