From 54d7221aca4b4aa2e20534924215cc39ebe2cd73 Mon Sep 17 00:00:00 2001 From: Ronan Desplanques Date: Fri, 9 Dec 2022 11:29:02 +0100 Subject: [PATCH] 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. --- gcc/ada/libgnat/g-forstr.adb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/ada/libgnat/g-forstr.adb b/gcc/ada/libgnat/g-forstr.adb index c9fb86b44f77..2179818bba4c 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; -- 2.47.2