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: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Sun, 21 Aug 2022 08:53:15 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1661071998; bh=jUtMT2y4LMbvxi2X0UvacxYGaYYNa22idjF0R+41nsY=; h=Date:From:To:Subject:From; b=DflByUIvpy2gCwJpw4uzzKj0I11uYZXHbDF5iNCilXAn5r+R7XDoFmWLakv5ithDU hUBChF/OMrOoBw11Mb2eEU26OecOwbiV8IBixVdRAMzd9iQKW0kWiVpu8rZ07by+RS TacT/R8OZTCPmk6l4hN+7x6MHLrGbUNhSR+L7l5mgZr5s5qoWLEdvfuTnDmrYsjJb5 pYY/z2wORVKH2P82QGX1qk9rra+FzVXh+kg0NdOzXMUteExqvZwrutC+WKJf2jNnXF UlPgDm7QLKH9ePN7VFCknBvz3xWezEI8MqdwoqwonGVv7Zcs3vqZP1GmedIXiSdhvm teSBn9HcgFd6A==
Am Sun, 21 Aug 2022 09:38:58 +0200
schrieb Christian Zietz <czietz@xxxxxxx>:
> Hello,
>
> after updating my Windows cross-compiling environment to Debian 11
> ("bullseye") with x86_64-w64-mingw32-gcc 10, I get some warnings related
> to the "%lld" format specifier, when used in user-defined functions. For
> example:
>
> > /home/czietz/hatari/src/ide.c: In function ‘bdrv_open’:
> > /home/czietz/hatari/src/ide.c:617:27: warning: unknown conversion type character ‘l’ in format [-Wformat=]
> > 617 | Log_AlertDlg(LOG_ERROR, "IDE disk image size (%"PRId64" bytes) is "
> > | ^~~~~~~~~~~~~~~~~~~~~~~~
> > In file included from /home/czietz/hatari/src/ide.c:16:
> > /usr/share/mingw-w64/include/inttypes.h:33:18: note: format string is defined here
> > 33 | #define PRId64 "lld"
> > | ^
> > /home/czietz/hatari/src/ide.c:617:27: warning: too many arguments for format [-Wformat-extra-args]
> > 617 | Log_AlertDlg(LOG_ERROR, "IDE disk image size (%"PRId64" bytes) is "
> > | ^~~~~~~~~~~~~~~~~~~~~~~~
> The reason for the warning is explained here:
> https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/
>
> Note that it actually *works* fine, since -- as stated above -- the
> Windows C runtime does in fact know about "%lld" in all currently
> supported Windows versions. Therefore, this is a superfluous warning, imho.
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.
By the way, the problem also occurred earlier already with Fedora:
https://git.tuxfamily.org/hatari/hatari.git/commit/?id=89ce85e772bc5ccd1ddb4
Back then, I already had a look at this and decided to *not* trying to bend
Hatari around this weirdness but rather to ignore it.
Thomas