8 /* (INT_MAX / 2) + 2 */
14 #define STRINGIFY(S) #S
15 #define MAKE_STR(S) STRINGIFY(S)
17 #define SN MAKE_STR(N)
18 #define SN2 MAKE_STR(N2)
19 #define SN3 MAKE_STR(N3)
26 FILE *fp
= fopen ("/dev/null", "w");
29 puts ("cannot open /dev/null");
33 ret
= fprintf (fp
, "%" SN
"d", 1);
34 printf ("ret = %d\n", ret
);
35 if (ret
!= -1 || errno
!= EOVERFLOW
)
38 ret
= fprintf (fp
, "%." SN
"d", 1);
39 printf ("ret = %d\n", ret
);
40 if (ret
!= -1 || errno
!= EOVERFLOW
)
43 ret
= fprintf (fp
, "%." SN3
"d", 1);
44 printf ("ret = %d\n", ret
);
45 if (ret
!= -1 || errno
!= EOVERFLOW
)
48 ret
= fprintf (fp
, "%" SN2
"d%" SN2
"d", 1, 1);
49 printf ("ret = %d\n", ret
);
51 return ret
!= -1 || errno
!= EOVERFLOW
;
55 #define TEST_FUNCTION do_test ()
56 #include "../test-skeleton.c"