From: Bruno Haible Date: Sun, 13 Apr 2025 15:48:56 +0000 (+0200) Subject: vasnprintf tests: Fix compilation error on MSVC (regression yesterday). X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=3fe7fc5c1e407c6fb7d26da602528c71e25f41bb;p=gnulib.git vasnprintf tests: Fix compilation error on MSVC (regression yesterday). * tests/test-vasnprintf-posix2.c (main): Disable the new test on platforms where the 'long double' value range is insufficient. * tests/test-vasnwprintf-posix2.c (main): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 637749b681..4a03f49618 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2025-04-13 Bruno Haible + + vasnprintf tests: Fix compilation error on MSVC (regression yesterday). + * tests/test-vasnprintf-posix2.c (main): Disable the new test on + platforms where the 'long double' value range is insufficient. + * tests/test-vasnwprintf-posix2.c (main): Likewise. + 2025-04-13 Bruno Haible *printf: Document a Haiku bug. diff --git a/tests/test-vasnprintf-posix2.c b/tests/test-vasnprintf-posix2.c index 55e26d666f..55af1f7484 100644 --- a/tests/test-vasnprintf-posix2.c +++ b/tests/test-vasnprintf-posix2.c @@ -20,6 +20,7 @@ #include "vasnprintf.h" +#include #include #include #include @@ -439,6 +440,7 @@ main (int argc, char *argv[]) } free (result); } + #if LDBL_MAX_10_EXP > 500 /* This test used to crash in the Solaris libc, for all Solaris versions. */ { @@ -446,6 +448,7 @@ main (int argc, char *argv[]) char *result = asnprintf (NULL, &length, "%'.500Lg\n", 42351647362715016953416125033982098102569580078125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0L); free (result); } + #endif } return test_exit_status; diff --git a/tests/test-vasnwprintf-posix2.c b/tests/test-vasnwprintf-posix2.c index 394e872e26..719c932a41 100644 --- a/tests/test-vasnwprintf-posix2.c +++ b/tests/test-vasnwprintf-posix2.c @@ -20,6 +20,7 @@ #include "vasnwprintf.h" +#include #include #include #include @@ -345,11 +346,13 @@ main (int argc, char *argv[]) && wcscmp (result + 7, L"000") == 0); free (result); } + #if LDBL_MAX_10_EXP > 500 { size_t length; wchar_t *result = asnwprintf (NULL, &length, L"%'.500Lg\n", 42351647362715016953416125033982098102569580078125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0L); free (result); } + #endif } return test_exit_status;