bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Minsoo Choo <fel1x.mintchoco.development@gmail.com>
To: bug-gnulib@gnu.org
Cc: Minsoo Choo <minsoochoo0122@proton.me>
Subject: [PATCH silence -Wdeprecation-warning for sprintf on macOS] silence sprintf deprecation warning
Date: Thu, 24 Nov 2022 21:28:31 -0500	[thread overview]
Message-ID: <20221125022831.51236-1-minsoochoo0122@proton.me> (raw)

---
sprintf is deprecated on macOS. Silence this warning by silencing
-Wdeprecated-declartions.

#if __GUNC__ >= 3 && defined(__APPLE__)
can be used as alternative if we don't want to disable this warning on
every system.

 lib/vasnprintf.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index 01d18bf59..577dbbcd3 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -68,6 +68,11 @@
 # pragma GCC diagnostic ignored "-Wanalyzer-null-argument"
 #endif
 
+/* Using sprintf here is safe. Silence -Wdeprecated-declartions warning. */
+#if __GNUC__ >= 3
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 #include <alloca.h>
 
 /* Specification.  */

base-commit: 6ec9bc73686fd42d0a1a82c914d89176745cddbd
-- 
2.37.1 (Apple Git-137.1)



             reply	other threads:[~2022-11-25  2:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25  2:28 Minsoo Choo [this message]
2022-11-25 22:25 ` [PATCH silence -Wdeprecation-warning for sprintf on macOS] silence sprintf deprecation warning Bruno Haible
2022-11-26  1:54   ` Sam James
2022-11-26  4:13   ` Minsoo Choo
2022-11-26  3:31 ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221125022831.51236-1-minsoochoo0122@proton.me \
    --to=fel1x.mintchoco.development@gmail.com \
    --cc=bug-gnulib@gnu.org \
    --cc=minsoochoo0122@proton.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).