From 6c660a5d5cd5ae5cf41a6a211517ed98911885e3 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sat, 19 Aug 2023 05:28:17 +0900 Subject: [PATCH] GH-37107: [C++] Suppress an unused variable warning with GCC 7 (#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: #37107 Authored-by: Sutou Kouhei Signed-off-by: Sutou Kouhei --- cpp/src/arrow/util/ree_util.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpp/src/arrow/util/ree_util.h b/cpp/src/arrow/util/ree_util.h index 5a240240b859f..a3d3d16c0da95 100644 --- a/cpp/src/arrow/util/ree_util.h +++ b/cpp/src/arrow/util/ree_util.h @@ -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(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; }