Subject: Re: bug#58966: [Trunk] Xcode 14.1+ (and macOS 13.0+) deprecate sprintf()

From: Eli Zaretskii <[email-masked]>
Date: Thu, 03 Nov 2022 11:15:33 +0200

> From: Gerd Möllmann <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Thu, 03 Nov 2022 10:00:59 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > If no better ideas come up, find a way to disable this bogus warning.
> > configure.ac has a block of lines that disable various warnings under
> > certain conditions, starting around line 1100.  There are specific
> > warnings disabled when the compiler is clang.  Add something there to
> > shut up this warning.
> 
> Thanks.  That would be
> 
> diff --git a/configure.ac b/configure.ac
> index 63cb9c412e..c9d1eb5709 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1144,6 +1144,12 @@ AC_DEFUN
>      gl_WARN_ADD([-Wno-int-in-bool-context])
>    fi
>  
> +  # Suppress deprecation warnings from using sprintf variants,
> +  # starting with Xcode 14.1 on macOS 13.
> +  if test $opsys = darwin; then
> +    gl_WARN_ADD([-Wno-deprecated-declarations])
> +  fi
> +
>    # This causes too much noise in the MinGW build
>    if test $opsys = mingw32; then
>      gl_WARN_ADD([-Wno-pointer-sign])
> 
> Ok to install?

Yes, but perhaps condition that on the version of the
compiler/Xcode/whatever?  I mean, could this warning be useful in some
other cases?