From: Bruno Haible Date: Tue, 16 Sep 2025 19:35:12 +0000 (+0200) Subject: inttypes-h tests: Avoid compilation error on mingw. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9a1a8cd09a7d2b2c3e35788aa58ecbd5a35f7cc;p=thirdparty%2Fgnulib.git inttypes-h tests: Avoid compilation error on mingw. Reported by Michele Locati in . * 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. --- diff --git a/ChangeLog b/ChangeLog index 58e2bde025..54db84a8cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2025-09-16 Bruno Haible + + inttypes-h tests: Avoid compilation error on mingw. + Reported by Michele Locati in + . + * 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 cpu-supports: remove assert dependency diff --git a/doc/posix-headers/inttypes.texi b/doc/posix-headers/inttypes.texi index b3ac4104be..7d69491aae 100644 --- a/doc/posix-headers/inttypes.texi +++ b/doc/posix-headers/inttypes.texi @@ -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. diff --git a/tests/test-inttypes-h.c b/tests/test-inttypes-h.c index 08cd32baf2..5887a2bceb 100644 --- a/tests/test-inttypes-h.c +++ b/tests/test-inttypes-h.c @@ -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