Silence some "may be uninitialized when used" warning
authorMatt Caswell <matt@openssl.org>
Fri, 27 May 2016 13:59:47 +0000 (14:59 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 27 May 2016 13:59:47 +0000 (14:59 +0100)
Clang was complaining about some variables possibly being uninitialized
when used. The warnings are bogus, but clang can't figure that out. This
silences the warnings.

Reviewed-by: Richard Levitte <levitte@openssl.org>
test/bioprinttest.c

index d376cfb8e0d2c3f594535f718ab9e165bdf1d156..c69a79c419483ed9e87fee2cc31c7fb149439095 100644 (file)
@@ -92,7 +92,7 @@ static void dofptest(int test, double val, char *width, int prec, int *fail)
     int i;
 
     for (i = 0; i < 5; i++) {
-        char *fspec;
+        char *fspec = NULL;
         switch (i) {
         case 0:
             fspec = "e";
@@ -143,8 +143,8 @@ int main(int argc, char **argv)
     int test = 0;
     int i;
     int fail = 0;
-    int prec;
-    char *width;
+    int prec = -1;
+    char *width = "";
     const double frac = 2.0/3.0;
     char buf[80];