https://gcc.gnu.org/g:9ea2c78197cf16390b924c07acc402cb0954237f

commit r15-6154-g9ea2c78197cf16390b924c07acc402cb0954237f
Author: Ronan Desplanques <desplanq...@adacore.com>
Date:   Thu Nov 21 14:26:32 2024 +0100

    ada: Fix minor display issue on invalid floats
    
    GNAT implements a format with trailing '*' signs for the Image attribute
    of NaN, +inf and -inf. It was probably always intended to be the same
    length as the image of 1.0, but one '*' was actually missing. This patch
    fixes this.
    
    gcc/ada/ChangeLog:
    
            * libgnat/s-imager.adb (Image_Floating_Point): Tweak display of
            invalid floating point values.

Diff:
---
 gcc/ada/libgnat/s-imager.adb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/libgnat/s-imager.adb b/gcc/ada/libgnat/s-imager.adb
index c598cc94e152..d19fda3b613d 100644
--- a/gcc/ada/libgnat/s-imager.adb
+++ b/gcc/ada/libgnat/s-imager.adb
@@ -109,6 +109,7 @@ package body System.Image_R is
    is
       pragma Assert (S'First = 1);
 
+      Fore : Natural;
    begin
       --  Decide whether a blank should be prepended before the call to
       --  Set_Image_Real. We generate a blank for positive values, and
@@ -125,11 +126,13 @@ package body System.Image_R is
          --  Image_Floating_Point operation.
          S (1) := ' ';
          P := 1;
+         Fore := 1;
       else
          P := 0;
+         Fore := 2;
       end if;
 
-      Set_Image_Real (V, S, P, 1, Digs - 1, 3);
+      Set_Image_Real (V, S, P, Fore, Digs - 1, 3);
    end Image_Floating_Point;
 
    -----------------

Reply via email to