This is an automated email from the ASF dual-hosted git repository.

willayd 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 cc20f792 ci: Fix Meson build warnings when Arrow tests are enabled 
(#781)
cc20f792 is described below

commit cc20f792a5983e1fd3d292b7f29d8381d6d1b5ef
Author: William Ayd <[email protected]>
AuthorDate: Wed Jun 11 23:22:37 2025 -0400

    ci: Fix Meson build warnings when Arrow tests are enabled (#781)
---
 ci/scripts/build-with-meson.sh     | 4 ++++
 src/nanoarrow/common/array_test.cc | 5 +++++
 src/nanoarrow/common/utils_test.cc | 6 ++++++
 3 files changed, 15 insertions(+)

diff --git a/ci/scripts/build-with-meson.sh b/ci/scripts/build-with-meson.sh
index e7f818bf..7d5fcec1 100755
--- a/ci/scripts/build-with-meson.sh
+++ b/ci/scripts/build-with-meson.sh
@@ -70,6 +70,7 @@ function main() {
           -Dbuildtype=debugoptimized \
           -Db_sanitize="address,undefined" \
           -Dtests=enabled \
+          -Dtests_with_arrow=enabled \
           -Dipc=enabled \
           -Ddevice=enabled \
           -Dbenchmarks=disabled \
@@ -83,6 +84,7 @@ function main() {
           -Dbuildtype=debugoptimized \
           -Db_sanitize=none \
           -Dtests=enabled \
+          -Dtests_with_arrow=enabled \
           -Dipc=enabled \
           -Ddevice=enabled \
           -Dbenchmarks=disabled \
@@ -95,6 +97,7 @@ function main() {
           -Dbuildtype=release \
           -Db_sanitize=none \
           -Dtests=disabled \
+          -Dtests_with_arrow=enabled \
           -Dipc=enabled \
           -Ddevice=enabled \
           -Dbenchmarks=enabled \
@@ -107,6 +110,7 @@ function main() {
           -Dbuildtype=release \
           -Db_sanitize=none \
           -Dtests=enabled \
+          -Dtests_with_arrow=enabled \
           -Dipc=enabled \
           -Ddevice=enabled \
           -Dbenchmarks=disabled \
diff --git a/src/nanoarrow/common/array_test.cc 
b/src/nanoarrow/common/array_test.cc
index cb974459..92349e6a 100644
--- a/src/nanoarrow/common/array_test.cc
+++ b/src/nanoarrow/common/array_test.cc
@@ -228,6 +228,11 @@ TEST(ArrayTest, ArrayTestBuildByBuffer) {
   ASSERT_EQ(ArrowArrayInitFromType(&array, NANOARROW_TYPE_STRING), 
NANOARROW_OK);
 
   ASSERT_EQ(ArrowBitmapReserve(ArrowArrayValidityBitmap(&array), 100), 
NANOARROW_OK);
+
+  ASSERT_EQ(ArrowArrayValidityBitmap(&array)->size_bits % 8, 0);
+  // This duplicative assert suppresses maybe-uninitialized warnings with 
release builds
+  assert(ArrowArrayValidityBitmap(&array)->size_bits % 8 == 0);
+
   ArrowBitmapAppendInt8Unsafe(ArrowArrayValidityBitmap(&array), 
validity_array, 7);
 
   ASSERT_EQ(ArrowBufferReserve(ArrowArrayBuffer(&array, 1), 100), 
NANOARROW_OK);
diff --git a/src/nanoarrow/common/utils_test.cc 
b/src/nanoarrow/common/utils_test.cc
index b9b64870..0f8b0218 100644
--- a/src/nanoarrow/common/utils_test.cc
+++ b/src/nanoarrow/common/utils_test.cc
@@ -279,6 +279,9 @@ TEST(DecimalTest, Decimal32Test) {
   EXPECT_EQ(ArrowDecimalSign(&decimal), 1);
 #if defined(NANOARROW_BUILD_TESTS_WITH_ARROW) && ARROW_VERSION_MAJOR >= 18
   EXPECT_EQ(memcmp(decimal.words, bytes_pos, sizeof(bytes_pos)), 0);
+  ASSERT_EQ(decimal.n_words, 0);
+  // This duplicative assert suppresses array-bounds warnings with release 
builds
+  assert(decimal.n_words == 0);
   ArrowDecimalSetBytes(&decimal, bytes_pos);
   EXPECT_EQ(memcmp(decimal.words, bytes_pos, sizeof(bytes_pos)), 0);
 #endif
@@ -288,6 +291,9 @@ TEST(DecimalTest, Decimal32Test) {
   EXPECT_EQ(ArrowDecimalSign(&decimal), -1);
 #if defined(NANOARROW_BUILD_TESTS_WITH_ARROW) && ARROW_VERSION_MAJOR >= 18
   EXPECT_EQ(memcmp(decimal.words, bytes_neg, sizeof(bytes_neg)), 0);
+  ASSERT_EQ(decimal.n_words, 0);
+  // This duplicative assert suppresses array-bounds warnings with release 
builds
+  assert(decimal.n_words == 0);
   ArrowDecimalSetBytes(&decimal, bytes_neg);
   EXPECT_EQ(memcmp(decimal.words, bytes_neg, sizeof(bytes_neg)), 0);
 #endif

Reply via email to