[compiler-rt] [ubsan] Fix printing of floats in mingw mode
authorMartin Storsjö <martin@martin.st>
Wed, 12 Apr 2023 08:38:05 +0000 (08:38 +0000)
committerMartin Storsjö <martin@martin.st>
Thu, 13 Apr 2023 09:03:34 +0000 (12:03 +0300)
commitfb012c1eeb50500bbd1f289b50aa08d1e2f10098
tree209006ed5ee073bd623dc53444ea3e46409ab1eb
parent6d7d0ed4a9918e57be5f9f36269ef3f165e72287
[compiler-rt] [ubsan] Fix printing of floats in mingw mode

In mingw mode on x86, long doubles are 80 bit - while MSVC mode uses
long doubles that are equal to regular doubles (on all architectures).

In the case of this formatting function, we're calling a MS CRT
provided printf function which interprets long doubles as 64 bit.

Since the long doubles are equal to regular doubles on all MSVC
platforms, just use regular double formatting. For MSVC environments
there's no difference, but for mingw environments, this avoids the
ambiguity.

Differential Revision: https://reviews.llvm.org/D148133
compiler-rt/lib/ubsan/ubsan_diag.cpp