diff options
author | Ronan Desplanques <desplanques@adacore.com> | 2022-12-07 17:37:21 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-01-03 10:29:53 +0100 |
commit | d3f50f75aa3e5054b28074c029d36c1cbce2d0cb (patch) | |
tree | b6e65bbf1239805f5f77bb9b8a5393423ef2ecee /gcc/expr.cc | |
parent | 32841e7e8480cb16d34f60feda226e4f582c3186 (diff) | |
download | gcc-d3f50f75aa3e5054b28074c029d36c1cbce2d0cb.zip gcc-d3f50f75aa3e5054b28074c029d36c1cbce2d0cb.tar.gz gcc-d3f50f75aa3e5054b28074c029d36c1cbce2d0cb.tar.bz2 |
ada: Fix format string parsing in GNAT.Formatted_String
Before this patch, format strings ending with "%%" (two consecutive
percent signs) caused GNAT.Formatted_String."-" to give the wrong
output, and cause the various GNAT.Formatted_String."&" to raise
exceptions with misleading error messages.
Also before this patch, a bug in GNAT.Formatted_String."-" caused
characters from the format string to be dropped. Calling
GNAT.Formatted_String."-" on an instance of
GNAT.Formatted_String.Formatted_String caused subsequent uses of
that instance to return wrong results.
In addition to fixing the parsing of format strings, this patch
centralizes the detection of format specifiers in a unique
procedure.
gcc/ada/
* libgnat/g-forstr.adb
(Advance_And_Accumulate_Until_Next_Specifier): New procedure.
("-"): Replace inline code with call to
Advance_And_Accumulate_Until_Next_Specifier.
(Next_Format): likewise.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions