Le Mon, 05 Dec 2011 16:50:15 -0500,
Boris Gjenero <boris.gjenero_at_gmail.com> a écrit :
> On 05/12/2011 12:53 PM, Rafaël Carré wrote:
> > Le Mon, 05 Dec 2011 12:37:20 -0500,
> > Boris Gjenero<boris.gjenero_at_gmail.com> a écrit :
> >> Some other warnings are due to use of z in format specifiers, for
> >> printing size_t data. This warning is false for things displayed on the
> >> simulated device (eg. panicf()), but z really does not work when
> >> printing directly to standard output (eg. DEBUGF()).
> > if you define __USE_MINGW_ANSI_STDIO then the unix format specifiers
> > should be used instead of incompatible microsoft format (and %zu should work)
> Yes, that makes DEBUGF() work. However, the resulting #define for printf
> breaks ATTRIBUTE_PRINTF, like you reported here:
> It doesn't seem like MinGW-64 will be using the patch you posted.
A different patch has been committed upstream and is in 2.0.1 (which is
in Debian sid, and I use it on Ubuntu), the mingw-64 people suggested
always using __printf__ to avoid this problem in the meantime
> I just tried i686-pc-mingw32-gcc because of the other response by Magnus
> Holmgren. It works much better. The only warnings relate to format
> specifiers, and z in DEBUGF() works without any additional defines. I
> guess the best course of action is to use i686-pc-mingw32-gcc and not
> bother fixing stuff for i686-w64-mingw32-gcc.
I'm using mingw-64 myself (for it's windows 64 features) for VLC so I
could take a look. Note that atm VLC built in 32bits mode doesn't work
correctly but the 64bits version works fine
> There doesn't seem to be any way to tell gcc that some printf-like
> function supports a different set of format specifiers. Those warnings
> can only be turned off completely via -Wno-format. Configure should add
> that option that when Windows sim. Those warnings aren't very useful
> anyways, because gcc doesn't know what Rockbox format() supports.
rockbox always uses c99/unix/gnu format ("printf" or "gnu_printf" in
gcc), not the microsoft format ("ms_printf") afaik.
I don't remember what is microsoft format exactly but it's better to
use the C99 functions with that define to avoid a lot of trouble,
that's what we do in VLC
Received on 2011-12-05