From: Ronan Desplanques Date: Fri, 9 Dec 2022 10:29:02 +0000 (+0100) Subject: ada: Fix GNAT.Formatted_String's handling of real values X-Git-Tag: basepoints/gcc-14~2236 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54d7221aca4b4aa2e20534924215cc39ebe2cd73;p=thirdparty%2Fgcc.git 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. --- 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;