ORC-2184: [C++] Add -Wno-unused-result to suppress Protobuf nodiscard build errors#2657
Closed
dongjoon-hyun wants to merge 1 commit into
Closed
ORC-2184: [C++] Add -Wno-unused-result to suppress Protobuf nodiscard build errors#2657dongjoon-hyun wants to merge 1 commit into
-Wno-unused-result to suppress Protobuf nodiscard build errors#2657dongjoon-hyun wants to merge 1 commit into
Conversation
…ard` build errors
dongjoon-hyun
added a commit
that referenced
this pull request
Jul 5, 2026
…ard` build errors ### What changes were proposed in this pull request? This PR aims to add `-Wno-unused-result` to `WARN_FLAGS` for `Clang` and `GCC`. ### Why are the changes needed? Recent Protobuf versions annotate `ZeroCopyInputStream::Skip()` with the `nodiscard` attribute, which breaks the build with `-Werror`. - https://github.com/apache/orc/actions/runs/27634606548/job/85193614775 ``` /Users/runner/work/orc/orc/c++/src/ColumnReader.cc:466:9: error: ignoring return value of function declared with 'nodiscard' attribute [-Werror,-Wunused-result] inputStream_->Skip(static_cast<int>(step)); ^~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ``` ### How was this patch tested? Verified manually that `ColumnReader.cc` compiles with the new flags. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Fable 5 Closes #2657 from dongjoon-hyun/ORC-2184. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Member
Author
|
Merged to branch-2.2 |
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.
What changes were proposed in this pull request?
This PR aims to add
-Wno-unused-resulttoWARN_FLAGSforClangandGCC.Why are the changes needed?
Recent Protobuf versions annotate
ZeroCopyInputStream::Skip()with thenodiscardattribute, which breaks the build with-Werror.How was this patch tested?
Verified manually that
ColumnReader.cccompiles with the new flags.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Fable 5