qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] target/m68k: Remove sprintf() calls


From: Richard Henderson
Subject: Re: [PATCH 2/2] target/m68k: Remove sprintf() calls
Date: Thu, 11 Apr 2024 14:58:40 -0700
User-agent: Mozilla Thunderbird

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 via email to

[Prev in Thread] Current Thread [Next in Thread]