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

felipecrv pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 5247870884 GH-42139: [C++] Fix some potential uninitialized variable 
warnings (#42207)
5247870884 is described below

commit 52478708841fc0c8cbe94c242c057ae0b5ceea11
Author: Raúl Cumplido <[email protected]>
AuthorDate: Mon Jun 24 18:11:05 2024 +0200

    GH-42139: [C++] Fix some potential uninitialized variable warnings (#42207)
    
    ### Rationale for this change
    
    Fix a couple warnings about potentially uninitialized variables
    
    ### What changes are included in this PR?
    
    Fix the warnings
    
    ### Are these changes tested?
    
    Test via CI.
    
    ### Are there any user-facing changes?
    
    No
    * GitHub Issue: #42139
    
    Lead-authored-by: Felipe Oliveira Carvalho <[email protected]>
    Co-authored-by: Raúl Cumplido <[email protected]>
    Signed-off-by: Felipe Oliveira Carvalho <[email protected]>
---
 cpp/src/arrow/c/bridge.cc           | 2 +-
 cpp/src/arrow/gpu/cuda_benchmark.cc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpp/src/arrow/c/bridge.cc b/cpp/src/arrow/c/bridge.cc
index afb664c3bc..eba575f4cf 100644
--- a/cpp/src/arrow/c/bridge.cc
+++ b/cpp/src/arrow/c/bridge.cc
@@ -528,7 +528,7 @@ namespace {
 struct ExportedArrayPrivateData : 
PoolAllocationMixin<ExportedArrayPrivateData> {
   // The buffers are owned by the ArrayData member
   SmallVector<const void*, 3> buffers_;
-  struct ArrowArray dictionary_;
+  struct ArrowArray dictionary_ {};
   SmallVector<struct ArrowArray, 1> children_;
   SmallVector<struct ArrowArray*, 4> child_pointers_;
 
diff --git a/cpp/src/arrow/gpu/cuda_benchmark.cc 
b/cpp/src/arrow/gpu/cuda_benchmark.cc
index 2787d103cc..a5415d8612 100644
--- a/cpp/src/arrow/gpu/cuda_benchmark.cc
+++ b/cpp/src/arrow/gpu/cuda_benchmark.cc
@@ -36,7 +36,7 @@ constexpr int64_t kGpuNumber = 0;
 static void CudaBufferWriterBenchmark(benchmark::State& state, const int64_t 
total_bytes,
                                       const int64_t chunksize,
                                       const int64_t buffer_size) {
-  CudaDeviceManager* manager;
+  CudaDeviceManager* manager = nullptr;
   ABORT_NOT_OK(CudaDeviceManager::Instance().Value(&manager));
   std::shared_ptr<CudaContext> context;
   ABORT_NOT_OK(manager->GetContext(kGpuNumber).Value(&context));

Reply via email to