Re: [hatari-devel] Warnings with Windows build |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Warnings with Windows build
- From: Christian Zietz <czietz@xxxxxxx>
- Date: Sun, 21 Aug 2022 11:03:37 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661072618; bh=VouCJniVYpjNz9fVNVbqN64XcBPZNYkB1HJ34/TZ/qo=; h=X-UI-Sender-Class:Date:To:References:From:Subject:In-Reply-To; b=aQz1QMbJam+J/lspgYavnbY48g7gMxCf9AfOlAi6sbwPaNZ5rGHmZZyEk2lvjNqTt usKpjOyVE+yfMgrIVPGPtOQ+OG3MT/T5LAgRn1Gm7PH4nEHzRmTUwwyVOXTyWNlO0t sZ/5dTtyVw6rqqov2kQ1mJSDD0l9aBI3EJaBf4E8=
Thomas Huth schrieb:
I agree, it's a completely bad warning. I would agree that something should
be done if we'd use %lld directly, but we're using the portable PRId64
macro here, and if MiNGW does not get its own macros right, it's rather a
problem on the MinGW side as far as I can tell.
I cannot agree. MinGW *does* in fact get its own macros right. Neither...
printf("%lld", (uint64_t)x);
.... nor...
printf("%" PRId64, (uint64_t)x);
.... causes a warning. This is all handled correctly by MinGW.
I can only point (for the *third* time) towards the link that I posted.
If you define you *own* function (like Hatari does) using
"__attribute__((__format__ (printf [...]", gcc cannot safely know
whether you might actually call a MSVCRT version of printf() that does
not support "%lld", like on Windows XP.
Therefore, the gcc warning is on the safe side. It is up to the program
to tell gcc that is does not intend passing the format string to a
printf() that does not support it. The link in my initial posting
explains it quite well.
Regards
Christian
--
Christian Zietz - CHZ-Soft - czietz@xxxxxxx
WWW: https://www.chzsoft.de/
PGP/GnuPG-Key-ID: 0x52CB97F66DA025CA / 0x6DA025CA