]> Savannah Git Hosting - gnulib.git/commitdiff
vasnprintf tests: Fix compilation error on MSVC (regression yesterday).
authorBruno Haible <bruno@clisp.org>
Sun, 13 Apr 2025 15:48:56 +0000 (17:48 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 13 Apr 2025 15:48:56 +0000 (17:48 +0200)
* 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.

ChangeLog
tests/test-vasnprintf-posix2.c
tests/test-vasnwprintf-posix2.c

index 637749b6819105a8b3dcbb420f683b32ea15333d..4a03f496183dd4fdeafd514d0357c626f0c714ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-04-13  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        *printf: Document a Haiku bug.
index 55e26d666fd363674cd8314d674e03a4c86c1e56..55af1f74842a052ba7fcc4d1b2740afd568b2c74 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "vasnprintf.h"
 
+#include <float.h>
 #include <locale.h>
 #include <stdlib.h>
 #include <string.h>
@@ -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.
        <https://www.illumos.org/issues/17383>  */
     {
@@ -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;
index 394e872e26587f2eb0833091283e797f044a605e..719c932a41f7b7313fa529b6f057e61c84c93c3e 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "vasnwprintf.h"
 
+#include <float.h>
 #include <locale.h>
 #include <stdlib.h>
 #include <string.h>
@@ -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;