On Thu, Sep 17, 2009 at 5:55 AM, Erik de Castro Lopo <mle+...@mega-nerd.com> wrote: > Hi all, > > I'm using mingw-w64-bin_i686-linux_20090612.tar.bz2 which is the latest > I can find and running into problems compiling stuff like: > > printf ("Bad file length (%" PRId64 " should be %zd).\n", retval, sizeof > (data_out)) ; > > The code works correctly for standard modern gccs on Linux systems > and in the Ubuntu Linux -> mingw32 cross compiler. > > However, for the Linux -> mingw-win64 cross compiler I get: > > test.c:135:2: error: unknown conversion type character 'z' in format > test.c:135:2: error: too many arguments for format > > In all of the above I am compiling with -std=gnu99. > > It would be really nice it this could be fixed. > > Cheers, > Erik > -- > ---------------------------------------------------------------------- > Erik de Castro Lopo > http://www.mega-nerd.com/
I'm not sure whether msvcrt supports the %z size_t conversion. You can, however, use the posix compliant mingw version. You can do it by either of these two ways: 1. You can compile your source with the __USE_MINGW_ANSI_STDIO macro defined as 1, adding -D__USE_MINGW_ANSI_STDIO=1 to your gcc command line. This way, all printf family of functions will be relaced by __mingw_printf, __mingw_fprintf, etc. 2. Or, you can explicitly use __mingw_printf at the specific places that is required. Hope this helps. -- Ozkan ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public