build: silence -Wextra warnings across the library, tests and examples - #246
Merged
Merged
Conversation
Best-effort AbortMultipartUpload cleanups on failure paths and RemoveBucket cleanups in tests now discard their nodiscard Result explicitly. The error-carrying ListObjectsResult/RemoveObjectsResult constructors and GetErrorResponse's resource parameter are marked maybe_unused; the signatures stay as-is since BaseClient::GetErrorResponse is public API. Verified 0 warnings with -Wall -Wextra -Wconversion across C++17, C++20 (MINIO_CPP_STD=20) and MINIO_CPP_ENABLE_RDMA=ON builds.
📝 WalkthroughWalkthroughThe changes make intentionally unused parameters and ignored ChangesCompiler warning cleanup
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Aug 12, 2026
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.
-Wall -Wextra -Wconversionare unconditional inCMakeLists.txt, and the tree currently emits 15 warnings (7 in the library, 8 in the tests). This clears all of them.Changes
src/client.cc— the four best-effortAbortMultipartUpload(amu_args)cleanup calls on failure paths now discard their[[nodiscard]]Resultexplicitly with(void), matching existing precedent inhttp.cc:71andresponse.cc:615.tests/tests.cc— same treatment for the 8client_.RemoveBucket(args)cleanup calls.src/client.cc— the two error-carryingListObjectsResult/RemoveObjectsResultconstructors take[[maybe_unused]] error::Error err.src/baseclient.cc—GetErrorResponse's unusedresourceparameter takes[[maybe_unused]]. The signature is left intact:BaseClient::GetErrorResponseis public and reachable from downstream C glue.Touched files were run through
clang-format.Verification
Warning counts with
-Wall -Wextra -Wconversion, GCC 14.2.0 on Linux/x86_64:MINIO_CPP_STD=20) — all targetsMINIO_CPP_ENABLE_RDMA=ONRelease — all targets, incl.src/c_api.ccFollow-up, not addressed here
[[maybe_unused]]on the two result constructors silences the warning but does not restore the dropped error. 3d21189 removed the lines that carried it:ListObjectsResult:resp_->contents.push_back(Item(std::move(err)))RemoveObjectsResult:resp_.errors.push_back(DeleteError(err))So
ListObjectswith an invalid argument is now indistinguishable from an empty bucket. This is not only the validate path —StartPrefetchcatches every exception and returns an emptyListObjectsResponse, andPopulatesetsfailed_ = trueeither way, so a 403 or a network failure looks identical too.That means a simple
GetError()accessor fed only from the validate constructor would be worse than none — it would authoritatively report "no error" for a 403. A real fix needs an error channel out of the prefetch future, which changes the type atclient.h:44-45. Left for a separate PR.Summary by CodeRabbit