+2023-03-05 Paul Eggert <eggert@cs.ucla.edu>
+
+ stdio: suppress macOS 13 sprintf warnings
+ * lib/stdio.in.h (_POSIX_C_SOURCE, _GL_DEFINED__POSIX_C_SOURCE):
+ Suppress deprecation warnings for sprintf and vsprintf
+ that were introduced in macOS 13. These are not useful
+ for Gnulib itself, and are more likely than not to be
+ merely an annoyance for Gnulib-using code.
+
2023-03-05 Bruno Haible <bruno@clisp.org>
timespec_get tests: Add comment.
@item
This function can crash in out-of-memory conditions on some platforms:
FreeBSD 13.0, NetBSD 5.0.
+@item
+The compiler warns that this function is deprecated:
+macOS 13.0.
@end itemize
Portability problems not fixed by Gnulib:
When formatting an integer with grouping flag, this function inserts thousands
separators even in the "C" locale on some platforms:
NetBSD 5.1.
-@item
-The compiler warns that this function is deprecated:
-macOS 13.0
@end itemize
@item
This function can crash in out-of-memory conditions on some platforms:
FreeBSD 13.0, NetBSD 5.0.
+@item
+The compiler warns that this function is deprecated:
+macOS 13.0.
@end itemize
Portability problems not fixed by Gnulib:
When formatting an integer with grouping flag, this function inserts thousands
separators even in the "C" locale on some platforms:
NetBSD 5.1.
-@item
-The compiler warns that this function is deprecated:
-macOS 13.0
@end itemize
#ifndef _@GUARD_PREFIX@_STDIO_H
+/* Suppress macOS deprecation warnings for sprintf and vsprintf. */
+#if (defined __APPLE__ && defined __MACH__) && !defined _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 200809L
+# define _GL_DEFINED__POSIX_C_SOURCE
+#endif
+
#define _GL_ALREADY_INCLUDING_STDIO_H
/* The include_next requires a split double-inclusion guard. */
#undef _GL_ALREADY_INCLUDING_STDIO_H
+#ifdef _GL_DEFINED__POSIX_C_SOURCE
+# undef _GL_DEFINED__POSIX_C_SOURCE
+# undef _POSIX_C_SOURCE
+#endif
+
#ifndef _@GUARD_PREFIX@_STDIO_H
#define _@GUARD_PREFIX@_STDIO_H