diff options
author | Pascal Obry <obry@adacore.com> | 2021-09-16 19:10:39 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-10-05 08:20:05 +0000 |
commit | f7d1d2c250e2d8d3892d620924795c10b6809337 (patch) | |
tree | a59351869fc7f798814c10589098427c30c5b702 /gcc | |
parent | 657d0d8faf8a9f5d0c221fa011cd66ae815e9a59 (diff) | |
download | gcc-f7d1d2c250e2d8d3892d620924795c10b6809337.zip gcc-f7d1d2c250e2d8d3892d620924795c10b6809337.tar.gz gcc-f7d1d2c250e2d8d3892d620924795c10b6809337.tar.bz2 |
[Ada] Issue a proper error message when no format specifier found
gcc/ada/
* libgnat/g-forstr.adb (Next_Format): When there is no more
format specifier found issue a proper error message instead of
raising a contraint error.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/libgnat/g-forstr.adb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/libgnat/g-forstr.adb b/gcc/ada/libgnat/g-forstr.adb index d659612..04539be 100644 --- a/gcc/ada/libgnat/g-forstr.adb +++ b/gcc/ada/libgnat/g-forstr.adb @@ -519,7 +519,7 @@ package body GNAT.Formatted_String is J := J + 1; end loop; - if F (J) /= '%' or else J = F'Last then + if J >= F'Last or else F (J) /= '%' then raise Format_Error with "no format specifier found for parameter" & Positive'Image (Format.D.Current); end if; |