From 8384a9660449b237d492f5a953e3e12d9deaaf49 Mon Sep 17 00:00:00 2001 From: Zach Clark Date: Thu, 6 Jun 2019 12:15:01 -0500 Subject: Fix "possibly uninitialized variable" Compiling with GCOV causes the variable_buffer::flipBit() function to be analyzed differently than without, resulting in a warning for the possibly-uninitialized variable and causing compilation failure when the -Werror option is enabled. This commit explicitly initializes the variable. Change-Id: Idc59ba411cc1f9200888bba6c215e48bb7051b7c Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/78485 Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: PPE CI Tested-by: Hostboot CI Tested-by: HWSV CI Reviewed-by: Nicholas E. Bofferding Reviewed-by: Ilya Smirnov Reviewed-by: Jennifer A Stofer Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/78514 Reviewed-by: RAJA DAS --- src/import/hwpf/fapi2/include/variable_buffer.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/import') diff --git a/src/import/hwpf/fapi2/include/variable_buffer.H b/src/import/hwpf/fapi2/include/variable_buffer.H index c96f83a9..761ee27b 100644 --- a/src/import/hwpf/fapi2/include/variable_buffer.H +++ b/src/import/hwpf/fapi2/include/variable_buffer.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -475,7 +475,7 @@ class variable_buffer /// inline fapi2::ReturnCodes flipBit( bits_type SB, bits_type L = 1) { - ReturnCodes rc; + ReturnCodes rc = FAPI2_RC_SUCCESS; // make sure we are within our container if((SB + L) <= this->iv_perceived_bit_length) -- cgit v1.2.1