[hatari-devel] Warnings with Windows build |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: [hatari-devel] Warnings with Windows build
- From: Christian Zietz <czietz@xxxxxxx>
- Date: Sun, 21 Aug 2022 09:38:58 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661067540; bh=4c7qJUed4IKoAC7qESpv38yEIhaNhZ2cNCG64+0bs5E=; h=X-UI-Sender-Class:Date:To:From:Subject; b=kOENX+9L6/277O4DirKjwYkhe2OoP/UER/pEHs3N24q34E5jghiVw8Xw+Hch1+BM1 I9n6gzjSWGU7GW4RA7pvGBvxgnQsprLk4uxCeUxl+P7OQKn8H1k5c8bkoiU2qiKiMD qdby0jIhILWNSWfEUlrGFbI1CcSKHOQZxhWLOxyU=
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..
The workaround described above (__MINGW_PRINTF_FORMAT macro) will of
course fail when building for other platforms. I don't know whether the
Hatari developers like to build another macro on top of it.
Regards
Christian
--
Christian Zietz - CHZ-Soft - czietz@xxxxxxx
WWW: https://www.chzsoft.de/
PGP/GnuPG-Key-ID: 0x52CB97F66DA025CA / 0x6DA025CA