public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6700] PR 109125 13 regression SIGBUS in m2pim_ldtoa_ldtoa
@ 2023-03-15 21:31 Gaius Mulley
  0 siblings, 0 replies; only message in thread
From: Gaius Mulley @ 2023-03-15 21:31 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8f1711ef3486b0727ccf6b5aabddda5c7d986457

commit r13-6700-g8f1711ef3486b0727ccf6b5aabddda5c7d986457
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Wed Mar 15 21:30:33 2023 +0000

    PR 109125 13 regression SIGBUS in m2pim_ldtoa_ldtoa
    
    This patch fixes more bool int parameter mismatches
    found in dtoa and ldtoa.
    
    gcc/m2/ChangeLog:
    
            PR modula2/109125
            * gm2-libs-ch/dtoa.cc (dtoa_strtod): Replace int with bool.
            * gm2-libs-ch/ldtoa.cc (ldtoa_strtold): Replace int with bool.
    
    libgm2/ChangeLog:
    
            PR modula2/109125
            * libm2pim/dtoa.cc (TRUE): Remove.
            (FALSE): Remove.  Replace int with bool.
            * libm2pim/ldtoa.cc (TRUE): Remove.
            (FALSE): Remove.  Replace int with bool.
    
    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

Diff:
---
 gcc/m2/gm2-libs-ch/dtoa.cc  |  4 ++--
 gcc/m2/gm2-libs-ch/ldtoa.cc |  4 ++--
 libgm2/libm2pim/dtoa.cc     | 13 +++----------
 libgm2/libm2pim/ldtoa.cc    | 13 +++----------
 4 files changed, 10 insertions(+), 24 deletions(-)

diff --git a/gcc/m2/gm2-libs-ch/dtoa.cc b/gcc/m2/gm2-libs-ch/dtoa.cc
index 2aa774dff21..19663238bfb 100644
--- a/gcc/m2/gm2-libs-ch/dtoa.cc
+++ b/gcc/m2/gm2-libs-ch/dtoa.cc
@@ -48,7 +48,7 @@ typedef enum Mode { maxsignicant, decimaldigits } Mode;
    (ndigits may be negative).  */
 
 double
-dtoa_strtod (const char *s, int *error)
+dtoa_strtod (const char *s, bool *error)
 {
   char *endp;
   double d;
@@ -58,7 +58,7 @@ dtoa_strtod (const char *s, int *error)
   if (endp != NULL && (*endp == '\0'))
     *error = (errno != 0);
   else
-    *error = TRUE;
+    *error = true;
   return d;
 }
 
diff --git a/gcc/m2/gm2-libs-ch/ldtoa.cc b/gcc/m2/gm2-libs-ch/ldtoa.cc
index b1df51b4fff..9d01fa1cc01 100644
--- a/gcc/m2/gm2-libs-ch/ldtoa.cc
+++ b/gcc/m2/gm2-libs-ch/ldtoa.cc
@@ -52,7 +52,7 @@ extern int dtoa_calcsign (char *p, int str_size);
    (ndigits may be negative).  */
 
 long double
-ldtoa_strtold (const char *s, int *error)
+ldtoa_strtold (const char *s, bool *error)
 {
   char *endp;
   long double d;
@@ -67,7 +67,7 @@ ldtoa_strtold (const char *s, int *error)
   if (endp != NULL && (*endp == '\0'))
     *error = (errno != 0);
   else
-    *error = TRUE;
+    *error = true;
   return d;
 }
 
diff --git a/libgm2/libm2pim/dtoa.cc b/libgm2/libm2pim/dtoa.cc
index 18bb079a79c..509027d778d 100644
--- a/libgm2/libm2pim/dtoa.cc
+++ b/libgm2/libm2pim/dtoa.cc
@@ -75,13 +75,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define NULL (void *)0
 #endif
 
-#if !defined(TRUE)
-#define TRUE (1 == 1)
-#endif
-#if !defined(FALSE)
-#define FALSE (1 == 0)
-#endif
-
 #if defined(HAVE_STDLIB_H)
 #if !defined(_ISOC99_SOURCE)
 #define _ISOC99_SOURCE
@@ -110,7 +103,7 @@ typedef enum Mode { maxsignicant, decimaldigits } Mode;
    contain ndigits past the decimal point (ndigits may be negative).  */
 
 extern "C" double
-EXPORT(strtod) (const char *s, int *error)
+EXPORT(strtod) (const char *s, bool *error)
 {
   char *endp;
   double d;
@@ -123,10 +116,10 @@ EXPORT(strtod) (const char *s, int *error)
 #if defined(HAVE_ERRNO_H)
     *error = (errno != 0);
 #else
-    *error = FALSE;
+    *error = false;
 #endif
   else
-    *error = TRUE;
+    *error = true;
   return d;
 }
 
diff --git a/libgm2/libm2pim/ldtoa.cc b/libgm2/libm2pim/ldtoa.cc
index d1d37f8f99b..50a65e47aa3 100644
--- a/libgm2/libm2pim/ldtoa.cc
+++ b/libgm2/libm2pim/ldtoa.cc
@@ -91,13 +91,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define NULL (void *)0
 #endif
 
-#if !defined(TRUE)
-#define TRUE (1 == 1)
-#endif
-#if !defined(FALSE)
-#define FALSE (1 == 0)
-#endif
-
 #define MAX_FP_DIGITS 500
 
 typedef enum Mode { maxsignicant, decimaldigits } Mode;
@@ -113,7 +106,7 @@ extern "C" int IMPORT(dtoa,calcsign) (char *p, int str_size);
    contain ndigits past the decimal point (ndigits may be negative).  */
 
 extern "C" long double
-EXPORT(strtold) (const char *s, int *error)
+EXPORT(strtold) (const char *s, bool *error)
 {
   char *endp;
   long double d;
@@ -131,10 +124,10 @@ EXPORT(strtold) (const char *s, int *error)
 #if defined(HAVE_ERRNO_H)
     *error = (errno != 0);
 #else
-    *error = FALSE;
+    *error = false;
 #endif
   else
-    *error = TRUE;
+    *error = true;
   return d;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-15 21:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 21:31 [gcc r13-6700] PR 109125 13 regression SIGBUS in m2pim_ldtoa_ldtoa Gaius Mulley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).