From: Paul Eggert Date: Tue, 19 Nov 2024 23:48:02 +0000 (-0800) Subject: strerror, vasnprintf: pacify clang 14 on macOS X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=985dd3e7079506b384ec3e24b1cafbca3ac2b744;p=gnulib.git strerror, vasnprintf: pacify clang 14 on macOS * lib/strerror.c, lib/vasnprintf.c: Pacify clang 14 on macOS 12.6. --- diff --git a/ChangeLog b/ChangeLog index c4b2290d6c..4a6ace7d16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2024-11-19 Paul Eggert + + 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 unicodeio: avoid iconv issues for most ASCII characters diff --git a/lib/strerror.c b/lib/strerror.c index 6b760ff45c..3c0b4cdd60 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -31,6 +31,12 @@ /* 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 diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index 6ae95ca5dd..c06ae019a5 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -217,6 +217,12 @@ /* 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