X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2F_PDCLIB_print.c;h=0351678d9939712e76d183bc2e7d3175f4f732fa;hb=3a988bf47bda2322d7759d3c4518c03e0ef98ba4;hp=8e2a68b4319afe13e8dec966a360b01d7981e07d;hpb=36ba0291514888662188f6a64fe34e9acad1c298;p=pdclib diff --git a/functions/stdio/_PDCLIB_print.c b/functions/stdio/_PDCLIB_print.c index 8e2a68b..0351678 100644 --- a/functions/stdio/_PDCLIB_print.c +++ b/functions/stdio/_PDCLIB_print.c @@ -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: @@ -530,15 +531,13 @@ int _PDCLIB_print( const char * spec, struct _PDCLIB_status_t * status ) break; case E_intmax: value = va_arg( status->arg, uintmax_t ); - default: - _PDCLIB_UNREACHABLE; } if ( !int2base( value, status ) ) return -1; } else { - intmax_t value; + intmax_t value = 0; switch ( status->flags & E_TYPES ) { case E_char: @@ -618,7 +617,7 @@ static int testprintf( char * buffer, const char * format, ... ) status.write = testcb; va_start( status.arg, format ); memset( buffer, '\0', 100 ); - if ( _PDCLIB_print( format, &status ) != strlen( format ) ) + if ( _PDCLIB_print( format, &status ) != (int)strlen( format ) ) { printf( "_PDCLIB_print() did not return end-of-specifier on '%s'.\n", format ); ++TEST_RESULTS;