kou commented on code in PR #41359:
URL: https://github.com/apache/arrow/pull/41359#discussion_r1580669445
##########
cpp/src/arrow/device.h:
##########
@@ -150,9 +150,10 @@ class ARROW_EXPORT Device : public
std::enable_shared_from_this<Device>,
/// @param release_fn a function to call during destruction, `nullptr` or
/// a no-op function can be passed to indicate ownership is maintained
/// externally
- virtual Result<std::shared_ptr<Stream>> WrapStream(
- [[maybe_unused]] void* device_stream,
- [[maybe_unused]] Stream::release_fn_t release_fn) {
+ virtual Result<std::shared_ptr<Stream>> WrapStream(void* device_stream,
+ Stream::release_fn_t
release_fn) {
+ ARROW_UNUSED(device_stream);
+ ARROW_UNUSED(release_fn);
Review Comment:
Oh... How about this?
```diff
diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake
b/cpp/cmake_modules/SetupCxxFlags.cmake
index d56609c123..ea357b4779 100644
--- a/cpp/cmake_modules/SetupCxxFlags.cmake
+++ b/cpp/cmake_modules/SetupCxxFlags.cmake
@@ -314,6 +314,7 @@ if("${BUILD_WARNING_LEVEL}" STREQUAL "CHECKIN")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wall")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wextra")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wdocumentation")
+ set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -DARROW_WARN_DOCUMENTATION")
if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
# size_t is 32 bit in Emscripten wasm32 - ignore conversion errors
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-shorten-64-to-32")
diff --git a/cpp/src/arrow/util/macros.h b/cpp/src/arrow/util/macros.h
index d80828869b..6faf25b3c9 100644
--- a/cpp/src/arrow/util/macros.h
+++ b/cpp/src/arrow/util/macros.h
@@ -67,7 +67,11 @@
// [5] J. Doerfert et al. 2019. "Performance Exploration Through Optimistic
Static
// Program Annotations".
https://github.com/jdoerfert/PETOSPA/blob/master/ISC19.pdf
#define ARROW_UNUSED(x) (void)(x)
+#ifdef ARROW_WARN_DOCUMENTATION
+#define ARROW_ARG_UNUSED(x) (x)
+#else
#define ARROW_ARG_UNUSED(x)
+#endif
#if defined(__GNUC__) // GCC and compatible compilers (clang, Intel ICC)
#define ARROW_NORETURN __attribute__((noreturn))
#define ARROW_NOINLINE __attribute__((noinline))
```
--
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]