HuaHuaY commented on code in PR #51266:
URL: https://github.com/apache/arrow/pull/51266#discussion_r3985455008
##########
cpp/src/arrow/compute/kernels/vector_hash.cc:
##########
@@ -136,7 +136,7 @@ class ValueCountsAction final : ActionBase {
}
template <class Index>
- void ObserveNullNotFound(Index index) {
+ [[maybe_unused]] void ObserveNullNotFound(Index index) {
Review Comment:
I added `[[maybe_unused]]` to avoid `-Wunused-template`, which differs from
Copilot's suggestion. The issue reported by Copilot does not prevent
compilation (I didn't even see a warning; I assume it's because the template
function isn't instantiated anywhere). Without the changes we will get:
```cpp
[build] [3/102] Building CXX object
src/arrow/CMakeFiles/arrow_compute_core.dir/compute/kernels/vector_hash.cc.o
[build] FAILED: [code=1]
src/arrow/CMakeFiles/arrow_compute_core.dir/compute/kernels/vector_hash.cc.o
[build] sccache
/nix/store/s8j4m3bnnqa6lznxd9c4j3043q3rj8my-clang-wrapper-23.1.0/bin/clang++
-DARROW_EXTRA_ERROR_CONTEXT -DARROW_HAVE_NEON -DARROW_WITH_TIMING_TESTS
-I/Users/huahua/github/arrow/cpp/out/build/ninja-debug-gandiva/src
-I/Users/huahua/github/arrow/cpp/src -fno-aligned-new -Qunused-arguments
-fcolor-diagnostics -Wall -Wextra -Wdocumentation -DARROW_WARN_DOCUMENTATION
-Wshorten-64-to-32 -Wno-missing-braces -Wno-unused-parameter
-Wno-constant-logical-operand -Wno-return-stack-address -Wdate-time
-Wno-unknown-warning-option -Wno-pass-failed -march=armv8-a -g -Werror -O0
-ggdb -std=c++20 -arch arm64 -isysroot
/nix/store/52kwxj456mb1ygjn9nkgm93a17si3ks4-apple-sdk-14.4/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
-mmacosx-version-min=14.0 -fPIC -MD -MT
src/arrow/CMakeFiles/arrow_compute_core.dir/compute/kernels/vector_hash.cc.o
-MF
src/arrow/CMakeFiles/arrow_compute_core.dir/compute/kernels/vector_hash.cc.o.d
-o src/arrow/CMakeFiles/arrow_compute_core.dir/compute/
kernels/vector_hash.cc.o -c
/Users/huahua/github/arrow/cpp/src/arrow/compute/kernels/vector_hash.cc
[build]
/Users/huahua/github/arrow/cpp/src/arrow/compute/kernels/vector_hash.cc:139:8:
error: unused function template 'ObserveNullNotFound'
[-Werror,-Wunused-template]
[build] 139 | void ObserveNullNotFound(Index index) {
[build] | ^~~~~~~~~~~~~~~~~~~
[build] 1 error generated.
[build] ninja: build stopped: subcommand failed.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]