public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6451] [Ada] Simplify construction of messages about configurable runtime Date: Tue, 11 Jan 2022 13:26:59 +0000 (GMT) [thread overview] Message-ID: <20220111132659.2B37E38A941E@sourceware.org> (raw) https://gcc.gnu.org/g:42c54add83708c37b350c71a2979f2d7483a1656 commit r12-6451-g42c54add83708c37b350c71a2979f2d7483a1656 Author: Piotr Trojanek <trojanek@adacore.com> Date: Mon Jan 3 16:48:01 2022 +0100 [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. Diff: --- gcc/ada/errout.adb | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index b3c385682f7..b8626376b0c 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;
reply other threads:[~2022-01-11 13:26 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220111132659.2B37E38A941E@sourceware.org \ --to=pmderodat@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).