| 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 09:00:33 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017;	t=1661072435; bh=qDGpbM0O5evUVLV+ysN5zT6QnxLddrIeCfoyjhHTras=;	h=Date:From:To:Subject:From;	b=l+5J70kT1RGD4T7e1aTlftg+6eNTQ2kBHcIaa0nX3DT6gxlY9bpaDKrVKFo+64gp2	 KRLMNeeFMFpNI4RN3RzAsmwNyqxOeua1w9l2v926ajATp+gLLXjtlVhAL4HXTEDUd/	 FygUtw+evVyt4NETNANtccQ8Ef8JjVahMuRmfZxLaRfmsqRp+kYylDMM/FruOGks5p	 jjDs4PF2sIwI9RUIg3N1vizT5h+gDXVPxK+1iBDduHELZ4AdBVBTh0+SerJQQM4vkP	 WzCct+NcXzru1DLluxYddjPSj4co242A4cAtFw0fm4/JUg/3ZYDadaM/lqofR/6MPT	 3Ss/O4fXyMXzg==
Am Sun, 21 Aug 2022 08:53:15 +0000
schrieb Thomas Huth <th.huth@xxxxxxxxx>:
> 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.
By the way, it seems to have been fixed in later versions of Fedora again, I
apparently switched back from fedora:33 to fedora:latest here:
 https://git.tuxfamily.org/hatari/hatari.git/commit/?id=08bc35c605c825ce
So if this bugs you in Debian, you should ask them whether it's possible to
backport the fix there, too.
 Thomas