Re: [hatari-devel] sprintf deprecated in macOS 13.0 |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] sprintf deprecated in macOS 13.0
- From: Andreas Grabher <andreas_g86@xxxxxxxxxx>
- Date: Sun, 6 Nov 2022 11:09:45 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1667729399; bh=9AvC8AdMVY+MELLZLLBesPD7DckCZ3PrboRYwEO5YZA=; h=From:Content-Type:Mime-Version:Subject:Date:To:Message-Id; b=b6P41e1LfQbqUB9V0xrAS80fnvH+/OWNSAQ3ajK2A72UByvZ9jz2xwQDABa/DCimS JXHLGRyo6zVU86bl1xi9JaC+bpafrSVbXGvJM3Rxy+kjzo+SP7+Bu9ptG+d2yeg6q1 hzGBgAlt8W8M8I1FzK3MpkbXZn1QNIOtldjqyrD3bfhuSeQ4/41sdlLRhSWZPnDWkF GHiJNmXjuKRApzsw6E+WQI1QN+I1uv4wsVNEuUIFmNKIE+/c3CfGMh67MmtloiV6/i 35j+EHidY2kjpWW8/a+rgiNeN1/lV9xyBUGy3ofTRf+sF2Jn8v6I1D2ORHuTmUEUhM Re/dFZJrOi97g==
> Am 06.11.2022 um 01:13 schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
>
> Hi,
>
> On 5.11.2022 18.37, Andreas Grabher wrote:
>>> Am 05.11.2022 um 11:38 schrieb Thomas Huth <th.huth@xxxxxxxxx>:
>>> schrieb Andreas Grabher <andreas_g86@xxxxxxxxxx>:
>>>> it seems sprintf is deprecated in macOS 13.0. I am getting lots of warnings. They recommend to replace it with snprintf. I think we should do that.
>>>
>>> Uh, that will be another big code churn ... but I agree, it's likely a good
>>> idea. Do you maybe want to do the convertion in the DSP code in
>>> Previous? ... then I could port the patch to Hatari.
>>>
>> I appended a patch for the DSP code. It replaces all sprintf() with snprintf(). There are quite a lot left in other parts of the code, but not all are shared between Previous and Hatari.
>
> Thanks!
>
> Otherwise the patch seems fine, but why you're doing these buffer size increases:
> -------------------------------------------
> -static char str_instr[80];
> -static char str_instr2[120];
> +static char str_instr[96];
> +static char str_instr2[192];
> -------------------------------------------
> ?
>
> These are static buffers, so their sizes are known at compile time i.e. GCC should have already been giving warnings if they would have been too small...
>
>
> - Eero
>
This has been left from some experiment. Sorry! Can be undone. On the other hand it won’t really harm either.