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

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


On 16.01.20 13:41, Andreas Schneider wrote:

> 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()
>
Yes, works!

The resulting DLL seam to be the same as with _POSIX_SOURCE.... Not
binary equal though, but objdump -d of both matches exactly.

By the way there's another issue with MinGW and pthread. But I'll
address this in a new... thread.

Thanks


Archive administrator: postmaster@lists.cynapses.org