Unlike what the current gnulib documentation says, MSVC 14
  - has <stdint.h>,
  - supports %td, %zu, %ju in *printf (verified through the
    attached program).
At least, that's what I see in my older MSVC env from 2017/2018.


2023-09-05  Bruno Haible  <[email protected]>

        stdint, *printf: Update doc about MSVC.
        * doc/posix-headers/stdint.texi: MSVC 14 has <stdint.h>.
        * doc/posix-functions/*printf.texi: Current mingw and MSVC 14 support
        the j, t, z size specifiers.
        * doc/glibc-functions/obstack_*printf.texi: Likewise.

diff --git a/doc/posix-headers/stdint.texi b/doc/posix-headers/stdint.texi
index 7f33b20d23..f2082d18aa 100644
--- a/doc/posix-headers/stdint.texi
+++ b/doc/posix-headers/stdint.texi
@@ -9,7 +9,7 @@
 @itemize
 @item
 This header file is missing on some platforms:
-OpenBSD 3.8, AIX 5.1, HP-UX 11.11, IRIX 6.5, MSVC 14.
+OpenBSD 3.8, AIX 5.1, HP-UX 11.11, IRIX 6.5, MSVC 9.
 @item
 This header file is very incomplete on some platforms.
 @item
diff --git a/doc/glibc-functions/obstack_printf.texi 
b/doc/glibc-functions/obstack_printf.texi
index 18d82a903c..e74327db21 100644
--- a/doc/glibc-functions/obstack_printf.texi
+++ b/doc/glibc-functions/obstack_printf.texi
@@ -25,7 +25,7 @@
 @item
 This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
 @code{j}, @code{t}, @code{z}) on some platforms:
-AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
+AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, old mingw, MSVC 9.
 @item
 printf of @samp{long double} numbers is unsupported on some platforms:
 mingw, MSVC 14.
diff --git a/doc/glibc-functions/obstack_vprintf.texi 
b/doc/glibc-functions/obstack_vprintf.texi
index 6d7ba77b30..1799832b58 100644
--- a/doc/glibc-functions/obstack_vprintf.texi
+++ b/doc/glibc-functions/obstack_vprintf.texi
@@ -25,7 +25,7 @@
 @item
 This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
 @code{j}, @code{t}, @code{z}) on some platforms:
-AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
+AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, old mingw, MSVC 9.
 @item
 printf of @samp{long double} numbers is unsupported on some platforms:
 mingw, MSVC 14.
diff --git a/doc/posix-functions/fprintf.texi b/doc/posix-functions/fprintf.texi
index be20b67079..e08ece4869 100644
--- a/doc/posix-functions/fprintf.texi
+++ b/doc/posix-functions/fprintf.texi
@@ -11,7 +11,7 @@
 @item
 This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
 @code{j}, @code{t}, @code{z}) on some platforms:
-AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
+AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, old mingw, MSVC 9.
 @item
 This function does not support size specifiers as in C23 (@code{w8},
 @code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
diff --git a/doc/posix-functions/printf.texi b/doc/posix-functions/printf.texi
index 38489e292a..4af0105b66 100644
--- a/doc/posix-functions/printf.texi
+++ b/doc/posix-functions/printf.texi
@@ -11,7 +11,7 @@
 @item
 This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
 @code{j}, @code{t}, @code{z}) on some platforms:
-AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
+AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, old mingw, MSVC 9.
 @item
 This function does not support size specifiers as in C23 (@code{w8},
 @code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
diff --git a/doc/posix-functions/snprintf.texi 
b/doc/posix-functions/snprintf.texi
index 25e86e6fea..7446b88f5f 100644
--- a/doc/posix-functions/snprintf.texi
+++ b/doc/posix-functions/snprintf.texi
@@ -26,7 +26,7 @@
 @item
 This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
 @code{j}, @code{t}, @code{z}) on some platforms:
-AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
+AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, old mingw, MSVC 9.
 @item
 This function does not support size specifiers as in C23 (@code{w8},
 @code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
diff --git a/doc/posix-functions/sprintf.texi b/doc/posix-functions/sprintf.texi
index 6aaf7b4b93..8cd5de619f 100644
--- a/doc/posix-functions/sprintf.texi
+++ b/doc/posix-functions/sprintf.texi
@@ -11,7 +11,7 @@
 @item
 This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
 @code{j}, @code{t}, @code{z}) on some platforms:
-AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
+AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, old mingw, MSVC 9.
 @item
 This function does not support size specifiers as in C23 (@code{w8},
 @code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
diff --git a/doc/posix-functions/vfprintf.texi 
b/doc/posix-functions/vfprintf.texi
index 6d1c1600fd..c80599e06a 100644
--- a/doc/posix-functions/vfprintf.texi
+++ b/doc/posix-functions/vfprintf.texi
@@ -11,7 +11,7 @@
 @item
 This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
 @code{j}, @code{t}, @code{z}) on some platforms:
-AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
+AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, old mingw, MSVC 9.
 @item
 This function does not support size specifiers as in C23 (@code{w8},
 @code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
diff --git a/doc/posix-functions/vprintf.texi b/doc/posix-functions/vprintf.texi
index d277d3b1f8..733032c5f4 100644
--- a/doc/posix-functions/vprintf.texi
+++ b/doc/posix-functions/vprintf.texi
@@ -11,7 +11,7 @@
 @item
 This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
 @code{j}, @code{t}, @code{z}) on some platforms:
-AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
+AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, old mingw, MSVC 9.
 @item
 This function does not support size specifiers as in C23 (@code{w8},
 @code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
diff --git a/doc/posix-functions/vsnprintf.texi 
b/doc/posix-functions/vsnprintf.texi
index 24b39bffb5..c00aec68dd 100644
--- a/doc/posix-functions/vsnprintf.texi
+++ b/doc/posix-functions/vsnprintf.texi
@@ -23,7 +23,7 @@
 @item
 This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
 @code{j}, @code{t}, @code{z}) on some platforms:
-AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
+AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, old mingw, MSVC 9.
 @item
 This function does not support size specifiers as in C23 (@code{w8},
 @code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
diff --git a/doc/posix-functions/vsprintf.texi 
b/doc/posix-functions/vsprintf.texi
index 0b8079df23..84bf7eec6f 100644
--- a/doc/posix-functions/vsprintf.texi
+++ b/doc/posix-functions/vsprintf.texi
@@ -11,7 +11,7 @@
 @item
 This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
 @code{j}, @code{t}, @code{z}) on some platforms:
-AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
+AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, old mingw, MSVC 9.
 @item
 This function does not support size specifiers as in C23 (@code{w8},
 @code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

int main ()
{
  printf ("%ju %d\n", (uintmax_t) 0xDEADBEEFCAFEBABE, 12345);
  printf ("%zu %d\n", (size_t) 0xDEADBEEFCAFEBABE, 12345);
  printf ("%tu %d\n", (ptrdiff_t) 0xDEADBEEFCAFEBABE, 12345);
  printf ("%lu %d\n", (size_t) 0xDEADBEEFCAFEBABE, 12345);
  printf ("%u %d\n", (size_t) 0xDEADBEEFCAFEBABE, 12345);
}

Reply via email to