]> pd.if.org Git - pdclib/commitdiff
Warning 'value may be used uninitialized'. Fixed.
authorMartin Baute <solar@rootdirectory.de>
Fri, 11 Mar 2016 06:29:29 +0000 (07:29 +0100)
committerMartin Baute <solar@rootdirectory.de>
Fri, 11 Mar 2016 06:29:29 +0000 (07:29 +0100)
functions/stdio/_PDCLIB_print.c

index f264a6178cdb1520e575667839f320c83acc5267..0351678d9939712e76d183bc2e7d3175f4f732fa 100644 (file)
@@ -501,7 +501,8 @@ int _PDCLIB_print( const char * spec, struct _PDCLIB_status_t * status )
         /* TODO: Check for invalid flag combinations. */
         if ( status->flags & E_unsigned )
         {
-            uintmax_t value;
+            /* TODO: Marking the default case _PDCLIB_UNREACHABLE breaks %ju test driver? */
+            uintmax_t value = 0;
             switch ( status->flags & E_TYPES )
             {
                 case E_char:
@@ -536,7 +537,7 @@ int _PDCLIB_print( const char * spec, struct _PDCLIB_status_t * status )
         }
         else
         {
-            intmax_t value;
+            intmax_t value = 0;
             switch ( status->flags & E_TYPES )
             {
                 case E_char:
@@ -566,6 +567,8 @@ int _PDCLIB_print( const char * spec, struct _PDCLIB_status_t * status )
                 case E_intmax:
                     value = va_arg( status->arg, intmax_t );
                     break;
+                default:
+                    _PDCLIB_UNREACHABLE;
             }
 
             if (!int2base( value, status ) )