diff options
author | Ronan Desplanques <desplanques@adacore.com> | 2022-12-09 11:29:02 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-01-03 10:29:54 +0100 |
commit | 54d7221aca4b4aa2e20534924215cc39ebe2cd73 (patch) | |
tree | 9c94eb49a074a2c30fce7c28193daad8758e9ce8 | |
parent | 7bad99da3d2a1511407136863918dabc009a7bbf (diff) | |
download | gcc-54d7221aca4b4aa2e20534924215cc39ebe2cd73.zip gcc-54d7221aca4b4aa2e20534924215cc39ebe2cd73.tar.gz gcc-54d7221aca4b4aa2e20534924215cc39ebe2cd73.tar.bz2 |
ada: Fix GNAT.Formatted_String's handling of real values
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.
-rw-r--r-- | gcc/ada/libgnat/g-forstr.adb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ada/libgnat/g-forstr.adb b/gcc/ada/libgnat/g-forstr.adb index c9fb86b..2179818 100644 --- a/gcc/ada/libgnat/g-forstr.adb +++ b/gcc/ada/libgnat/g-forstr.adb @@ -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; |