Skip to content

Commit

Permalink
apacheGH-37107: [C++] Suppress an unused variable warning with GCC 7 (a…
Browse files Browse the repository at this point in the history
…pache#37240)

### Rationale for this change

If there is a warning, debug build is failed by default.

### What changes are included in this PR?

Suppress the unused warning explicitly. 

### Are these changes tested?

No.

### Are there any user-facing changes?

Yes.
* Closes: apache#37107

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
kou authored and loicalleyne committed Nov 13, 2023
1 parent 1044ca3 commit 00c30d0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cpp/src/arrow/util/ree_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ int64_t FindPhysicalLength(const RunEndCType* run_ends, int64_t run_ends_size,
int64_t length, int64_t offset) {
auto [_, physical_length] =
FindPhysicalRange<RunEndCType>(run_ends, run_ends_size, length, offset);
// GH-37107: This is a workaround for GCC 7. GCC 7 doesn't ignore
// variables in structured binding automatically from unused
// variables when one of these variables are used.
// See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81767
ARROW_UNUSED(_);
return physical_length;
}

Expand Down

0 comments on commit 00c30d0

Please sign in to comment.