summaryrefslogtreecommitdiffstats
path: root/gl/m4/printf.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/printf.m4')
-rw-r--r--gl/m4/printf.m4317
1 files changed, 214 insertions, 103 deletions
diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4
index 0cb14d6f..0de493b6 100644
--- a/gl/m4/printf.m4
+++ b/gl/m4/printf.m4
@@ -1,9 +1,10 @@
1# printf.m4 1# printf.m4
2# serial 91 2# serial 98
3dnl Copyright (C) 2003, 2007-2024 Free Software Foundation, Inc. 3dnl Copyright (C) 2003, 2007-2026 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7dnl This file is offered as-is, without any warranty.
7 8
8dnl Test whether the *printf family of functions supports the 'j', 'z', 't', 9dnl Test whether the *printf family of functions supports the 'j', 'z', 't',
9dnl 'L' size specifiers. (ISO C99, POSIX:2001) 10dnl 'L' size specifiers. (ISO C99, POSIX:2001)
@@ -616,6 +617,7 @@ static double zero = 0.0;
616int main () 617int main ()
617{ 618{
618 int result = 0; 619 int result = 0;
620 /* This fails on FreeBSD 5.2.1, Solaris 11.4. */
619 if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0 621 if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
620 || (strcmp (buf, "0x1.922p+1 33") != 0 622 || (strcmp (buf, "0x1.922p+1 33") != 0
621 && strcmp (buf, "0x3.244p+0 33") != 0 623 && strcmp (buf, "0x3.244p+0 33") != 0
@@ -627,27 +629,29 @@ int main ()
627 && strcmp (buf, "-0X3.244P+0 33") != 0 629 && strcmp (buf, "-0X3.244P+0 33") != 0
628 && strcmp (buf, "-0X6.488P-1 33") != 0 630 && strcmp (buf, "-0X6.488P-1 33") != 0
629 && strcmp (buf, "-0XC.91P-2 33") != 0)) 631 && strcmp (buf, "-0XC.91P-2 33") != 0))
630 result |= 2; 632 result |= 1;
631 /* This catches a FreeBSD 13.0 bug: it doesn't round. */ 633 /* This catches a Mac OS X 10.5, FreeBSD 6.4, NetBSD 10.0 bug:
634 it doesn't round. */
632 if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0 635 if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
633 || (strcmp (buf, "0x1.83p+0 33") != 0 636 || (strcmp (buf, "0x1.83p+0 33") != 0
634 && strcmp (buf, "0x3.05p-1 33") != 0 637 && strcmp (buf, "0x3.05p-1 33") != 0
635 && strcmp (buf, "0x6.0ap-2 33") != 0 638 && strcmp (buf, "0x6.0ap-2 33") != 0
636 && strcmp (buf, "0xc.14p-3 33") != 0)) 639 && strcmp (buf, "0xc.14p-3 33") != 0))
637 result |= 4; 640 result |= 2;
638 /* This catches a Mac OS X 10.12.4 (Darwin 16.5) bug: it doesn't round. */ 641 /* This catches a macOS 14 (Darwin 23), FreeBSD 14.0, OpenBSD 7.5, AIX 7.3,
642 Solaris 11.4 bug: it doesn't round. */
639 if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0 643 if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0
640 || (strcmp (buf, "0x2p+0 33") != 0 644 || (strcmp (buf, "0x2p+0 33") != 0
641 && strcmp (buf, "0x3p-1 33") != 0 645 && strcmp (buf, "0x3p-1 33") != 0
642 && strcmp (buf, "0x6p-2 33") != 0 646 && strcmp (buf, "0x6p-2 33") != 0
643 && strcmp (buf, "0xcp-3 33") != 0)) 647 && strcmp (buf, "0xcp-3 33") != 0))
644 result |= 4; 648 result |= 4;
645 /* This catches a FreeBSD 6.1 bug. See 649 /* This catches a Mac OS X 10.5, FreeBSD 6.4 bug. See
646 <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */ 650 <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
647 if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0 651 if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
648 || buf[0] == '0') 652 || buf[0] == '0')
649 result |= 8; 653 result |= 8;
650 /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */ 654 /* This catches a Mac OS X 10.3.9 (Darwin 7.9), FreeBSD 6.4 bug. */
651 if (sprintf (buf, "%.1a", 1.999) < 0 655 if (sprintf (buf, "%.1a", 1.999) < 0
652 || (strcmp (buf, "0x1.0p+1") != 0 656 || (strcmp (buf, "0x1.0p+1") != 0
653 && strcmp (buf, "0x2.0p+0") != 0 657 && strcmp (buf, "0x2.0p+0") != 0
@@ -655,7 +659,8 @@ int main ()
655 && strcmp (buf, "0x8.0p-2") != 0)) 659 && strcmp (buf, "0x8.0p-2") != 0))
656 result |= 16; 660 result |= 16;
657 /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a 661 /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
658 glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */ 662 glibc 2.4 bug <https://sourceware.org/PR2908>
663 and a FreeBSD 6.4, NetBSD 10.0 bug. */
659 if (sprintf (buf, "%.1La", 1.999L) < 0 664 if (sprintf (buf, "%.1La", 1.999L) < 0
660 || (strcmp (buf, "0x1.0p+1") != 0 665 || (strcmp (buf, "0x1.0p+1") != 0
661 && strcmp (buf, "0x2.0p+0") != 0 666 && strcmp (buf, "0x2.0p+0") != 0
@@ -893,9 +898,14 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
893 [AC_LANG_SOURCE([[ 898 [AC_LANG_SOURCE([[
894#include <signal.h> 899#include <signal.h>
895#include <stdio.h> 900#include <stdio.h>
896#include <stdlib.h>
897#include <string.h> 901#include <string.h>
902#if defined _WIN32 && !defined __CYGWIN__
903# include <stdlib.h>
904#else
905# include <unistd.h>
906#endif
898#ifdef _MSC_VER 907#ifdef _MSC_VER
908#include <crtdbg.h>
899#include <inttypes.h> 909#include <inttypes.h>
900/* See page about "Parameter Validation" on msdn.microsoft.com. 910/* See page about "Parameter Validation" on msdn.microsoft.com.
901 <https://docs.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation> 911 <https://docs.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation>
@@ -922,9 +932,12 @@ int main ()
922 int count = -1; 932 int count = -1;
923#ifdef _MSC_VER 933#ifdef _MSC_VER
924 _set_invalid_parameter_handler (invalid_parameter_handler); 934 _set_invalid_parameter_handler (invalid_parameter_handler);
935 /* Also avoid an Abort/Retry/Ignore dialog in debug builds.
936 <https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/crtsetreportmode> */
937 _CrtSetReportMode (_CRT_ASSERT, 0);
925#endif 938#endif
926 signal (SIGABRT, abort_handler); 939 signal (SIGABRT, abort_handler);
927 /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) 940 /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE >= 2)
928 support %n in format strings in read-only memory but not in writable 941 support %n in format strings in read-only memory but not in writable
929 memory. */ 942 memory. */
930 strcpy (fmtstring, "%d %n"); 943 strcpy (fmtstring, "%d %n");
@@ -981,7 +994,7 @@ int main ()
981 int result = 0; 994 int result = 0;
982 char buf[100]; 995 char buf[100];
983 /* Test whether %ls works at all. 996 /* Test whether %ls works at all.
984 This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on 997 This test fails on OpenBSD 4.0, Solaris 2.6, Haiku, but not on
985 Cygwin 1.5. */ 998 Cygwin 1.5. */
986 { 999 {
987 static const wchar_t wstring[] = { 'a', 'b', 'c', 0 }; 1000 static const wchar_t wstring[] = { 'a', 'b', 'c', 0 };
@@ -990,8 +1003,8 @@ int main ()
990 || strcmp (buf, "abc") != 0) 1003 || strcmp (buf, "abc") != 0)
991 result |= 1; 1004 result |= 1;
992 } 1005 }
993 /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an 1006 /* This test fails on Solaris 2.6, Cygwin 1.5, Haiku (with an assertion
994 assertion failure inside libc), but not on OpenBSD 4.0. */ 1007 failure inside libc), but not on OpenBSD 4.0. */
995 { 1008 {
996 static const wchar_t wstring[] = { 'a', 0 }; 1009 static const wchar_t wstring[] = { 'a', 0 };
997 buf[0] = '\0'; 1010 buf[0] = '\0';
@@ -1024,7 +1037,6 @@ changequote(,)dnl
1024 # Guess yes on OpenBSD >= 6.0. 1037 # Guess yes on OpenBSD >= 6.0.
1025 openbsd[1-5].*) gl_cv_func_printf_directive_ls="guessing no";; 1038 openbsd[1-5].*) gl_cv_func_printf_directive_ls="guessing no";;
1026 openbsd*) gl_cv_func_printf_directive_ls="guessing yes";; 1039 openbsd*) gl_cv_func_printf_directive_ls="guessing yes";;
1027 irix*) gl_cv_func_printf_directive_ls="guessing no";;
1028 solaris*) gl_cv_func_printf_directive_ls="guessing no";; 1040 solaris*) gl_cv_func_printf_directive_ls="guessing no";;
1029 cygwin*) gl_cv_func_printf_directive_ls="guessing no";; 1041 cygwin*) gl_cv_func_printf_directive_ls="guessing no";;
1030 beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; 1042 beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";;
@@ -1173,6 +1185,112 @@ changequote([,])dnl
1173 ]) 1185 ])
1174]) 1186])
1175 1187
1188dnl Test whether the *printf family of functions supports POSIX/XSI format
1189dnl strings with the ' flag for grouping of decimal digits on integers,
1190dnl together with a precision.
1191dnl Result is gl_cv_func_printf_flag_grouping_int_precision.
1192
1193AC_DEFUN([gl_PRINTF_FLAG_GROUPING_INT_PRECISION],
1194[
1195 AC_REQUIRE([AC_PROG_CC])
1196 AC_REQUIRE([AC_CANONICAL_HOST])
1197 AC_CACHE_CHECK([whether printf supports grouping on integers with a precision],
1198 [gl_cv_func_printf_flag_grouping_int_precision],
1199 [
1200 dnl Prepare a guess, used when cross-compiling or when specific locales
1201 dnl are not available.
1202 case "$host_os" in
1203 # Guess no on FreeBSD, NetBSD, Solaris, Cygwin, Haiku.
1204 freebsd* | dragonfly* | netbsd* | solaris* | cygwin* | haiku*)
1205 gl_cv_func_printf_flag_grouping_int_precision="guessing no";;
1206 *)
1207 gl_cv_func_printf_flag_grouping_int_precision="guessing yes";;
1208 esac
1209 AC_RUN_IFELSE(
1210 [AC_LANG_SOURCE([[
1211#include <locale.h>
1212#include <stdio.h>
1213#include <string.h>
1214static char buf[100];
1215int main ()
1216{
1217 if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL
1218 || setlocale (LC_ALL, "fr_FR") != NULL
1219 || setlocale (LC_ALL, "fr_FR.ISO-8859-1") != NULL
1220 || setlocale (LC_ALL, "fr_FR.ISO8859-1") != NULL)
1221 {
1222 if (sprintf (buf, "%'.10d", 1000) < 0)
1223 return 1;
1224 if (strlen (buf) == 10 && strcmp (buf, "0000001000") != 0)
1225 /* The sprintf implementation has produced fewer than 10 digits. */
1226 return 2;
1227 else
1228 return 0;
1229 }
1230 return 3;
1231}]])],
1232 [gl_cv_func_printf_flag_grouping_int_precision=yes],
1233 [if test $? = 2; then
1234 gl_cv_func_printf_flag_grouping_int_precision=no
1235 fi
1236 ],
1237 [:])
1238 ])
1239])
1240
1241dnl Test whether the *printf family of functions supports POSIX/XSI format
1242dnl strings with the ' flag for grouping of decimal digits, when the thousands
1243dnl separator is a multibyte character (such as U+00A0 or U+202F in a UTF-8
1244dnl locale).
1245dnl Result is gl_cv_func_printf_flag_grouping_multibyte.
1246
1247AC_DEFUN([gl_PRINTF_FLAG_GROUPING_MULTIBYTE],
1248[
1249 AC_REQUIRE([AC_PROG_CC])
1250 AC_REQUIRE([AC_CANONICAL_HOST])
1251 AC_CACHE_CHECK([whether printf supports grouping with a multibyte separator],
1252 [gl_cv_func_printf_flag_grouping_multibyte],
1253 [
1254 dnl Prepare a guess, used when cross-compiling or when specific locales
1255 dnl are not available.
1256 case "$host_os" in
1257 # Guess no on NetBSD and Solaris 11 OpenIndiana.
1258 netbsd* | solaris*)
1259 gl_cv_func_printf_flag_grouping_multibyte="guessing no";;
1260 *)
1261 gl_cv_func_printf_flag_grouping_multibyte="guessing yes";;
1262 esac
1263 AC_RUN_IFELSE(
1264 [AC_LANG_SOURCE([[
1265#include <locale.h>
1266#include <stdio.h>
1267#include <string.h>
1268static char buf[100];
1269int main ()
1270{
1271 if (setlocale (LC_ALL, "fr_FR.UTF-8") == NULL)
1272 return 0;
1273 if (sprintf (buf, "%'.0f", 1000.0) < 0)
1274 return 1;
1275 if (strlen (localeconv ()->thousands_sep) > 1)
1276 {
1277 if (strlen (buf) <= 4 + 1)
1278 return 2;
1279 else
1280 return 3;
1281 }
1282 return 0;
1283}]])],
1284 [:],
1285 [case $? in
1286 2) gl_cv_func_printf_flag_grouping_multibyte=no ;;
1287 3) gl_cv_func_printf_flag_grouping_multibyte=yes ;;
1288 esac
1289 ],
1290 [:])
1291 ])
1292])
1293
1176dnl Test whether the *printf family of functions supports the - flag correctly. 1294dnl Test whether the *printf family of functions supports the - flag correctly.
1177dnl (ISO C99.) See 1295dnl (ISO C99.) See
1178dnl <https://lists.gnu.org/r/bug-coreutils/2008-02/msg00035.html> 1296dnl <https://lists.gnu.org/r/bug-coreutils/2008-02/msg00035.html>
@@ -1470,10 +1588,6 @@ changequote(,)dnl
1470 *) gl_cv_func_printf_enomem="guessing no";; 1588 *) gl_cv_func_printf_enomem="guessing no";;
1471 esac 1589 esac
1472 ;; 1590 ;;
1473 # Guess yes on IRIX.
1474 irix*) gl_cv_func_printf_enomem="guessing yes";;
1475 # Guess yes on OSF/1.
1476 osf*) gl_cv_func_printf_enomem="guessing yes";;
1477 # Guess yes on BeOS. 1591 # Guess yes on BeOS.
1478 beos*) gl_cv_func_printf_enomem="guessing yes";; 1592 beos*) gl_cv_func_printf_enomem="guessing yes";;
1479 # Guess yes on Haiku. 1593 # Guess yes on Haiku.
@@ -1565,11 +1679,6 @@ changequote(,)dnl
1565 # Guess yes on HP-UX >= 11. 1679 # Guess yes on HP-UX >= 11.
1566 hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";; 1680 hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
1567 hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";; 1681 hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
1568 # Guess yes on IRIX >= 6.5.
1569 irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";;
1570 # Guess yes on OSF/1 >= 5.
1571 osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
1572 osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
1573 # Guess yes on NetBSD >= 3. 1682 # Guess yes on NetBSD >= 3.
1574 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) 1683 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
1575 gl_cv_func_snprintf_truncation_c99="guessing no";; 1684 gl_cv_func_snprintf_truncation_c99="guessing no";;
@@ -1591,7 +1700,7 @@ changequote([,])dnl
1591dnl Test whether the return value of the snprintf function is the number 1700dnl Test whether the return value of the snprintf function is the number
1592dnl of bytes (excluding the terminating NUL) that would have been produced 1701dnl of bytes (excluding the terminating NUL) that would have been produced
1593dnl if the buffer had been large enough. (ISO C99, POSIX:2001) 1702dnl if the buffer had been large enough. (ISO C99, POSIX:2001)
1594dnl For example, this test program fails on IRIX 6.5: 1703dnl For example, this test program fails on HP-UX 11.31 and Solaris 9:
1595dnl --------------------------------------------------------------------- 1704dnl ---------------------------------------------------------------------
1596dnl #include <stdio.h> 1705dnl #include <stdio.h>
1597dnl int main() 1706dnl int main()
@@ -1709,6 +1818,11 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
1709#include <signal.h> 1818#include <signal.h>
1710#include <stdio.h> 1819#include <stdio.h>
1711#include <string.h> 1820#include <string.h>
1821#if defined _WIN32 && !defined __CYGWIN__
1822# include <stdlib.h>
1823#else
1824# include <unistd.h>
1825#endif
1712#if HAVE_SNPRINTF 1826#if HAVE_SNPRINTF
1713# define my_snprintf snprintf 1827# define my_snprintf snprintf
1714#else 1828#else
@@ -1735,7 +1849,7 @@ int main ()
1735{ 1849{
1736 int count = -1; 1850 int count = -1;
1737 signal (SIGABRT, abort_handler); 1851 signal (SIGABRT, abort_handler);
1738 /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) 1852 /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE >= 2)
1739 support %n in format strings in read-only memory but not in writable 1853 support %n in format strings in read-only memory but not in writable
1740 memory. */ 1854 memory. */
1741 strcpy (fmtstring, "%d %n"); 1855 strcpy (fmtstring, "%d %n");
@@ -1775,11 +1889,6 @@ changequote(,)dnl
1775 # Guess yes on AIX >= 4. 1889 # Guess yes on AIX >= 4.
1776 aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";; 1890 aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";;
1777 aix*) gl_cv_func_snprintf_directive_n="guessing yes";; 1891 aix*) gl_cv_func_snprintf_directive_n="guessing yes";;
1778 # Guess yes on IRIX >= 6.5.
1779 irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";;
1780 # Guess yes on OSF/1 >= 5.
1781 osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
1782 osf*) gl_cv_func_snprintf_directive_n="guessing yes";;
1783 # Guess yes on NetBSD >= 3. 1892 # Guess yes on NetBSD >= 3.
1784 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) 1893 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
1785 gl_cv_func_snprintf_directive_n="guessing no";; 1894 gl_cv_func_snprintf_directive_n="guessing no";;
@@ -1934,8 +2043,6 @@ changequote(,)dnl
1934 # Guess yes on AIX >= 4. 2043 # Guess yes on AIX >= 4.
1935 aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; 2044 aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
1936 aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; 2045 aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1937 # Guess yes on IRIX >= 6.5.
1938 irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1939 # Guess yes on NetBSD >= 3. 2046 # Guess yes on NetBSD >= 3.
1940 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) 2047 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
1941 gl_cv_func_vsnprintf_zerosize_c99="guessing no";; 2048 gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
@@ -2143,20 +2250,22 @@ dnl 11 = gl_PRINTF_DIRECTIVE_LS
2143dnl 12 = gl_PRINTF_DIRECTIVE_LC 2250dnl 12 = gl_PRINTF_DIRECTIVE_LC
2144dnl 13 = gl_PRINTF_POSITIONS 2251dnl 13 = gl_PRINTF_POSITIONS
2145dnl 14 = gl_PRINTF_FLAG_GROUPING 2252dnl 14 = gl_PRINTF_FLAG_GROUPING
2146dnl 15 = gl_PRINTF_FLAG_LEFTADJUST 2253dnl 15 = gl_PRINTF_FLAG_GROUPING_INT_PRECISION
2147dnl 16 = gl_PRINTF_FLAG_ZERO 2254dnl 16 = gl_PRINTF_FLAG_GROUPING_MULTIBYTE
2148dnl 17 = gl_PRINTF_FLAG_ALT_PRECISION_ZERO 2255dnl 17 = gl_PRINTF_FLAG_LEFTADJUST
2149dnl 18 = gl_PRINTF_PRECISION 2256dnl 18 = gl_PRINTF_FLAG_ZERO
2150dnl 19 = gl_PRINTF_ENOMEM 2257dnl 19 = gl_PRINTF_FLAG_ALT_PRECISION_ZERO
2151dnl 20 = gl_SNPRINTF_PRESENCE 2258dnl 20 = gl_PRINTF_PRECISION
2152dnl 21 = gl_SNPRINTF_TRUNCATION_C99 2259dnl 21 = gl_PRINTF_ENOMEM
2153dnl 22 = gl_SNPRINTF_RETVAL_C99 2260dnl 22 = gl_SNPRINTF_PRESENCE
2154dnl 23 = gl_SNPRINTF_DIRECTIVE_N 2261dnl 23 = gl_SNPRINTF_TRUNCATION_C99
2155dnl 24 = gl_SNPRINTF_SIZE1 2262dnl 24 = gl_SNPRINTF_RETVAL_C99
2156dnl 25 = gl_VSNPRINTF_ZEROSIZE_C99 2263dnl 25 = gl_SNPRINTF_DIRECTIVE_N
2157dnl 26 = gl_SWPRINTF_WORKS 2264dnl 26 = gl_SNPRINTF_SIZE1
2158dnl 27 = gl_SWPRINTF_DIRECTIVE_LA 2265dnl 27 = gl_VSNPRINTF_ZEROSIZE_C99
2159dnl 28 = gl_SWPRINTF_DIRECTIVE_LC 2266dnl 28 = gl_SWPRINTF_WORKS
2267dnl 29 = gl_SWPRINTF_DIRECTIVE_LA
2268dnl 30 = gl_SWPRINTF_DIRECTIVE_LC
2160dnl 2269dnl
2161dnl 1 = checking whether printf supports size specifiers as in C99... 2270dnl 1 = checking whether printf supports size specifiers as in C99...
2162dnl 2 = checking whether printf supports size specifiers as in C23... 2271dnl 2 = checking whether printf supports size specifiers as in C23...
@@ -2172,62 +2281,64 @@ dnl 11 = checking whether printf supports the 'ls' directive...
2172dnl 12 = checking whether printf supports the 'lc' directive correctly... 2281dnl 12 = checking whether printf supports the 'lc' directive correctly...
2173dnl 13 = checking whether printf supports POSIX/XSI format strings with positions... 2282dnl 13 = checking whether printf supports POSIX/XSI format strings with positions...
2174dnl 14 = checking whether printf supports the grouping flag... 2283dnl 14 = checking whether printf supports the grouping flag...
2175dnl 15 = checking whether printf supports the left-adjust flag correctly... 2284dnl 15 = checking whether printf supports grouping on integers with a precision...
2176dnl 16 = checking whether printf supports the zero flag correctly... 2285dnl 16 = checking whether printf supports grouping with a multibyte separator...
2177dnl 17 = checking whether printf supports the alternative flag with a zero precision... 2286dnl 17 = checking whether printf supports the left-adjust flag correctly...
2178dnl 18 = checking whether printf supports large precisions... 2287dnl 18 = checking whether printf supports the zero flag correctly...
2179dnl 19 = checking whether printf survives out-of-memory conditions... 2288dnl 19 = checking whether printf supports the alternative flag with a zero precision...
2180dnl 20 = checking for snprintf... 2289dnl 20 = checking whether printf supports large precisions...
2181dnl 21 = checking whether snprintf truncates the result as in C99... 2290dnl 21 = checking whether printf survives out-of-memory conditions...
2182dnl 22 = checking whether snprintf returns a byte count as in C99... 2291dnl 22 = checking for snprintf...
2183dnl 23 = checking whether snprintf fully supports the 'n' directive... 2292dnl 23 = checking whether snprintf truncates the result as in C99...
2184dnl 24 = checking whether snprintf respects a size of 1... 2293dnl 24 = checking whether snprintf returns a byte count as in C99...
2185dnl 25 = checking whether vsnprintf respects a zero size as in C99... 2294dnl 25 = checking whether snprintf fully supports the 'n' directive...
2186dnl 26 = checking whether swprintf works... 2295dnl 26 = checking whether snprintf respects a size of 1...
2187dnl 27 = checking whether swprintf supports the 'La' and 'LA' directives... 2296dnl 27 = checking whether vsnprintf respects a zero size as in C99...
2188dnl 28 = checking whether swprintf supports the 'lc' directive... 2297dnl 28 = checking whether swprintf works...
2298dnl 29 = checking whether swprintf supports the 'La' and 'LA' directives...
2299dnl 30 = checking whether swprintf supports the 'lc' directive...
2189dnl 2300dnl
2190dnl . = yes, # = no. 2301dnl . = yes, # = no.
2191dnl 2302dnl
2192dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 2303dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
2193dnl musl libc 1.2.3 . # . . . . # # . . . # . . . . ? . . . . . . . . # . # 2304dnl musl libc 1.2.3 . # . . . . # # . . . # . . . . . . . . . . . . . . . # . #
2194dnl glibc 2.35 . # . . . . . . . . . . . . . . . . . . . . . . . . . . 2305dnl glibc 2.35 . # . . . . . . . . . . . . # . . . . . . . . . . . . . . .
2195dnl glibc 2.5 . # . . . . # # . . . . . . . . . . . . . . . . . . # . 2306dnl glibc 2.5 . # . . . . # # . . . . . . # . . . . . . . . . . . . . # .
2196dnl glibc 2.3.6 . # . . . # # # . . . . . . . . . . . . . . . . . . # . 2307dnl glibc 2.3.6 . # . . . # # # . . . . . . . . . . . . . . . . . . . . # .
2197dnl FreeBSD 14.0 . . . . . # . . . . . . . . . . . . # . . . . . . # . # 2308dnl FreeBSD 14.0 . . . . . # . . . . . . . . # . . . . . # . . . . . . # . #
2198dnl FreeBSD 13.0 . # . . . # # # . . . . . . . . . . # . . . . . . # . # 2309dnl FreeBSD 13.0 . # . . . # # # . . . . . . # . . . . . # . . . . . . # . #
2199dnl FreeBSD 5.4, 6.1 . # . . . # # # . . . . . . . # ? . # . . . . . . # ? ? 2310dnl FreeBSD 5.4, 6.1 . # . . . # # # . . . . . . . . . # ? . # . . . . . . # ? ?
2200dnl Mac OS X 10.13.5 . # . . # # # # . # . . . . . . . . . . . . # . . # ? ? 2311dnl Mac OS X 10.13.5 . # . . # # # # . # . . . . ? ? . . . . . . . . # . . # ? ?
2201dnl Mac OS X 10.5.8 . # . . # # # # . . . . . . . # # . . . . . . . . # ? ? 2312dnl Mac OS X 10.5.8 . # . . # # # # . . . . . . ? ? . # # . . . . . . . . # ? ?
2202dnl Mac OS X 10.3.9 . # . . . # # # . . . . . . . # # . # . . . . . . # ? ? 2313dnl Mac OS X 10.3.9 . # . . . # # # . . . . . . ? ? . # # . # . . . . . . # ? ?
2203dnl OpenBSD 6.0, 6.7 . # . . . # # # . . . . . . . . . . # . . . . . . # . # 2314dnl OpenBSD 6.0, 6.7 . # . . . # # # . . . . . . . . . . . . # . . . . . . # . #
2204dnl OpenBSD 3.9, 4.0 . # . # # # # # # . # . . # . # ? . # . . . . . . # ? ? 2315dnl OpenBSD 3.9, 4.0 . # . # # # # # # . # . . # ? ? . # ? . # . . . . . . # ? ?
2205dnl Cygwin 1.7.0 (2009) . # . . # . # # . . ? ? . . . . ? . ? . . . . . . ? ? ? 2316dnl Cygwin 1.7.0 (2009) . # . . # . # # . . ? ? . . ? ? . . ? . ? . . . . . . ? ? ?
2206dnl Cygwin 1.5.25 (2008) . # . . # # # # . . # ? . . . . ? . # . . . . . . ? ? ? 2317dnl Cygwin 1.5.25 (2008) . # . . # # # # . . # ? . . ? ? . . ? . # . . . . . . ? ? ?
2207dnl Cygwin 1.5.19 (2006) # # . . # # # # # . # ? . # . # ? # # . . . . . . ? ? ? 2318dnl Cygwin 1.5.19 (2006) # # . . # # # # # . # ? . # ? ? . # ? # # . . . . . . ? ? ?
2208dnl Solaris 11.4 . # . # # # # # . . # . . . . # . . . . . . . . . . # . 2319dnl Solaris 11.4 . # . # # # # # . . # . . . # # . # . . . . . . . . . . # .
2209dnl Solaris 11.3 . # . . . # # # . . # . . . . . . . . . . . . . . . # . 2320dnl Solaris 11.3 . # . . . # # # . . # . . . ? ? . . . . . . . . . . . . # .
2210dnl Solaris 11.0 . # . # # # # # . . # . . . . # . . . . . . . . . ? ? ? 2321dnl Solaris 11.0 . # . # # # # # . . # . . . ? ? . # . . . . . . . . . ? ? ?
2211dnl Solaris 10 . # . # # # # # . . # . . . . # . # . . . . . . . . # . 2322dnl Solaris 10 . # . # # # # # . . # . . . # # . # . # . . . . . . . . # .
2212dnl Solaris 2.6 ... 9 # # . # # # # # # . # . . . . # ? # . . . # . . . ? ? ? 2323dnl Solaris 2.6 ... 9 # # . # # # # # # . # . . . ? ? . # ? # . . . # . . . ? ? ?
2213dnl Solaris 2.5.1 # # . # # # # # # . # . . . . # ? . . # # # # # # ? ? ? 2324dnl Solaris 2.5.1 # # . # # # # # # . # . . . ? ? . # ? . . # # # # # # ? ? ?
2214dnl AIX 7.1 . # . # # # # # . . . . . . . # . # . . . . . . . # . . 2325dnl AIX 7.1 . # . # # # # # . . . . . . . . . # . # . . . . . . . # . .
2215dnl AIX 5.2 . # . # # # # # . . . . . . . # ? . . . . . . . . # ? ? 2326dnl AIX 5.2 . # . # # # # # . . . . . . ? ? . # ? . . . . . . . . # ? ?
2216dnl AIX 4.3.2, 5.1 # # . # # # # # # . . . . . . # ? . . . . # . . . # ? ? 2327dnl AIX 4.3.2, 5.1 # # . # # # # # # . . . . . ? ? . # ? . . . . # . . . # ? ?
2217dnl HP-UX 11.31 . # . . . # # # . . . ? . . . # ? . . . . # # . . ? ? ? 2328dnl HP-UX 11.31 . # . . . # # # . . . ? . . ? ? . # ? . . . . # # . . ? ? ?
2218dnl HP-UX 11.{00,11,23} # # . . . # # # # . . ? . . . # ? . . . . # # . # ? ? ? 2329dnl HP-UX 11.{00,11,23} # # . . . # # # # . . ? . . ? ? . # ? . . . . # # . # ? ? ?
2219dnl HP-UX 10.20 # # . # . # # # # . ? ? . . # # ? . . . . # # ? # ? ? ? 2330dnl HP-UX 10.20 # # . # . # # # # . ? ? . . ? ? # # ? . . . . # # ? # ? ? ?
2220dnl IRIX 6.5 # # . # # # # # # . # . . . . # ? . . . . # . . . # ? ? 2331dnl IRIX 6.5 # # . # # # # # # . # . . . ? ? . # ? . . . . # . . . # ? ?
2221dnl OSF/1 5.1 # # . # # # # # # . . ? . . . # ? . . . . # . . # ? ? ? 2332dnl OSF/1 5.1 # # . # # # # # # . . ? . . ? ? . # ? . . . . # . . # ? ? ?
2222dnl OSF/1 4.0d # # . # # # # # # . . ? . . . # ? . . # # # # # # ? ? ? 2333dnl OSF/1 4.0d # # . # # # # # # . . ? . . ? ? . # ? . . # # # # # # ? ? ?
2223dnl NetBSD 9.0 . # . . . # # # . . . . . . . . . . . . . . . . . # . # 2334dnl NetBSD 9.0 . # . . . # # # . . . . . . # # . . . . . . . . . . . # . #
2224dnl NetBSD 5.0 . # . . # # # # . . . . . . . # ? . # . . . . . . # ? ? 2335dnl NetBSD 5.0 . # . . # # # # . . . . . . ? ? . # ? . # . . . . . . # ? ?
2225dnl NetBSD 4.0 . # ? ? ? ? # # ? . ? . . ? ? ? ? ? ? . . . ? ? ? # ? ? 2336dnl NetBSD 4.0 . # ? ? ? ? # # ? . ? . . ? ? ? ? ? ? ? ? . . . ? ? ? # ? ?
2226dnl NetBSD 3.0 . # . . . # # # # . ? . # # ? # ? . # . . . . . . # ? ? 2337dnl NetBSD 3.0 . # . . . # # # # . ? . # # ? ? ? # ? . # . . . . . . # ? ?
2227dnl Haiku . # . . # # # # # . # ? . . . . ? . ? . . ? . . . . # . 2338dnl Haiku . # . . # # # # # . # ? . . # . . . ? . ? . . ? . . . . # .
2228dnl BeOS # # # . # # # # # . ? ? # . ? . ? # ? . . ? . . . ? ? ? 2339dnl BeOS # # # . # # # # # . ? ? # . ? ? ? . ? # ? . . ? . . . ? ? ?
2229dnl Android 4.3 . # . # # # # # # # # ? . # . # ? . # . . . # . . ? ? ? 2340dnl Android 4.3 . # . # # # # # # # # ? . # ? ? . # ? . # . . . # . . ? ? ?
2230dnl old mingw / msvcrt # # # # # # # # # . . ? # # . # ? # ? . # # # . . # ? ? 2341dnl old mingw / msvcrt # # # # # # # # # . . ? # # ? ? . # ? # ? . # # # . . # ? ?
2231dnl MSVC 9 # # # # # # # # # # . ? # # . # ? # ? # # # # . . # ? ? 2342dnl MSVC 9 # # # # # # # # # # . ? # # ? ? . # ? # ? # # # # . . # ? ?
2232dnl mingw 2009-2011 . # # . # . # # . . . ? # # . . ? . ? . . . . . . # ? ? 2343dnl mingw 2009-2011 . # # . # . # # . . . ? # # ? ? . . ? . ? . . . . . . # ? ?
2233dnl mingw-w64 2011 # # # # # # # # # . . ? # # . # ? # ? . # # # . . # ? ? 2344dnl mingw-w64 2011 # # # # # # # # # . . ? # # ? ? . # ? # ? . # # # . . # ? ?