qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: Laurent Vivier <laurent@vivier.eu>
Subject: Re: [PATCH 2/2] target/m68k: Remove sprintf() calls
Date: Thu, 11 Apr 2024 14:58:40 -0700	[thread overview]
Message-ID: <df7769d1-33bc-4d50-b9b7-d02c92753910@linaro.org> (raw)
In-Reply-To: <20240411213933.36548-3-philmd@linaro.org>

On 4/11/24 14:39, Philippe Mathieu-Daudé wrote:
> sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1,
> resulting in painful developper experience.
> 
> Since they are very few register names, use const arrays instead
> of trying to be clever generating the names. This silences:
> 
>    [2/8] Compiling C object libqemu-m68k-softmmu.fa.p/target_m68k_translate.c.o
>    target/m68k/translate.c:92:9: warning: 'sprintf' is deprecated:
>      This function is provided for compatibility reasons only.
>      Due to security concerns inherent in the design of sprintf(3),
>      it is highly recommended that you use snprintf(3) instead.
>      [-Wdeprecated-declarations]
>          sprintf(p, "D%d", i);
>          ^
>          sprintf(p, "A%d", i);
>          ^
>          sprintf(p, "ACC%d", i);
>          ^
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   target/m68k/translate.c | 27 +++++++++++++++------------
>   1 file changed, 15 insertions(+), 12 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


      reply	other threads:[~2024-04-11 21:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-11 21:39 [PATCH 0/2] m68k: Remove sprintf() calls due to macOS deprecation Philippe Mathieu-Daudé
2024-04-11 21:39 ` [PATCH 1/2] disas/m68k: Replace sprintf() by snprintf() Philippe Mathieu-Daudé
2024-04-11 21:57   ` Richard Henderson
2024-04-11 21:39 ` [PATCH 2/2] target/m68k: Remove sprintf() calls Philippe Mathieu-Daudé
2024-04-11 21:58   ` Richard Henderson [this message]

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

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

  git send-email \
    --in-reply-to=df7769d1-33bc-4d50-b9b7-d02c92753910@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=laurent@vivier.eu \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 NNTP newsgroup(s).