]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
inttypes-h tests: Avoid compilation error on mingw.
authorBruno Haible <bruno@clisp.org>
Tue, 16 Sep 2025 19:35:12 +0000 (21:35 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 16 Sep 2025 19:35:12 +0000 (21:35 +0200)
Reported by Michele Locati in
<https://lists.gnu.org/archive/html/bug-gettext/2024-09/msg00015.html>.

* tests/test-inttypes-h.c (l): On mingw without __USE_MINGW_ANSI_STDIO,
don't test for the presence of SCN*8, SCN*LEAST8, SCN*FAST8}.
* doc/posix-headers/inttypes.texi: Mention the mingw bug.

ChangeLog
doc/posix-headers/inttypes.texi
tests/test-inttypes-h.c

index 58e2bde0254a632fb94c5d69958d55843a55ef9c..54db84a8cb82f67718f309def4132b33b8a2ff5a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-09-16  Bruno Haible  <bruno@clisp.org>
+
+       inttypes-h tests: Avoid compilation error on mingw.
+       Reported by Michele Locati in
+       <https://lists.gnu.org/archive/html/bug-gettext/2024-09/msg00015.html>.
+       * tests/test-inttypes-h.c (l): On mingw without __USE_MINGW_ANSI_STDIO,
+       don't test for the presence of SCN*8, SCN*LEAST8, SCN*FAST8}.
+       * doc/posix-headers/inttypes.texi: Mention the mingw bug.
+
 2025-09-16  Pádraig Brady  <P@draigBrady.com>
 
        cpu-supports: remove assert dependency
index b3ac4104beebf5d8a2f5d1e0accfc7e2af62af2c..7d69491aaead2fbb435c3494f1fb6bc31695c08b 100644 (file)
@@ -30,7 +30,11 @@ macros such as @code{PRIdMAX}.
 Portability problems not fixed by Gnulib:
 @itemize
 @item
-The @code{PRIb*}, @code{PRIB*}, @code{SCNb*} macros,
+The macros @code{SCN*8}, @code{SCN*LEAST8}, @code{SCN*FAST8}
+are missing on some platforms:
+mingw without @code{__USE_MINGW_ANSI_STDIO}.
+@item
+The macros @code{PRIb*}, @code{PRIB*}, @code{SCNb*},
 that were added in ISO C 23,
 are missing on many platforms:
 glibc 2.37 and many others.
index 08cd32baf220ae4c3c7e46d7053e315ebf26b621..5887a2bceb74c919c9bbbee8a6d6c75793e08c33 100644 (file)
@@ -66,11 +66,13 @@ const char *k = /* implicit string concatenation */
 #endif
   ;
 const char *l = /* implicit string concatenation */
-#ifdef INT8_MAX
+#if !(defined __MINGW32__ && __USE_MINGW_ANSI_STDIO == 0)
+# ifdef INT8_MAX
   SCNd8 SCNi8
-#endif
-#ifdef UINT8_MAX
+# endif
+# ifdef UINT8_MAX
   SCNo8 SCNu8 SCNx8
+# endif
 #endif
 #ifdef INT16_MAX
   SCNd16 SCNi16
@@ -90,12 +92,16 @@ const char *l = /* implicit string concatenation */
 #ifdef UINT64_MAX
   SCNo64 SCNu64 SCNx64
 #endif
+#if !(defined __MINGW32__ && __USE_MINGW_ANSI_STDIO == 0)
   SCNdLEAST8 SCNiLEAST8 SCNoLEAST8 SCNuLEAST8 SCNxLEAST8
+#endif
   SCNdLEAST16 SCNiLEAST16 SCNoLEAST16 SCNuLEAST16 SCNxLEAST16
   SCNdLEAST32 SCNiLEAST32 SCNoLEAST32 SCNuLEAST32 SCNxLEAST32
   SCNdLEAST64 SCNiLEAST64
   SCNoLEAST64 SCNuLEAST64 SCNxLEAST64
+#if !(defined __MINGW32__ && __USE_MINGW_ANSI_STDIO == 0)
   SCNdFAST8 SCNiFAST8 SCNoFAST8 SCNuFAST8 SCNxFAST8
+#endif
   SCNdFAST16 SCNiFAST16 SCNoFAST16 SCNuFAST16 SCNxFAST16
   SCNdFAST32 SCNiFAST32 SCNoFAST32 SCNuFAST32 SCNxFAST32
   SCNdFAST64 SCNiFAST64