From f0e61dc53edea11cef37118cb384e718b5c74c03 Mon Sep 17 00:00:00 2001 From: Markus Holzer <markus.holzer@fau.de> Date: Tue, 13 Oct 2020 10:47:58 +0200 Subject: [PATCH] [FIX] Warning -Wmaybe-uninitialized --- src/cuda/communication/CustomMemoryBuffer.h | 6 +++--- src/cuda/communication/CustomMemoryBuffer.impl.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cuda/communication/CustomMemoryBuffer.h b/src/cuda/communication/CustomMemoryBuffer.h index 8ad176077..7ca7ab46f 100644 --- a/src/cuda/communication/CustomMemoryBuffer.h +++ b/src/cuda/communication/CustomMemoryBuffer.h @@ -85,9 +85,9 @@ namespace communication { T *advanceNoResize( std::size_t bytes ) { return reinterpret_cast<T *>( advanceNoResize( bytes * sizeof( T ))); } private: - ElementType *begin_; - ElementType *cur_; - ElementType *end_; + ElementType *begin_ = nullptr; + ElementType *cur_ = nullptr; + ElementType *end_ = nullptr; }; diff --git a/src/cuda/communication/CustomMemoryBuffer.impl.h b/src/cuda/communication/CustomMemoryBuffer.impl.h index 5bf1ac8c1..cfc5d8283 100644 --- a/src/cuda/communication/CustomMemoryBuffer.impl.h +++ b/src/cuda/communication/CustomMemoryBuffer.impl.h @@ -45,6 +45,7 @@ namespace communication { template<typename Allocator> CustomMemoryBuffer<Allocator>::CustomMemoryBuffer( const CustomMemoryBuffer &pb ) + : begin_( nullptr ), cur_( nullptr ), end_( nullptr ) { if( pb.begin_ != nullptr ) { -- GitLab