On 1/18/24 12:46, JonY wrote:
Attached patch OK?
Changes unsigned int to unsigned long to match __gdtoa due to gcc
becoming more strict with pointer types.
Attached v2 patch, removed #ifdef and made the type Ulong like the
prototype.
From 1415ff7f9b835e9ea39864c9625ec6fb72682918 Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10wa...@gmail.com>
Date: Thu, 18 Jan 2024 12:42:51 +0000
Subject: [PATCH] __pformat_fpreg_bits: change to match __gdtoa prototype
The variable is only used within mingw_pformat.c, increasing
strictness in newer versions of GCC has turned this into an
error despite both integer widths are 32bit.
Correct so it matches the __gdtoa prototype declaration.
Signed-off-by: Jonathan Yong <10wa...@gmail.com>
---
mingw-w64-crt/stdio/mingw_pformat.c | 65 ++---------------------------
1 file changed, 3 insertions(+), 62 deletions(-)
diff --git a/mingw-w64-crt/stdio/mingw_pformat.c b/mingw-w64-crt/stdio/mingw_pformat.c
index 87902aea2..fd53ce1a8 100644
--- a/mingw-w64-crt/stdio/mingw_pformat.c
+++ b/mingw-w64-crt/stdio/mingw_pformat.c
@@ -1026,6 +1026,8 @@ void __pformat_xint( int fmt, __pformat_intarg_t value, __pformat_t *stream )
__pformat_putc( '\x20', stream );
}
+#include "../gdtoa/gdtoa.h"
+
typedef union
{
/* A multifaceted representation of an IEEE extended precision,
@@ -1039,15 +1041,9 @@ typedef union
signed short __pformat_fpreg_exponent;
};
unsigned short __pformat_fpreg_bitmap[5];
- unsigned int __pformat_fpreg_bits;
+ ULong __pformat_fpreg_bits;
} __pformat_fpreg_t;
-#ifdef _WIN32
-/* TODO: make this unconditional in final release...
- * (see note at head of associated `#else' block.
- */
-#include "../gdtoa/gdtoa.h"
-
static __pformat_fpreg_t init_fpreg_ldouble( long double val )
{
__pformat_fpreg_t x;
@@ -1167,61 +1163,6 @@ char *__pformat_fcvt( long double x, int precision, int *dp, int *sign )
#define __pformat_ecvt_release( value ) __freedtoa( value )
#define __pformat_fcvt_release( value ) __freedtoa( value )
-#else
-/*
- * TODO: remove this before final release; it is included here as a
- * convenience for testing, without requiring a working `__gdtoa()'.
- */
-static
-char *__pformat_ecvt( long double x, int precision, int *dp, int *sign )
-{
- /* Define in terms of `ecvt()'...
- */
- char *retval = ecvt( (double)(x), precision, dp, sign );
- if( isinf( x ) || isnan( x ) )
- {
- /* emulating `__gdtoa()' reporting for infinities and NaN.
- */
- *dp = PFORMAT_INFNAN;
- if( *retval == '-' )
- {
- /* Need to force the `sign' flag, (particularly for NaN).
- */
- ++retval; *sign = 1;
- }
- }
- return retval;
-}
-
-static
-char *__pformat_fcvt( long double x, int precision, int *dp, int *sign )
-{
- /* Define in terms of `fcvt()'...
- */
- char *retval = fcvt( (double)(x), precision, dp, sign );
- if( isinf( x ) || isnan( x ) )
- {
- /* emulating `__gdtoa()' reporting for infinities and NaN.
- */
- *dp = PFORMAT_INFNAN;
- if( *retval == '-' )
- {
- /* Need to force the `sign' flag, (particularly for NaN).
- */
- ++retval; *sign = 1;
- }
- }
- return retval;
-}
-
-/* No memory pool clean up needed, for these emulated cases...
- */
-#define __pformat_ecvt_release( value ) /* nothing to be done */
-#define __pformat_fcvt_release( value ) /* nothing to be done */
-
-/* TODO: end of conditional to be removed. */
-#endif
-
static
void __pformat_emit_radix_point( __pformat_t *stream )
{
--
2.43.0
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public