kou commented on PR #45138: URL: https://github.com/apache/arrow/pull/45138#issuecomment-2566505410
TODO: https://github.com/ursacomputing/crossbow/actions/runs/12559814148/job/35016145241#step:7:5301 ```text FAILED: src/arrow/CMakeFiles/arrow_array.dir/array/array_nested.cc.o /usr/local/bin/sccache /usr/lib/ccache/g++-15 -DARROW_HAVE_RUNTIME_AVX2 -DARROW_HAVE_RUNTIME_AVX512 -DARROW_HAVE_RUNTIME_BMI2 -DARROW_HAVE_RUNTIME_SSE4_2 -DARROW_HAVE_SSE4_2 -DARROW_WITH_TIMING_TESTS -I/build/cpp/src -I/arrow/cpp/src -I/arrow/cpp/src/generated -Wredundant-move -Wno-noexcept-type -Wno-self-move -fdiagnostics-color=always -Wall -Wno-conversion -Wno-sign-conversion -Wdate-time -Wimplicit-fallthrough -Wunused-result -fno-semantic-interposition -msse4.2 -g -Werror -O0 -ggdb -g1 -std=c++20 -fPIC -MD -MT src/arrow/CMakeFiles/arrow_array.dir/array/array_nested.cc.o -MF src/arrow/CMakeFiles/arrow_array.dir/array/array_nested.cc.o.d -o src/arrow/CMakeFiles/arrow_array.dir/array/array_nested.cc.o -c /arrow/cpp/src/arrow/array/array_nested.cc /arrow/cpp/src/arrow/array/array_nested.cc: In member function 'const std::shared_ptr<arrow::Array>& arrow::StructArray::field(int) const': /arrow/cpp/src/arrow/array/array_nested.cc:1080:51: error: 'std::shared_ptr<_Tp> std::atomic_load(const shared_ptr<_Tp>*) [with _Tp = arrow::Array]' is deprecated: use 'std::atomic<std::shared_ptr<T>>' instead [-Werror=deprecated-declarations] 1080 | std::shared_ptr<Array> result = std::atomic_load(&boxed_fields_[i]); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/15/memory:83, from /arrow/cpp/src/arrow/array/array_nested.h:24, from /arrow/cpp/src/arrow/array/array_nested.cc:18: /usr/include/c++/15/bits/shared_ptr_atomic.h:142:5: note: declared here 142 | atomic_load(const shared_ptr<_Tp>* __p) | ^~~~~~~~~~~ /arrow/cpp/src/arrow/array/array_nested.cc:1089:22: error: 'void std::atomic_store(shared_ptr<_Tp>*, shared_ptr<_Tp>) [with _Tp = arrow::Array]' is deprecated: use 'std::atomic<std::shared_ptr<T>>' instead [-Werror=deprecated-declarations] 1089 | std::atomic_store(&boxed_fields_[i], std::move(result)); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/15/bits/shared_ptr_atomic.h:183:5: note: declared here 183 | atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r) | ^~~~~~~~~~~~ /arrow/cpp/src/arrow/array/array_nested.cc: In member function 'std::shared_ptr<arrow::Array> arrow::UnionArray::field(int) const': /arrow/cpp/src/arrow/array/array_nested.cc:1360:51: error: 'std::shared_ptr<_Tp> std::atomic_load(const shared_ptr<_Tp>*) [with _Tp = arrow::Array]' is deprecated: use 'std::atomic<std::shared_ptr<T>>' instead [-Werror=deprecated-declarations] 1360 | std::shared_ptr<Array> result = std::atomic_load(&boxed_fields_[i]); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ /usr/include/c++/15/bits/shared_ptr_atomic.h:142:5: note: declared here 142 | atomic_load(const shared_ptr<_Tp>* __p) | ^~~~~~~~~~~ /arrow/cpp/src/arrow/array/array_nested.cc:1372:22: error: 'void std::atomic_store(shared_ptr<_Tp>*, shared_ptr<_Tp>) [with _Tp = arrow::Array]' is deprecated: use 'std::atomic<std::shared_ptr<T>>' instead [-Werror=deprecated-declarations] 1372 | std::atomic_store(&boxed_fields_[i], result); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/15/bits/shared_ptr_atomic.h:183:5: note: declared here 183 | atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r) | ^~~~~~~~~~~~ cc1plus: all warnings being treated as errors ``` We should use `std::atomic<std::shared_ptr>` instead of `std::atomic_load()`/`std::atomic_store()`. `std::atomic_load()`/`std::atomic_store()` are deprecated and they are replaced with `std::atomic<std::shared_ptr>` in C++20. See also: * https://en.cppreference.com/w/cpp/memory/shared_ptr/atomic * https://en.cppreference.com/w/cpp/memory/shared_ptr/atomic2 (I think that we should work on this as a separated task.) -- 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]
