[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch] Use inttypes macros for size_t format string


On Thursday, 16 January 2020 12:30:24 CET Jakub Jelen wrote:
> > > > It's not really a compiler bug. See here:
> > > > https://stackoverflow.com/questions/44382862/how-to-printf-a-size-t-wi
> > > > thou
> > > > t-> warning-in-mingw-w64-gcc-7-1
> > > 
> > > According to that you need to compile with:
> > > 
> > > cmake -DCMAKE_C_FLAGS="-D__USE_MINGW_ANSI_STDIO=1" ..
> > 
> > Alternative seems to be:
> > 
> > -Dsnprintf=__mingw_snprintf -Dvsnprintf=__mingw_vsnprintf ...
> 
> Is this something that can be automatically done by some cmake check if
> the mingw cross-compilation is detected?

I think till needs to confirm it works and then I can you can do:

if (MINGW AND WIN32)
    add_definitions(__USE_MINGW_ANSI_STDIO=1)
endif()


...

-- 
Andreas Schneider                 asn@xxxxxxxxxxxxxx
GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D



Archive administrator: postmaster@lists.cynapses.org