]> Savannah Git Hosting - gnulib.git/commitdiff
strerror, vasnprintf: pacify clang 14 on macOS
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Nov 2024 23:48:02 +0000 (15:48 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Nov 2024 23:51:40 +0000 (15:51 -0800)
* lib/strerror.c, lib/vasnprintf.c: Pacify clang 14 on macOS 12.6.

ChangeLog
lib/strerror.c
lib/vasnprintf.c

index c4b2290d6cf94c750c6d49ed0fb5dbc0f636974d..4a6ace7d16b6a76369649abd5e58e6aeee48540b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-11-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       strerror, vasnprintf: pacify clang 14 on macOS
+       * lib/strerror.c, lib/vasnprintf.c: Pacify clang 14 on macOS 12.6.
+
 2024-11-19  Pádraig Brady  <P@draigBrady.com>
 
        unicodeio: avoid iconv issues for most ASCII characters
index 6b760ff45c0e6a4b4f17f7ce6b6061923983eada..3c0b4cdd6050ab595ffcf071f6444a1f6df36086 100644 (file)
 /* Use the system functions, not the gnulib overrides in this file.  */
 #undef sprintf
 
+/* macOS 12's "warning: 'sprintf' is deprecated" is pointless,
+   as sprintf is used safely here.  */
+#if defined __APPLE__ && defined __MACH__ && _GL_GNUC_PREREQ (4, 2)
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 char *
 strerror (int n)
 #undef strerror
index 6ae95ca5dd22f666481e6e967a79b30a91123fb2..c06ae019a58b9f814311e3b7e5e9fc870f67a7c9 100644 (file)
 /* Here we need to call the native sprintf, not rpl_sprintf.  */
 #undef sprintf
 
+/* macOS 12's "warning: 'sprintf' is deprecated" is pointless,
+   as sprintf is used safely here.  */
+#if defined __APPLE__ && defined __MACH__ && _GL_GNUC_PREREQ (4, 2)
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 /* GCC >= 4.0 with -Wall emits unjustified "... may be used uninitialized"
    warnings in this file.  Use -Dlint to suppress them.  */
 #if defined GCC_LINT || defined lint