在 2018/10/27 上午5:57, Mateusz 写道:
> W dniu 26.10.2018 o 22:35, Tom Ritter pisze:
>> This is not really a MinGW problem, but MinGW does diverge from other
>> compilers and it caused Firefox to crash.
>>
>> MinGW defines a lot of I64[foo] format specifiers in inttypes.h.
>> clang and clang-cl don't use I64[foo] they use ll[foo]. (I64[foo] is
>> valid according to Microsoft. MinGW mentions "MS runtime does not yet
>> understand C9x standard "ll"" but at some point they started
>> supporting ll[foo].  And as I mentioned, that's what clang[-cl] uses.
>>
>> Mozilla has our own implementation of printf that does the format
>> specifier parsing. We don't support I64[foo]. So using it caused data
>> corruption and general bad behavior. Switching to ll[foo] fixed it.
>>
>> I have a patch here:
>> https://hg.mozilla.org/try/raw-file/eaae7782a1dd/build/build-clang/mingw-int.patch
> 
> You can try to define
> __USE_MINGW_ANSI_STDIO
> instead of patching mingw-w64
> 
> 

It is the correct solution to define `__USE_MINGW_ANSI_STDIO` when
compiling Firefox, just like what libstdc++ does.

As for the patch:  The name `DEFINE_TWO_VERSION` is not descriptive for
this macro's purpose, and not suitable within a standard library header
because it doesn't start with an underscore. A better name would look
like `__MINGW_SELECT_C99_STDIO_FORMAT`.


-- 
Best regards,
LH_Mouse

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to