This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/37768] bogus warnings on x86_64-mingw32 due to attribute((format(printf))) breakage



------- Comment #1 from joseph at codesourcery dot com  2008-10-08 16:15 -------
Subject: Re:   New: bogus warnings on x86_64-mingw32 due to
 attribute((format(printf))) breakage

On Wed, 8 Oct 2008, mikpe at it dot uu dot se wrote:

> When gcc is configured to generate code for x86_64-pc-mingw32, that is MinGW
> for 64-bit Windows, attribute((format(printf))) is redefined by the backend to
> be compatible with MSVC's runtime library, which differs significantly from
> C99.

Correct.  This is the conclusion we eventually reached, that "printf" 
would be for the system formats (e.g. for a function wrapping a call to a 
system function), that "gnu_printf" would be for the formats accepted by 
the GNU C Library (including GNU extensions) on all platforms and that 
"ms_printf" would be for the MSVC formats, on Windows platforms only.

> The program below illustrates the issue. It declares a private C99-compliant
> snprintf() implementation and invokes it with "%zu" and "%llx" formats. This
> triggers the following bogus warnings on x86_64-pc-mingw32:

Use gnu_printf for such an implementation.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37768


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]