Re: [hatari-devel] Warnings with Windows build

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


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



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/