+ puts( "- Limited n -\n" );
+ test( 8, "%9d", INT_MAX );
+ test( 8, "%9d", INT_MIN );
+ test( 9, "%9d", INT_MAX );
+ test( 9, "%9d", INT_MIN );
+ test( 10, "%9d", INT_MAX );
+ test( 10, "%9d", INT_MIN );
+ test( 9, "%10d", INT_MAX );
+ test( 9, "%10d", INT_MIN );
+ test( 10, "%10d", INT_MAX );
+ test( 10, "%10d", INT_MIN );
+ test( 11, "%10d", INT_MAX );
+ test( 11, "%10d", INT_MIN );
+ test( 10, "%11d", INT_MAX );
+ test( 10, "%11d", INT_MIN );
+ test( 11, "%11d", INT_MAX );
+ test( 11, "%11d", INT_MIN );
+ test( 12, "%11d", INT_MAX );
+ test( 12, "%11d", INT_MIN );
+ test( 11, "%12d", INT_MAX );
+ test( 11, "%12d", INT_MIN );
+ test( 12, "%12d", INT_MAX );
+ test( 12, "%12d", INT_MIN );
+ test( 13, "%12d", INT_MAX );
+ test( 13, "%12d", INT_MIN );
+ puts( "- Precision (tbd) -\n" );
+ {
+ const char * format = "%030.20d";
+ printf( "glibc '" );
+ rc = printf( format, INT_MAX );
+ printf( "', RC %d\n", rc );
+ test( SIZE_MAX, format, INT_MAX );
+ }
+ puts( "- vanilla -" );
+ printf( "No width, no precision: %#x\n", 42 );
+ printf( "Width, no precision: %#6x\n", 42 );
+ printf( "No width, precision: %#.6x\n", 42 );
+ printf( "Big width, small precision: %#6.3x\n", 42 );
+ printf( "Small width, big precision: %#3.6x\n", 42 );
+ printf( "No width, no precision: %#d\n", 42 );
+ printf( "Width, no precision: %#6d\n", 42 );
+ printf( "No width, precision: %#.6d\n", 42 );
+ printf( "Big width, small precision: %#6.3d\n", 42 );
+ printf( "Small width, big precision: %#3.6d\n", 42 );
+ puts( "- zero flag -" );
+ printf( "No width, no precision: %#0x\n", 42 );
+ printf( "Width, no precision: %#06x\n", 42 );
+ printf( "No width, precision: %#0.6x\n", 42 );
+ printf( "Big width, small precision: %#06.3x\n", 42 );
+ printf( "Small width, big precision: %#03.6x\n", 42 );
+ printf( "No width, no precision: %#0d\n", 42 );
+ printf( "Width, no precision: %#06d\n", 42 );
+ printf( "No width, precision: %#0.6d\n", 42 );
+ printf( "Big width, small precision: %#06.3d\n", 42 );
+ printf( "Small width, big precision: %#03.6d\n", 42 );
+ puts( "- plus flag -" );
+ printf( "No width, no precision: %#+d\n", 42 );
+ printf( "Width, no precision: %#+6d\n", 42 );
+ printf( "No width, precision: %#+.6d\n", 42 );
+ printf( "Big width, small precision: %#+6.3d\n", 42 );
+ printf( "Small width, big precision: %#+3.6d\n", 42 );
+ puts( "- plus and zero flag -" );
+ printf( "No width, no precision: %#+0d\n", 42 );
+ printf( "Width, no precision: %#+06d\n", 42 );
+ printf( "No width, precision: %#+0.6d\n", 42 );
+ printf( "Big width, small precision: %#+06.3d\n", 42 );
+ printf( "Small width, big precision: %#+03.6d\n", 42 );