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

(Try run for Firefox is here if anyone is interested:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5db7504d12cf2e5181f2fcd46e09df37e0e80159&selectedJob=208082989
)

It may be desirable to take this patch, even though I64[foo] is valid,
just because ll[foo] is much more common and it will unify behavior
across compilers.  (It would also be helpful for me; but we can
support local patches to MinGW if you don't want to upstream this.)

I64[foo] -> ll[foo] is not the only difference. The following
illustrates other differences:
https://ritter.vg/misc/transient/format-specifiers-diff.html

-tom


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

Reply via email to