From 3c6ce0a896302473daa6870abcc117c3a45e1361 Mon Sep 17 00:00:00 2001 From: Mike Kelly Date: Wed, 9 Aug 2023 18:39:42 +0100 Subject: [PATCH] IVGCVSW-7963 Uninitialized variable error in coverity * Initialised the uninitialized variable. Signed-off-by: Mike Kelly Change-Id: Ifb002ee53cb9b2a2559c282a9b30192790d36d05 --- include/armnn/Optional.hpp | 2 +- profiling/common/include/Optional.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/armnn/Optional.hpp b/include/armnn/Optional.hpp index 1b61e20425..958e5895a1 100644 --- a/include/armnn/Optional.hpp +++ b/include/armnn/Optional.hpp @@ -179,7 +179,7 @@ class OptionalReferenceSwitch : public OptionalBase m_HasValue = true; } - alignas(alignof(T)) unsigned char m_Storage[sizeof(T)]; + alignas(alignof(T)) unsigned char m_Storage[sizeof(T)] = {}; }; /// diff --git a/profiling/common/include/Optional.hpp b/profiling/common/include/Optional.hpp index e2d6c67e2a..8fdbbfe21d 100644 --- a/profiling/common/include/Optional.hpp +++ b/profiling/common/include/Optional.hpp @@ -182,7 +182,7 @@ class OptionalReferenceSwitch : public OptionalBase m_HasValue = true; } - alignas(alignof(T)) unsigned char m_Storage[sizeof(T)]; + alignas(alignof(T)) unsigned char m_Storage[sizeof(T)] = {}; }; ///