You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by pa...@apache.org on 2024/01/20 23:56:05 UTC
(arrow-nanoarrow) branch main updated: fix: Suppress unused parameter warnings (#365)
This is an automated email from the ASF dual-hosted git repository.
paleolimbot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-nanoarrow.git
The following commit(s) were added to refs/heads/main by this push:
new 0a7edce5 fix: Suppress unused parameter warnings (#365)
0a7edce5 is described below
commit 0a7edce59892f8307f8e16644d44aa86acd8b980
Author: William Ayd <wi...@icloud.com>
AuthorDate: Sat Jan 20 18:55:59 2024 -0500
fix: Suppress unused parameter warnings (#365)
When using as a dependency and trying to use Wextra these generate
warnings
---------
Co-authored-by: Dewey Dunnington <de...@fishandwhistle.net>
---
CMakeLists.txt | 2 --
src/nanoarrow/array_inline.h | 2 ++
src/nanoarrow/array_stream.c | 1 +
src/nanoarrow/nanoarrow_types.h | 2 ++
src/nanoarrow/utils.c | 8 ++++++++
5 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e72225d9..fbcbe708 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -129,7 +129,6 @@ else()
-Wextra
-Wpedantic
-Wno-type-limits
- -Wno-unused-parameter
-Wmaybe-uninitialized
-Wunused-result
-Wconversion
@@ -142,7 +141,6 @@ else()
-Wextra
-Wpedantic
-Wdocumentation
- -Wno-unused-parameter
-Wconversion
-Wno-sign-conversion)
endif()
diff --git a/src/nanoarrow/array_inline.h b/src/nanoarrow/array_inline.h
index aaf3e253..fa62f324 100644
--- a/src/nanoarrow/array_inline.h
+++ b/src/nanoarrow/array_inline.h
@@ -53,11 +53,13 @@ static inline struct ArrowBuffer* ArrowArrayBuffer(struct ArrowArray* array, int
// is made.
static inline int8_t _ArrowArrayUnionChildIndex(struct ArrowArray* array,
int8_t type_id) {
+ NANOARROW_UNUSED(array);
return type_id;
}
static inline int8_t _ArrowArrayUnionTypeId(struct ArrowArray* array,
int8_t child_index) {
+ NANOARROW_UNUSED(array);
return child_index;
}
diff --git a/src/nanoarrow/array_stream.c b/src/nanoarrow/array_stream.c
index 6adea222..b7eeaac8 100644
--- a/src/nanoarrow/array_stream.c
+++ b/src/nanoarrow/array_stream.c
@@ -57,6 +57,7 @@ static int ArrowBasicArrayStreamGetNext(struct ArrowArrayStream* array_stream,
static const char* ArrowBasicArrayStreamGetLastError(
struct ArrowArrayStream* array_stream) {
+ NANOARROW_UNUSED(array_stream);
return NULL;
}
diff --git a/src/nanoarrow/nanoarrow_types.h b/src/nanoarrow/nanoarrow_types.h
index 0d5085f2..33c51bba 100644
--- a/src/nanoarrow/nanoarrow_types.h
+++ b/src/nanoarrow/nanoarrow_types.h
@@ -195,6 +195,8 @@ struct ArrowArrayStream {
#define NANOARROW_CHECK_PRINTF_ATTRIBUTE
#endif
+#define NANOARROW_UNUSED(x) (void)(x)
+
/// \brief Return code for success.
/// \ingroup nanoarrow-errors
#define NANOARROW_OK 0
diff --git a/src/nanoarrow/utils.c b/src/nanoarrow/utils.c
index 2a17d25e..b5ae8e81 100644
--- a/src/nanoarrow/utils.c
+++ b/src/nanoarrow/utils.c
@@ -192,11 +192,15 @@ void ArrowFree(void* ptr) { free(ptr); }
static uint8_t* ArrowBufferAllocatorMallocReallocate(
struct ArrowBufferAllocator* allocator, uint8_t* ptr, int64_t old_size,
int64_t new_size) {
+ NANOARROW_UNUSED(allocator);
+ NANOARROW_UNUSED(old_size);
return (uint8_t*)ArrowRealloc(ptr, new_size);
}
static void ArrowBufferAllocatorMallocFree(struct ArrowBufferAllocator* allocator,
uint8_t* ptr, int64_t size) {
+ NANOARROW_UNUSED(allocator);
+ NANOARROW_UNUSED(size);
ArrowFree(ptr);
}
@@ -210,6 +214,10 @@ struct ArrowBufferAllocator ArrowBufferAllocatorDefault(void) {
static uint8_t* ArrowBufferAllocatorNeverReallocate(
struct ArrowBufferAllocator* allocator, uint8_t* ptr, int64_t old_size,
int64_t new_size) {
+ NANOARROW_UNUSED(allocator);
+ NANOARROW_UNUSED(ptr);
+ NANOARROW_UNUSED(old_size);
+ NANOARROW_UNUSED(new_size);
return NULL;
}