]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix GNAT.Formatted_String's handling of real values
authorRonan Desplanques <desplanques@adacore.com>
Fri, 9 Dec 2022 10:29:02 +0000 (11:29 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 3 Jan 2023 09:29:54 +0000 (10:29 +0100)
Before this patch, passing a width and a precision through
arguments with the "*" syntax always failed for real values in
GNAT.Formatted_String's routines.

gcc/ada/

* libgnat/g-forstr.adb (P_Flt_Format): Add "*" syntax handling.

gcc/ada/libgnat/g-forstr.adb

index c9fb86b44f77fa6f6b8a55bc4f99fbd0e4f93109..2179818bba4cbb7166f7c21b53fbb97a8686ec9a 100644 (file)
@@ -686,9 +686,10 @@ package body GNAT.Formatted_String is
    begin
       Next_Format (Format, F, Start);
 
-      if F.Value_Needed > 0 then
+      if F.Value_Needed /= Format.D.Stored_Value then
          Raise_Wrong_Format (Format);
       end if;
+      Format.D.Stored_Value := 0;
 
       if F.Precision = Unset then
          Aft := 6;