Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-37107: [C++] Suppress an unused variable warning with GCC 7 #37240

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

kou
Copy link
Member

@kou kou commented Aug 18, 2023

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.

@kou
Copy link
Member Author

kou commented Aug 18, 2023

@c0dzilla Could you confirm this with GCC 7?

@github-actions
Copy link

⚠️ GitHub issue #37107 has been automatically assigned in GitHub to PR creator.

@c0dzilla
Copy link

@kou confirmed that this works on g++ 7.3:

codzilla@hogwarts:~/arrow/cpp/build$ git diff
diff --git a/cpp/src/arrow/util/ree_util.h b/cpp/src/arrow/util/ree_util.h
index 5a24024..c6bb4e5 100644
--- a/cpp/src/arrow/util/ree_util.h
+++ b/cpp/src/arrow/util/ree_util.h
@@ -104,6 +104,7 @@ 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);
+  ARROW_UNUSED(_);
   return physical_length;
 }
 
codzilla@hogwarts:~/arrow/cpp/build$ cmake --build .
Recompacting log...
[91/91] Creating library symlink debug/libarrow.so.1300 debug/libarrow.so

@kou
Copy link
Member Author

kou commented Aug 18, 2023

Thanks!

@kou kou merged commit 6c660a5 into apache:main Aug 18, 2023
30 of 33 checks passed
@kou kou deleted the cpp-gcc-7-warning branch August 18, 2023 20:28
@kou kou removed the awaiting committer review Awaiting committer review label Aug 18, 2023
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 6c660a5.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them.

loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[C++] Compilation error [building from source] in Arrow C++ debug build due to unused variable
2 participants