summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/tsprintf.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/tsprintf.c b/tests/tsprintf.c
index 737ff86db..51051a1f4 100644
--- a/tests/tsprintf.c
+++ b/tests/tsprintf.c
@@ -900,8 +900,8 @@ random_double (void)
'+',
' ',
'#',
- '0', /* no ambiguity: first zeros are flag zero*/
- '\''
+ '0', /* no ambiguity: first zeros are flag zero */
+ '\'' /* SUS extension */
};
/* no 'a': mpfr and glibc do not have the same semantic */
char specifier[] =
@@ -965,8 +965,12 @@ random_double (void)
*ptr_mpfr++ = *ptr++ = '%';
/* random specifier 'e', 'f', 'g', 'E', 'F', or 'G' */
spec = (int) (randlimb() % 6);
- /* random flags, but no ' flag with %e */
+ /* random flags, but no ' flag with %e or with non-glibc */
+#if __MPFR_GLIBC(1,0)
jmax = (spec == 0 || spec == 3) ? 5 : 6;
+#else
+ jmax = 5;
+#endif
for (j = 0; j < jmax; j++)
{
if (randlimb() % 3 == 0)