[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v2 2/3] Add test case for virHashEqual function

On 01/24/2012 06:19 AM, Michal Privoznik wrote:

Therefore I am pushing this under trivial and build-breaker rules (yeah,
one thing - and perhaps the only one - i like about 4.6 gcc is enhanced
static analysis as I spotted warning while compiling current HEAD):

Author: Michal Privoznik<mprivozn redhat com>
Date:   Tue Jan 24 12:09:42 2012 +0100

     hashtest: Initialize variable in virHashEqual test

     One of latest patches (b7bcb22ce2) enhanced testing for virHashEqual.
     However, hash2 variable might be used uninitialized.

diff --git a/tests/hashtest.c b/tests/hashtest.c
index 6c45b01..441672c 100644
--- a/tests/hashtest.c
+++ b/tests/hashtest.c
@@ -583,7 +583,7 @@ testHashEqualCompValue(const void *value1, const
void *value2)
  static int
  testHashEqual(const void *data ATTRIBUTE_UNUSED)
-    virHashTablePtr hash1, hash2;
+    virHashTablePtr hash1, hash2 = NULL;
      int ret = -1;
      char keya[] = "a";
      char keyb[] = "b";


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]