Skip to content

Commit

Permalink
Fix "possibly uninitialized variable"
Browse files Browse the repository at this point in the history
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 <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/78513
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
  • Loading branch information
ibmzach authored and crgeddes committed Jun 17, 2019
1 parent b3996f5 commit cffebe4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/import/hwpf/fapi2/include/variable_buffer.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit cffebe4

Please sign in to comment.