diff options
Diffstat (limited to 'gl/m4/printf.m4')
| -rw-r--r-- | gl/m4/printf.m4 | 317 |
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 |
| 3 | dnl Copyright (C) 2003, 2007-2024 Free Software Foundation, Inc. | 3 | dnl Copyright (C) 2003, 2007-2026 Free Software Foundation, Inc. |
| 4 | dnl This file is free software; the Free Software Foundation | 4 | dnl This file is free software; the Free Software Foundation |
| 5 | dnl gives unlimited permission to copy and/or distribute it, | 5 | dnl gives unlimited permission to copy and/or distribute it, |
| 6 | dnl with or without modifications, as long as this notice is preserved. | 6 | dnl with or without modifications, as long as this notice is preserved. |
| 7 | dnl This file is offered as-is, without any warranty. | ||
| 7 | 8 | ||
| 8 | dnl Test whether the *printf family of functions supports the 'j', 'z', 't', | 9 | dnl Test whether the *printf family of functions supports the 'j', 'z', 't', |
| 9 | dnl 'L' size specifiers. (ISO C99, POSIX:2001) | 10 | dnl 'L' size specifiers. (ISO C99, POSIX:2001) |
| @@ -616,6 +617,7 @@ static double zero = 0.0; | |||
| 616 | int main () | 617 | int 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 | ||
| 1188 | dnl Test whether the *printf family of functions supports POSIX/XSI format | ||
| 1189 | dnl strings with the ' flag for grouping of decimal digits on integers, | ||
| 1190 | dnl together with a precision. | ||
| 1191 | dnl Result is gl_cv_func_printf_flag_grouping_int_precision. | ||
| 1192 | |||
| 1193 | AC_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> | ||
| 1214 | static char buf[100]; | ||
| 1215 | int 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 | |||
| 1241 | dnl Test whether the *printf family of functions supports POSIX/XSI format | ||
| 1242 | dnl strings with the ' flag for grouping of decimal digits, when the thousands | ||
| 1243 | dnl separator is a multibyte character (such as U+00A0 or U+202F in a UTF-8 | ||
| 1244 | dnl locale). | ||
| 1245 | dnl Result is gl_cv_func_printf_flag_grouping_multibyte. | ||
| 1246 | |||
| 1247 | AC_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> | ||
| 1268 | static char buf[100]; | ||
| 1269 | int 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 | |||
| 1176 | dnl Test whether the *printf family of functions supports the - flag correctly. | 1294 | dnl Test whether the *printf family of functions supports the - flag correctly. |
| 1177 | dnl (ISO C99.) See | 1295 | dnl (ISO C99.) See |
| 1178 | dnl <https://lists.gnu.org/r/bug-coreutils/2008-02/msg00035.html> | 1296 | dnl <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 | |||
| 1591 | dnl Test whether the return value of the snprintf function is the number | 1700 | dnl Test whether the return value of the snprintf function is the number |
| 1592 | dnl of bytes (excluding the terminating NUL) that would have been produced | 1701 | dnl of bytes (excluding the terminating NUL) that would have been produced |
| 1593 | dnl if the buffer had been large enough. (ISO C99, POSIX:2001) | 1702 | dnl if the buffer had been large enough. (ISO C99, POSIX:2001) |
| 1594 | dnl For example, this test program fails on IRIX 6.5: | 1703 | dnl For example, this test program fails on HP-UX 11.31 and Solaris 9: |
| 1595 | dnl --------------------------------------------------------------------- | 1704 | dnl --------------------------------------------------------------------- |
| 1596 | dnl #include <stdio.h> | 1705 | dnl #include <stdio.h> |
| 1597 | dnl int main() | 1706 | dnl 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 | |||
| 2143 | dnl 12 = gl_PRINTF_DIRECTIVE_LC | 2250 | dnl 12 = gl_PRINTF_DIRECTIVE_LC |
| 2144 | dnl 13 = gl_PRINTF_POSITIONS | 2251 | dnl 13 = gl_PRINTF_POSITIONS |
| 2145 | dnl 14 = gl_PRINTF_FLAG_GROUPING | 2252 | dnl 14 = gl_PRINTF_FLAG_GROUPING |
| 2146 | dnl 15 = gl_PRINTF_FLAG_LEFTADJUST | 2253 | dnl 15 = gl_PRINTF_FLAG_GROUPING_INT_PRECISION |
| 2147 | dnl 16 = gl_PRINTF_FLAG_ZERO | 2254 | dnl 16 = gl_PRINTF_FLAG_GROUPING_MULTIBYTE |
| 2148 | dnl 17 = gl_PRINTF_FLAG_ALT_PRECISION_ZERO | 2255 | dnl 17 = gl_PRINTF_FLAG_LEFTADJUST |
| 2149 | dnl 18 = gl_PRINTF_PRECISION | 2256 | dnl 18 = gl_PRINTF_FLAG_ZERO |
| 2150 | dnl 19 = gl_PRINTF_ENOMEM | 2257 | dnl 19 = gl_PRINTF_FLAG_ALT_PRECISION_ZERO |
| 2151 | dnl 20 = gl_SNPRINTF_PRESENCE | 2258 | dnl 20 = gl_PRINTF_PRECISION |
| 2152 | dnl 21 = gl_SNPRINTF_TRUNCATION_C99 | 2259 | dnl 21 = gl_PRINTF_ENOMEM |
| 2153 | dnl 22 = gl_SNPRINTF_RETVAL_C99 | 2260 | dnl 22 = gl_SNPRINTF_PRESENCE |
| 2154 | dnl 23 = gl_SNPRINTF_DIRECTIVE_N | 2261 | dnl 23 = gl_SNPRINTF_TRUNCATION_C99 |
| 2155 | dnl 24 = gl_SNPRINTF_SIZE1 | 2262 | dnl 24 = gl_SNPRINTF_RETVAL_C99 |
| 2156 | dnl 25 = gl_VSNPRINTF_ZEROSIZE_C99 | 2263 | dnl 25 = gl_SNPRINTF_DIRECTIVE_N |
| 2157 | dnl 26 = gl_SWPRINTF_WORKS | 2264 | dnl 26 = gl_SNPRINTF_SIZE1 |
| 2158 | dnl 27 = gl_SWPRINTF_DIRECTIVE_LA | 2265 | dnl 27 = gl_VSNPRINTF_ZEROSIZE_C99 |
| 2159 | dnl 28 = gl_SWPRINTF_DIRECTIVE_LC | 2266 | dnl 28 = gl_SWPRINTF_WORKS |
| 2267 | dnl 29 = gl_SWPRINTF_DIRECTIVE_LA | ||
| 2268 | dnl 30 = gl_SWPRINTF_DIRECTIVE_LC | ||
| 2160 | dnl | 2269 | dnl |
| 2161 | dnl 1 = checking whether printf supports size specifiers as in C99... | 2270 | dnl 1 = checking whether printf supports size specifiers as in C99... |
| 2162 | dnl 2 = checking whether printf supports size specifiers as in C23... | 2271 | dnl 2 = checking whether printf supports size specifiers as in C23... |
| @@ -2172,62 +2281,64 @@ dnl 11 = checking whether printf supports the 'ls' directive... | |||
| 2172 | dnl 12 = checking whether printf supports the 'lc' directive correctly... | 2281 | dnl 12 = checking whether printf supports the 'lc' directive correctly... |
| 2173 | dnl 13 = checking whether printf supports POSIX/XSI format strings with positions... | 2282 | dnl 13 = checking whether printf supports POSIX/XSI format strings with positions... |
| 2174 | dnl 14 = checking whether printf supports the grouping flag... | 2283 | dnl 14 = checking whether printf supports the grouping flag... |
| 2175 | dnl 15 = checking whether printf supports the left-adjust flag correctly... | 2284 | dnl 15 = checking whether printf supports grouping on integers with a precision... |
| 2176 | dnl 16 = checking whether printf supports the zero flag correctly... | 2285 | dnl 16 = checking whether printf supports grouping with a multibyte separator... |
| 2177 | dnl 17 = checking whether printf supports the alternative flag with a zero precision... | 2286 | dnl 17 = checking whether printf supports the left-adjust flag correctly... |
| 2178 | dnl 18 = checking whether printf supports large precisions... | 2287 | dnl 18 = checking whether printf supports the zero flag correctly... |
| 2179 | dnl 19 = checking whether printf survives out-of-memory conditions... | 2288 | dnl 19 = checking whether printf supports the alternative flag with a zero precision... |
| 2180 | dnl 20 = checking for snprintf... | 2289 | dnl 20 = checking whether printf supports large precisions... |
| 2181 | dnl 21 = checking whether snprintf truncates the result as in C99... | 2290 | dnl 21 = checking whether printf survives out-of-memory conditions... |
| 2182 | dnl 22 = checking whether snprintf returns a byte count as in C99... | 2291 | dnl 22 = checking for snprintf... |
| 2183 | dnl 23 = checking whether snprintf fully supports the 'n' directive... | 2292 | dnl 23 = checking whether snprintf truncates the result as in C99... |
| 2184 | dnl 24 = checking whether snprintf respects a size of 1... | 2293 | dnl 24 = checking whether snprintf returns a byte count as in C99... |
| 2185 | dnl 25 = checking whether vsnprintf respects a zero size as in C99... | 2294 | dnl 25 = checking whether snprintf fully supports the 'n' directive... |
| 2186 | dnl 26 = checking whether swprintf works... | 2295 | dnl 26 = checking whether snprintf respects a size of 1... |
| 2187 | dnl 27 = checking whether swprintf supports the 'La' and 'LA' directives... | 2296 | dnl 27 = checking whether vsnprintf respects a zero size as in C99... |
| 2188 | dnl 28 = checking whether swprintf supports the 'lc' directive... | 2297 | dnl 28 = checking whether swprintf works... |
| 2298 | dnl 29 = checking whether swprintf supports the 'La' and 'LA' directives... | ||
| 2299 | dnl 30 = checking whether swprintf supports the 'lc' directive... | ||
| 2189 | dnl | 2300 | dnl |
| 2190 | dnl . = yes, # = no. | 2301 | dnl . = yes, # = no. |
| 2191 | dnl | 2302 | dnl |
| 2192 | dnl 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 | 2303 | dnl 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 |
| 2193 | dnl musl libc 1.2.3 . # . . . . # # . . . # . . . . ? . . . . . . . . # . # | 2304 | dnl musl libc 1.2.3 . # . . . . # # . . . # . . . . . . . . . . . . . . . # . # |
| 2194 | dnl glibc 2.35 . # . . . . . . . . . . . . . . . . . . . . . . . . . . | 2305 | dnl glibc 2.35 . # . . . . . . . . . . . . # . . . . . . . . . . . . . . . |
| 2195 | dnl glibc 2.5 . # . . . . # # . . . . . . . . . . . . . . . . . . # . | 2306 | dnl glibc 2.5 . # . . . . # # . . . . . . # . . . . . . . . . . . . . # . |
| 2196 | dnl glibc 2.3.6 . # . . . # # # . . . . . . . . . . . . . . . . . . # . | 2307 | dnl glibc 2.3.6 . # . . . # # # . . . . . . . . . . . . . . . . . . . . # . |
| 2197 | dnl FreeBSD 14.0 . . . . . # . . . . . . . . . . . . # . . . . . . # . # | 2308 | dnl FreeBSD 14.0 . . . . . # . . . . . . . . # . . . . . # . . . . . . # . # |
| 2198 | dnl FreeBSD 13.0 . # . . . # # # . . . . . . . . . . # . . . . . . # . # | 2309 | dnl FreeBSD 13.0 . # . . . # # # . . . . . . # . . . . . # . . . . . . # . # |
| 2199 | dnl FreeBSD 5.4, 6.1 . # . . . # # # . . . . . . . # ? . # . . . . . . # ? ? | 2310 | dnl FreeBSD 5.4, 6.1 . # . . . # # # . . . . . . . . . # ? . # . . . . . . # ? ? |
| 2200 | dnl Mac OS X 10.13.5 . # . . # # # # . # . . . . . . . . . . . . # . . # ? ? | 2311 | dnl Mac OS X 10.13.5 . # . . # # # # . # . . . . ? ? . . . . . . . . # . . # ? ? |
| 2201 | dnl Mac OS X 10.5.8 . # . . # # # # . . . . . . . # # . . . . . . . . # ? ? | 2312 | dnl Mac OS X 10.5.8 . # . . # # # # . . . . . . ? ? . # # . . . . . . . . # ? ? |
| 2202 | dnl Mac OS X 10.3.9 . # . . . # # # . . . . . . . # # . # . . . . . . # ? ? | 2313 | dnl Mac OS X 10.3.9 . # . . . # # # . . . . . . ? ? . # # . # . . . . . . # ? ? |
| 2203 | dnl OpenBSD 6.0, 6.7 . # . . . # # # . . . . . . . . . . # . . . . . . # . # | 2314 | dnl OpenBSD 6.0, 6.7 . # . . . # # # . . . . . . . . . . . . # . . . . . . # . # |
| 2204 | dnl OpenBSD 3.9, 4.0 . # . # # # # # # . # . . # . # ? . # . . . . . . # ? ? | 2315 | dnl OpenBSD 3.9, 4.0 . # . # # # # # # . # . . # ? ? . # ? . # . . . . . . # ? ? |
| 2205 | dnl Cygwin 1.7.0 (2009) . # . . # . # # . . ? ? . . . . ? . ? . . . . . . ? ? ? | 2316 | dnl Cygwin 1.7.0 (2009) . # . . # . # # . . ? ? . . ? ? . . ? . ? . . . . . . ? ? ? |
| 2206 | dnl Cygwin 1.5.25 (2008) . # . . # # # # . . # ? . . . . ? . # . . . . . . ? ? ? | 2317 | dnl Cygwin 1.5.25 (2008) . # . . # # # # . . # ? . . ? ? . . ? . # . . . . . . ? ? ? |
| 2207 | dnl Cygwin 1.5.19 (2006) # # . . # # # # # . # ? . # . # ? # # . . . . . . ? ? ? | 2318 | dnl Cygwin 1.5.19 (2006) # # . . # # # # # . # ? . # ? ? . # ? # # . . . . . . ? ? ? |
| 2208 | dnl Solaris 11.4 . # . # # # # # . . # . . . . # . . . . . . . . . . # . | 2319 | dnl Solaris 11.4 . # . # # # # # . . # . . . # # . # . . . . . . . . . . # . |
| 2209 | dnl Solaris 11.3 . # . . . # # # . . # . . . . . . . . . . . . . . . # . | 2320 | dnl Solaris 11.3 . # . . . # # # . . # . . . ? ? . . . . . . . . . . . . # . |
| 2210 | dnl Solaris 11.0 . # . # # # # # . . # . . . . # . . . . . . . . . ? ? ? | 2321 | dnl Solaris 11.0 . # . # # # # # . . # . . . ? ? . # . . . . . . . . . ? ? ? |
| 2211 | dnl Solaris 10 . # . # # # # # . . # . . . . # . # . . . . . . . . # . | 2322 | dnl Solaris 10 . # . # # # # # . . # . . . # # . # . # . . . . . . . . # . |
| 2212 | dnl Solaris 2.6 ... 9 # # . # # # # # # . # . . . . # ? # . . . # . . . ? ? ? | 2323 | dnl Solaris 2.6 ... 9 # # . # # # # # # . # . . . ? ? . # ? # . . . # . . . ? ? ? |
| 2213 | dnl Solaris 2.5.1 # # . # # # # # # . # . . . . # ? . . # # # # # # ? ? ? | 2324 | dnl Solaris 2.5.1 # # . # # # # # # . # . . . ? ? . # ? . . # # # # # # ? ? ? |
| 2214 | dnl AIX 7.1 . # . # # # # # . . . . . . . # . # . . . . . . . # . . | 2325 | dnl AIX 7.1 . # . # # # # # . . . . . . . . . # . # . . . . . . . # . . |
| 2215 | dnl AIX 5.2 . # . # # # # # . . . . . . . # ? . . . . . . . . # ? ? | 2326 | dnl AIX 5.2 . # . # # # # # . . . . . . ? ? . # ? . . . . . . . . # ? ? |
| 2216 | dnl AIX 4.3.2, 5.1 # # . # # # # # # . . . . . . # ? . . . . # . . . # ? ? | 2327 | dnl AIX 4.3.2, 5.1 # # . # # # # # # . . . . . ? ? . # ? . . . . # . . . # ? ? |
| 2217 | dnl HP-UX 11.31 . # . . . # # # . . . ? . . . # ? . . . . # # . . ? ? ? | 2328 | dnl HP-UX 11.31 . # . . . # # # . . . ? . . ? ? . # ? . . . . # # . . ? ? ? |
| 2218 | dnl HP-UX 11.{00,11,23} # # . . . # # # # . . ? . . . # ? . . . . # # . # ? ? ? | 2329 | dnl HP-UX 11.{00,11,23} # # . . . # # # # . . ? . . ? ? . # ? . . . . # # . # ? ? ? |
| 2219 | dnl HP-UX 10.20 # # . # . # # # # . ? ? . . # # ? . . . . # # ? # ? ? ? | 2330 | dnl HP-UX 10.20 # # . # . # # # # . ? ? . . ? ? # # ? . . . . # # ? # ? ? ? |
| 2220 | dnl IRIX 6.5 # # . # # # # # # . # . . . . # ? . . . . # . . . # ? ? | 2331 | dnl IRIX 6.5 # # . # # # # # # . # . . . ? ? . # ? . . . . # . . . # ? ? |
| 2221 | dnl OSF/1 5.1 # # . # # # # # # . . ? . . . # ? . . . . # . . # ? ? ? | 2332 | dnl OSF/1 5.1 # # . # # # # # # . . ? . . ? ? . # ? . . . . # . . # ? ? ? |
| 2222 | dnl OSF/1 4.0d # # . # # # # # # . . ? . . . # ? . . # # # # # # ? ? ? | 2333 | dnl OSF/1 4.0d # # . # # # # # # . . ? . . ? ? . # ? . . # # # # # # ? ? ? |
| 2223 | dnl NetBSD 9.0 . # . . . # # # . . . . . . . . . . . . . . . . . # . # | 2334 | dnl NetBSD 9.0 . # . . . # # # . . . . . . # # . . . . . . . . . . . # . # |
| 2224 | dnl NetBSD 5.0 . # . . # # # # . . . . . . . # ? . # . . . . . . # ? ? | 2335 | dnl NetBSD 5.0 . # . . # # # # . . . . . . ? ? . # ? . # . . . . . . # ? ? |
| 2225 | dnl NetBSD 4.0 . # ? ? ? ? # # ? . ? . . ? ? ? ? ? ? . . . ? ? ? # ? ? | 2336 | dnl NetBSD 4.0 . # ? ? ? ? # # ? . ? . . ? ? ? ? ? ? ? ? . . . ? ? ? # ? ? |
| 2226 | dnl NetBSD 3.0 . # . . . # # # # . ? . # # ? # ? . # . . . . . . # ? ? | 2337 | dnl NetBSD 3.0 . # . . . # # # # . ? . # # ? ? ? # ? . # . . . . . . # ? ? |
| 2227 | dnl Haiku . # . . # # # # # . # ? . . . . ? . ? . . ? . . . . # . | 2338 | dnl Haiku . # . . # # # # # . # ? . . # . . . ? . ? . . ? . . . . # . |
| 2228 | dnl BeOS # # # . # # # # # . ? ? # . ? . ? # ? . . ? . . . ? ? ? | 2339 | dnl BeOS # # # . # # # # # . ? ? # . ? ? ? . ? # ? . . ? . . . ? ? ? |
| 2229 | dnl Android 4.3 . # . # # # # # # # # ? . # . # ? . # . . . # . . ? ? ? | 2340 | dnl Android 4.3 . # . # # # # # # # # ? . # ? ? . # ? . # . . . # . . ? ? ? |
| 2230 | dnl old mingw / msvcrt # # # # # # # # # . . ? # # . # ? # ? . # # # . . # ? ? | 2341 | dnl old mingw / msvcrt # # # # # # # # # . . ? # # ? ? . # ? # ? . # # # . . # ? ? |
| 2231 | dnl MSVC 9 # # # # # # # # # # . ? # # . # ? # ? # # # # . . # ? ? | 2342 | dnl MSVC 9 # # # # # # # # # # . ? # # ? ? . # ? # ? # # # # . . # ? ? |
| 2232 | dnl mingw 2009-2011 . # # . # . # # . . . ? # # . . ? . ? . . . . . . # ? ? | 2343 | dnl mingw 2009-2011 . # # . # . # # . . . ? # # ? ? . . ? . ? . . . . . . # ? ? |
| 2233 | dnl mingw-w64 2011 # # # # # # # # # . . ? # # . # ? # ? . # # # . . # ? ? | 2344 | dnl mingw-w64 2011 # # # # # # # # # . . ? # # ? ? . # ? # ? . # # # . . # ? ? |
