Martell Malone
2017-06-12 15:24:17 UTC
In this thread https://sourceforge.net/p/mingw-w64/bugs/459/
there is a suggested fix for print with whole numbers
The builtin __mingw_printf is inconsistent with printf on %a format.
https://github.com/msys2/msys2/issues/35
and suggested a fix of removing the case to int
here is a patch that does just that.
Please Review
diff --git a/mingw-w64-crt/stdio/mingw_pformat.c
b/mingw-w64-crt/stdio/mingw_pformat.c
index 445320c0..3c7f0833 100644
--- a/mingw-w64-crt/stdio/mingw_pformat.c
+++ b/mingw-w64-crt/stdio/mingw_pformat.c
@@ -2113,7 +2113,7 @@ void __pformat_emit_xfloat( __pformat_fpreg_t value,
__pformat_t *stream )
/* taking the rightmost digit in each pass...
*/
int c = value.__pformat_fpreg_mantissa & 0xF;
- if( c == (int) value.__pformat_fpreg_mantissa)
+ if( c == value.__pformat_fpreg_mantissa)
{
/* inserting the radix point, when we reach the last,
* (i.e. the most significant digit), unless we found no
there is a suggested fix for print with whole numbers
The builtin __mingw_printf is inconsistent with printf on %a format.
I think __mingw_printf is wrong, because obviously 1.0 != 0x0p-63.
vacaboja opened an issue on msys2 for thishttps://github.com/msys2/msys2/issues/35
and suggested a fix of removing the case to int
here is a patch that does just that.
Please Review
diff --git a/mingw-w64-crt/stdio/mingw_pformat.c
b/mingw-w64-crt/stdio/mingw_pformat.c
index 445320c0..3c7f0833 100644
--- a/mingw-w64-crt/stdio/mingw_pformat.c
+++ b/mingw-w64-crt/stdio/mingw_pformat.c
@@ -2113,7 +2113,7 @@ void __pformat_emit_xfloat( __pformat_fpreg_t value,
__pformat_t *stream )
/* taking the rightmost digit in each pass...
*/
int c = value.__pformat_fpreg_mantissa & 0xF;
- if( c == (int) value.__pformat_fpreg_mantissa)
+ if( c == value.__pformat_fpreg_mantissa)
{
/* inserting the radix point, when we reach the last,
* (i.e. the most significant digit), unless we found no