aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2022-01-03 16:48:01 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2022-01-11 13:24:46 +0000
commit42c54add83708c37b350c71a2979f2d7483a1656 (patch)
tree9adc7515b6b7c3da4b9683f618e4402bd9d86519
parentbf7355a7e8c8cace2c151b78ed3dc6f26ae4487f (diff)
downloadgcc-42c54add83708c37b350c71a2979f2d7483a1656.zip
gcc-42c54add83708c37b350c71a2979f2d7483a1656.tar.gz
gcc-42c54add83708c37b350c71a2979f2d7483a1656.tar.bz2
[Ada] Simplify construction of messages about configurable runtime
gcc/ada/ * errout.adb (Error_Msg_CRT): Build message with string concatenation; it is slightly repetitive but much easier to read.
-rw-r--r--gcc/ada/errout.adb17
1 files changed, 2 insertions, 15 deletions
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index b3c3856..b862637 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -827,27 +827,14 @@ package body Errout is
-------------------
procedure Error_Msg_CRT (Feature : String; N : Node_Id) is
- CNRT : constant String := " not allowed in no run time mode";
- CCRT : constant String := " not supported by configuration>";
-
- S : String (1 .. Feature'Length + 1 + CCRT'Length);
- L : Natural;
-
begin
- S (1) := '|';
- S (2 .. Feature'Length + 1) := Feature;
- L := Feature'Length + 2;
-
if No_Run_Time_Mode then
- S (L .. L + CNRT'Length - 1) := CNRT;
- L := L + CNRT'Length - 1;
+ Error_Msg_N ('|' & Feature & " not allowed in no run time mode", N);
else pragma Assert (Configurable_Run_Time_Mode);
- S (L .. L + CCRT'Length - 1) := CCRT;
- L := L + CCRT'Length - 1;
+ Error_Msg_N ('|' & Feature & " not supported by configuration>", N);
end if;
- Error_Msg_N (S (1 .. L), N);
Configurable_Run_Time_Violations := Configurable_Run_Time_Violations + 1;
end Error_Msg_CRT;