Re: [Mingw-w64-public] __pformat_fpreg_bits: change to match __gdtoa prototype

2024-01-18 Thread JonY via Mingw-w64-public

On 1/18/24 16:45, LIU Hao wrote:

在 2024-01-19 00:01, JonY via Mingw-w64-public 写道:

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.




The v2 patch looks good to me.





Thanks, pushed to master.



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


Re: [Mingw-w64-public] [PATCH] headers: do not include fltwinerror.h in winerror.h

2024-01-18 Thread Oleg Tolmatcev
Am Mi., 17. Jan. 2024 um 21:46 Uhr schrieb Biswapriyo Nath
:
>
> Could you explain what the issue was and how this patch resolves it?

Sorry I don't remember anymore. I was experimenting with TinyCC, but
there were too many problems, so I stopped it.

Best regards
Oleg Tolmatcev


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


Re: [Mingw-w64-public] __pformat_fpreg_bits: change to match __gdtoa prototype

2024-01-18 Thread LIU Hao

在 2024-01-19 00:01, JonY via Mingw-w64-public 写道:

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.



The v2 patch looks good to me.



--
Best regards,
LIU Hao



OpenPGP_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


Re: [Mingw-w64-public] __pformat_fpreg_bits: change to match __gdtoa prototype

2024-01-18 Thread JonY via Mingw-w64-public

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 +
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


Re: [Mingw-w64-public] __pformat_fpreg_bits: change to match __gdtoa prototype

2024-01-18 Thread LIU Hao

在 2024-01-18 20:55, Martin Storsjö 写道:

On Thu, 18 Jan 2024, JonY via Mingw-w64-public wrote:


Attached patch OK?

Changes unsigned int to unsigned long to match __gdtoa due to gcc becoming more strict with 
pointer types.


The change is most probably ok, but can you quote the actual warning/error that it fixes - I don't 
quite see where this struct/union member type would matter for function prototypes to match. (Recent 
Clang versions are also quite strict with such things, but hasn't errored out on this yet.)



In C conversions between pointers (and integer) were implicit. If the code was C++, it would have 
caused errors long ago.


The patch looks good to me, too. Please go ahead and apply.


--
Best regards,
LIU Hao



OpenPGP_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


Re: [Mingw-w64-public] __pformat_fpreg_bits: change to match __gdtoa prototype

2024-01-18 Thread Martin Storsjö

On Thu, 18 Jan 2024, JonY via Mingw-w64-public wrote:


Attached patch OK?

Changes unsigned int to unsigned long to match __gdtoa due to gcc becoming 
more strict with pointer types.


The change is most probably ok, but can you quote the actual warning/error 
that it fixes - I don't quite see where this struct/union member type 
would matter for function prototypes to match. (Recent Clang versions are 
also quite strict with such things, but hasn't errored out on this yet.)


// Martin



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


[Mingw-w64-public] __pformat_fpreg_bits: change to match __gdtoa prototype

2024-01-18 Thread JonY via Mingw-w64-public

Attached patch OK?

Changes unsigned int to unsigned long to match __gdtoa due to gcc 
becoming more strict with pointer types.From b73262a164978a1733777e6628c00c3672794dea Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10wa...@gmail.com>
Date: Thu, 18 Jan 2024 12:42:51 +
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mingw-w64-crt/stdio/mingw_pformat.c b/mingw-w64-crt/stdio/mingw_pformat.c
index 87902aea2..021c1eb4d 100644
--- a/mingw-w64-crt/stdio/mingw_pformat.c
+++ b/mingw-w64-crt/stdio/mingw_pformat.c
@@ -1039,7 +1039,7 @@ typedef union
 signed short __pformat_fpreg_exponent;
   };
   unsigned short __pformat_fpreg_bitmap[5];
-  unsigned int   __pformat_fpreg_bits;
+  unsigned long  __pformat_fpreg_bits;
 } __pformat_fpreg_t;
 
 #ifdef _WIN32
-- 
2.43.0

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