Re: [hatari-devel] printf for 64 bit value and %PRId64/ %I64d |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: Nicolas Pomarède <npomarede@xxxxxxxxxxxx>
- Subject: Re: [hatari-devel] printf for 64 bit value and %PRId64/ %I64d
- From: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Sun, 18 Jul 2021 07:44:30 +0000
- Cc: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1626594272; bh=PlVhhTW89ZsEAnaD8Ib2l/Bm5NnjRNsB4/ShPp0KhbI=; h=Date:From:To:Cc:Subject:From; b=LslKn9mm1uEw3H3MSGt/yHVxUv3yTutk5BevTYhhaENQaYlvJ+6yA3oobvEs99pbP sg7OONdJR1v2O6P52JWfMOdQnmBzYXKjOgppRPBvrO+RbmJ5hB2E0pDHiGe/K52fXt UoLC5f0P+zfE2F3cM40zndSUou1kW0OxADgrn+Ei8z/BPZnJR27CaCn6cMqCkXonQp dB3YRH2xpSgDrXMeZPDN1CsShwWviZn22uby7AxUWZDNlmhj9n9W2zX/lFgjjkwUnI VikN2GW33xINtS0ybv3mgzfQY38nXeUC17B1/sMa0Ils2w7/tyGI9Ic3qZi2NlC6o8 x6MS3ACoNuqeA==
Am Sat, 17 Jul 2021 19:06:15 +0000
schrieb Thomas Huth <th.huth@xxxxxxxxx>:
> Am Sat, 17 Jul 2021 17:25:33 +0200
> schrieb Nicolas Pomarède <npomarede@xxxxxxxxxxxx>:
>
> > Hi
> >
> > it seems that with recent version of mingw/gcc that I'm using
> > there's now an error when using the portable %PRId64 macro to print
> > 64 bit integer and crosscompiling under linux to do a Windows build
> > :
> >
> >
> > /home/npomarede/src/win/src/gemdos.c: In function
> > 'restore_file_handle_info':
> > /home/npomarede/src/win/src/gemdos.c:891:24: warning: unknown
> > conversion type character 'l' in format [-Wformat=]
> > 891 | Log_Printf(LOG_WARN, "GEMDOS '%s' handle %d cannot be
> > restored, seek to saved offset %"PRId64" failed for: %s\n",
> > |
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > In file included from /home/npomarede/src/win/src/gemdos.c:42:
> > /usr/x86_64-w64-mingw32/sys-root/mingw/include/inttypes.h:33:18:
> > note: format string is defined here
> > 33 | #define PRId64 "lld"
> > | ^
> >
> > One possible fix for this is to do :
> >
> > #define PRId64 "I64d"
> >
> > only when compiling for windows (as %I64d seems to be more
> > supported under Windows)
> >
> > Any other idea how to fix this in the most clean/secure way ?
>
> IIRC I once hit this problem already, too, when the Fedora container
> in the gitlab-CI got upgraded to F34 (see commit 89ce85e772bc5ccd1)
> ... I had a look at it, but did not come to a clean solution. I think
> it has something to do with MinGW supporting both, the printf-style
> functions from the MS runtime, and the C99-style macros, at the same
> time.
>
> I did not find a clean solution back then and simply downgraded the
> container to F33 to "fix" it.
FYI, I now also check compilation with Fedora 35 / rawhide, and the
problem is gone there again:
https://gitlab.com/huth/hatari/-/jobs/1432821700
So it seems like this was just a temporary bug in one release of MinGW
which has been fixed again in newer versions. I think we can simply
ignore this.
Thomas