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 793590e4 fix: Silence warning when compiling nanoarrow.hpp on at least
one version of MSVC (#590)
793590e4 is described below
commit 793590e45abfefa93f9fd1447b4b5d98266ccfca
Author: Dewey Dunnington <[email protected]>
AuthorDate: Mon Aug 19 10:27:23 2024 -0300
fix: Silence warning when compiling nanoarrow.hpp on at least one version
of MSVC (#590)
Encountered in an ADBC build:
https://github.com/apache/arrow-adbc/actions/runs/10424783996/job/28874300812#step:10:830
```
D:\a\arrow-adbc\arrow-adbc\adbc\c\vendor\nanoarrow\nanoarrow.hpp(829,21):
warning C4355: 'this': used in base member initializer list
[D:\a\arrow-adbc\arrow-adbc\adbc\build\driver\framework\adbc_driver_framework.vcxproj]
```
---
src/nanoarrow/nanoarrow.hpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/nanoarrow/nanoarrow.hpp b/src/nanoarrow/nanoarrow.hpp
index f51db74c..49ba38f0 100644
--- a/src/nanoarrow/nanoarrow.hpp
+++ b/src/nanoarrow/nanoarrow.hpp
@@ -843,7 +843,12 @@ class ViewArrayAsFixedSizeBytes {
class ViewArrayStream {
public:
ViewArrayStream(ArrowArrayStream* stream, ArrowErrorCode* code, ArrowError*
error)
- : range_{Next{this, stream, UniqueArray()}}, code_{code}, error_{error}
{}
+ : code_{code}, error_{error} {
+ // Using a slightly more verbose constructor to silence a warning that
occurs
+ // on some versions of MSVC.
+ range_.next.self = this;
+ range_.next.stream = stream;
+ }
ViewArrayStream(ArrowArrayStream* stream, ArrowError* error)
: ViewArrayStream{stream, &internal_code_, error} {}