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-1622] [Ada] Fix handling of gnat check/test commands Date: Fri, 18 Jun 2021 08:38:35 +0000 (GMT) [thread overview] Message-ID: <20210618083835.4226C39B441E@sourceware.org> (raw) https://gcc.gnu.org/g:cd344e9570398b7436a4ed854618d5c186b20c02 commit r12-1622-gcd344e9570398b7436a4ed854618d5c186b20c02 Author: Arnaud Charlet <charlet@adacore.com> Date: Wed Mar 17 03:59:23 2021 -0400 [Ada] Fix handling of gnat check/test commands gcc/ada/ * gnatcmd.adb: Fix handling of check and test commands. Diff: --- gcc/ada/gnatcmd.adb | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb index daa24824afd..94da878ad85 100644 --- a/gcc/ada/gnatcmd.adb +++ b/gcc/ada/gnatcmd.adb @@ -472,6 +472,15 @@ begin Program := new String'(Command_List (The_Command).Unixcmd.all); + elsif The_Command in Check | Test then + Program := new String'(Command_List (The_Command).Unixcmd.all); + Find_Program_Name; + + if Name_Len > 5 then + First_Switches.Append + (new String' + ("--target=" & Name_Buffer (1 .. Name_Len - 5))); + end if; else Program := Program_Name (Command_List (The_Command).Unixcmd.all, "gnat"); @@ -481,13 +490,7 @@ begin -- instead of gnatmake/gnatclean. -- Ditto for gnatname -> gprname and gnatls -> gprls. - if The_Command = Make - or else The_Command = Compile - or else The_Command = Bind - or else The_Command = Link - or else The_Command = Clean - or else The_Command = Name - or else The_Command = List + if The_Command in Make | Compile | Bind | Link | Clean | Name | List then declare Switch : String_Access; @@ -588,23 +591,23 @@ begin end if; -- For FIND and XREF, look for switch -P. If it is specified, then - -- report an error indicating that the command is no longer supporting - -- project files. + -- report an error indicating that the command does not support project + -- files. - if The_Command = Find or else The_Command = Xref then + if The_Command in Find | Xref then declare Argv : String_Access; begin for Arg_Num in 1 .. Last_Switches.Last loop Argv := Last_Switches.Table (Arg_Num); - if Argv'Length >= 2 and then - Argv (Argv'First .. Argv'First + 1) = "-P" + if Argv'Length >= 2 + and then Argv (Argv'First .. Argv'First + 1) = "-P" then if The_Command = Find then - Fail ("'gnat find -P' is no longer supported;"); + Fail ("'gnat find -P' is not supported;"); else - Fail ("'gnat xref -P' is no longer supported;"); + Fail ("'gnat xref -P' is not supported;"); end if; end if; end loop;
reply other threads:[~2021-06-18 8:38 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=20210618083835.4226C39B441E@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).