Reduce Warnings - Miscellaneous GCC and Clang Warnings (CDRIVER-5305) #1543
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.
This PR addresses miscellanous GCC and Clang warnings. Verified by this patch.
Many of these warnings are not normally enabled and have relatively low significance, but imo are worth addressing regardless to improve the quality of the codebase.
Each commit in this PR documents the number of warnings addressed according to GCC 11.4 and Clang 15.0 Of course, the numbers are specific to my machine, environment, and project configuration, but they help describe the scope of impact.
Warnings in bundled library source code (specifically jsonsl) are left as-is.
In total, this PR addresses 21 GCC warnings and 1058 Clang warnings on my machine.
Most changes are fairly straightforward and rather mundane.
However, a few changes deserve greater scrutiny from the rest, just in case:
BSON_THREAD_RETURN
inBSON_THREAD_FUN (insert_docs, p)
in test-mongoc-sample-commands.c (double-check: continues to behave as expected?).bson_md5_process
in common-md5.c (double-check: continues to behave as expected?).error
parameter in_needs_on_demand_aws_kms
in mongoc-crypt.c (double-check: no error handling required?).