Rockbox mail archive
Subject: Re: Should the sim compile cleanly in Cygwin using i686-w64-mingw32-gcc?
Re: Should the sim compile cleanly in Cygwin using i686-w64-mingw32-gcc?
On 05/12/2011 5:26 PM, Rafaël Carré wrote:
> Le Mon, 05 Dec 2011 16:50:15 -0500,
> Boris Gjenero<boris.gjenero_at_gmail.com> a écrit :
>> 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
I was referring to how Rockbox only supports a subset of the Unix
format. In firmware/libc/sprintf.c, there is the following comment:
> * Minimal printf and snprintf formatting functions
> * These support %c %s %d and %x
> * Field width and zero-padding flag only
You can see the actual code interpreting the format in
firmware/common/format.c. It supports a bit more but it certainly
doesn't support everything at:
For example, if you try to print an int using %i, gcc won't warn you
about it, and you'll just see an i where the number should be. Because
of this, -Wformat is of limited use.
Received on 2011-12-06
Page was last modified "Jan 10 2012" The Rockbox Crew