1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 2001-2011, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 -- This package is for switch processing and should not depend on higher level
27 -- packages such as those for the scanner, parser, etc. Doing so may cause
28 -- circularities, especially for back ends using Adabkend.
30 with Debug; use Debug;
32 with Osint; use Osint;
34 with Validsw; use Validsw;
35 with Stylesw; use Stylesw;
36 with Warnsw; use Warnsw;
38 with Ada.Unchecked_Deallocation;
39 with System.WCh_Con; use System.WCh_Con;
41 package body Switch.C is
43 RTS_Specified : String_Access := null;
44 -- Used to detect multiple use of --RTS= flag
46 procedure Add_Symbol_Definition (Def : String);
47 -- Add a symbol definition from the command line
50 new Ada.Unchecked_Deallocation (String_List, String_List_Access);
51 -- Avoid using System.Strings.Free, which also frees the designated strings
53 function Switch_Subsequently_Cancelled
56 Arg_Rank : Positive) return Boolean;
57 -- This function is called from Scan_Front_End_Switches. It determines if
58 -- the switch currently being scanned is followed by a switch of the form
59 -- "-gnat-" & C, where C is the argument. If so, then True is returned,
60 -- and Scan_Front_End_Switches will cancel the effect of the switch. If
61 -- no such switch is found, False is returned.
63 ---------------------------
64 -- Add_Symbol_Definition --
65 ---------------------------
67 procedure Add_Symbol_Definition (Def : String) is
69 -- If Preprocessor_Symbol_Defs is not large enough, double its size
71 if Preprocessing_Symbol_Last = Preprocessing_Symbol_Defs'Last then
73 New_Symbol_Definitions : constant String_List_Access :=
74 new String_List (1 .. 2 * Preprocessing_Symbol_Last);
77 New_Symbol_Definitions (Preprocessing_Symbol_Defs'Range) :=
78 Preprocessing_Symbol_Defs.all;
79 Free (Preprocessing_Symbol_Defs);
80 Preprocessing_Symbol_Defs := New_Symbol_Definitions;
84 Preprocessing_Symbol_Last := Preprocessing_Symbol_Last + 1;
85 Preprocessing_Symbol_Defs (Preprocessing_Symbol_Last) :=
87 end Add_Symbol_Definition;
89 -----------------------------
90 -- Scan_Front_End_Switches --
91 -----------------------------
93 procedure Scan_Front_End_Switches
94 (Switch_Chars : String;
98 First_Switch : Boolean := True;
99 -- False for all but first switch
101 Max : constant Natural := Switch_Chars'Last;
103 C : Character := ' ';
106 Store_Switch : Boolean;
107 -- For -gnatxx switches, the normal processing, signalled by this flag
108 -- being set to True, is to store the switch on exit from the case
109 -- statement, the switch stored is -gnat followed by the characters
110 -- from First_Char to Ptr-1. For cases like -gnaty, where the switch
111 -- is stored in separate pieces, this flag is set to False, and the
112 -- appropriate calls to Store_Compilation_Switch are made from within
115 First_Char : Positive;
116 -- Marks start of switch to be stored
119 Ptr := Switch_Chars'First;
121 -- Skip past the initial character (must be the switch character)
129 -- Handle switches that do not start with -gnat
132 or else Switch_Chars (Ptr .. Ptr + 3) /= "gnat"
134 -- There are two front-end switches that do not start with -gnat:
137 if Switch_Chars (Ptr) = 'I' then
139 -- Set flag Search_Directory_Present if switch is "-I" only:
140 -- the directory will be the next argument.
143 Search_Directory_Present := True;
149 -- Find out whether this is a -I- or regular -Ixxx switch
151 -- Note: -I switches are not recorded in the ALI file, since the
152 -- meaning of the program depends on the source files compiled,
153 -- not where they came from.
155 if Ptr = Max and then Switch_Chars (Ptr) = '-' then
156 Look_In_Primary_Dir := False;
158 Add_Src_Search_Dir (Switch_Chars (Ptr .. Max));
161 -- Processing of the --RTS switch. --RTS may have been modified by
162 -- gcc into -fRTS (for GCC targets).
165 and then (Switch_Chars (Ptr .. Ptr + 3) = "fRTS"
167 Switch_Chars (Ptr .. Ptr + 3) = "-RTS")
172 or else Switch_Chars (Ptr + 3) /= '='
174 Osint.Fail ("missing path for --RTS");
176 -- Check that this is the first time --RTS is specified or if
177 -- it is not the first time, the same path has been specified.
179 if RTS_Specified = null then
180 RTS_Specified := new String'(Switch_Chars (Ptr + 4 .. Max));
183 RTS_Specified.all /= Switch_Chars (Ptr + 4 .. Max)
185 Osint.Fail ("--RTS cannot be specified multiple times");
188 -- Valid --RTS switch
190 Opt.No_Stdinc := True;
191 Opt.RTS_Switch := True;
195 (Switch_Chars (Ptr + 4 .. Max), Include);
199 (Switch_Chars (Ptr + 4 .. Max), Objects);
201 if RTS_Src_Path_Name /= null
202 and then RTS_Lib_Path_Name /= null
204 -- Store the -fRTS switch (Note: Store_Compilation_Switch
205 -- changes -fRTS back into --RTS for the actual output).
207 Store_Compilation_Switch (Switch_Chars);
209 elsif RTS_Src_Path_Name = null
210 and then RTS_Lib_Path_Name = null
212 Osint.Fail ("RTS path not valid: missing " &
213 "adainclude and adalib directories");
215 elsif RTS_Src_Path_Name = null then
216 Osint.Fail ("RTS path not valid: missing " &
217 "adainclude directory");
219 elsif RTS_Lib_Path_Name = null then
220 Osint.Fail ("RTS path not valid: missing " &
225 -- There are no other switches not starting with -gnat
228 Bad_Switch (Switch_Chars);
231 -- Case of switch starting with -gnat
236 -- Loop to scan through switches given in switch string
238 while Ptr <= Max loop
240 Store_Switch := True;
242 C := Switch_Chars (Ptr);
248 Assertions_Enabled := True;
249 Debug_Pragmas_Enabled := True;
251 -- Processing for A switch
255 Config_File := False;
257 -- Processing for b switch
261 Brief_Output := True;
263 -- Processing for B switch
267 Assume_No_Invalid_Values := True;
269 -- Processing for c switch
272 if not First_Switch then
274 ("-gnatc must be first if combined with other switches");
278 Operating_Mode := Check_Semantics;
280 -- Processing for C switch
285 if not CodePeer_Mode then
286 CodePeer_Mode := True;
288 -- Suppress compiler warnings by default, since what we are
289 -- interested in here is what CodePeer can find out. Note
290 -- that if -gnatwxxx is specified after -gnatC on the
291 -- command line, we do not want to override this setting in
292 -- Adjust_Global_Switches, and assume that the user wants to
293 -- get both warnings from GNAT and CodePeer messages.
295 Warning_Mode := Suppress;
298 -- Processing for d switch
301 Store_Switch := False;
304 -- Note: for the debug switch, the remaining characters in this
305 -- switch field must all be debug flags, since all valid switch
306 -- characters are also valid debug characters.
308 -- Loop to scan out debug flags
312 C := Switch_Chars (Ptr);
313 exit when C = ASCII.NUL or else C = '/' or else C = '-';
315 if C in '1' .. '9' or else
316 C in 'a' .. 'z' or else
320 Set_Dotted_Debug_Flag (C);
321 Store_Compilation_Switch ("-gnatd." & C);
324 Store_Compilation_Switch ("-gnatd" & C);
331 Bad_Switch ("-gnatd." & Switch_Chars (Ptr .. Max));
333 Bad_Switch ("-gnatd" & Switch_Chars (Ptr .. Max));
339 -- Processing for D switch
344 -- Scan optional integer line limit value
346 if Nat_Present (Switch_Chars, Max, Ptr) then
347 Scan_Nat (Switch_Chars, Max, Ptr, Sprint_Line_Limit, 'D');
348 Sprint_Line_Limit := Nat'Max (Sprint_Line_Limit, 40);
351 -- Note: -gnatD also sets -gnatx (to turn off cross-reference
352 -- generation in the ali file) since otherwise this generation
353 -- gets confused by the "wrong" Sloc values put in the tree.
355 Debug_Generated_Code := True;
356 Xref_Active := False;
357 Set_Debug_Flag ('g');
359 -- -gnate? (extended switches)
364 -- The -gnate? switches are all double character switches
365 -- so we must always have a character after the e.
368 Bad_Switch ("-gnate");
371 case Switch_Chars (Ptr) is
373 -- -gnatea (initial delimiter of explicit switches)
375 -- All switches that come before -gnatea have been added by
376 -- the GCC driver and are not stored in the ALI file.
377 -- See also -gnatez below.
380 Store_Switch := False;
381 Enable_Switch_Storing;
384 -- -gnatec (configuration pragmas)
387 Store_Switch := False;
390 -- There may be an equal sign between -gnatec and
391 -- the path name of the config file.
393 if Ptr <= Max and then Switch_Chars (Ptr) = '=' then
398 Bad_Switch ("-gnatec");
402 Config_File_Name : constant String_Access :=
404 (Switch_Chars (Ptr .. Max));
407 if Config_File_Names = null then
409 new String_List'(1 => Config_File_Name);
413 New_Names : constant String_List_Access :=
416 Config_File_Names'Length + 1);
419 for Index in Config_File_Names'Range loop
421 Config_File_Names (Index);
422 Config_File_Names (Index) := null;
425 New_Names (New_Names'Last) := Config_File_Name;
426 Free (Config_File_Names);
427 Config_File_Names := New_Names;
434 -- -gnateC switch (CodePeer SCIL generation)
436 -- Not enabled for now, keep it for later???
437 -- use -gnatd.I only for now
441 -- Generate_SCIL := True;
443 -- -gnateD switch (preprocessing symbol definition)
446 Store_Switch := False;
450 Bad_Switch ("-gnateD");
453 Add_Symbol_Definition (Switch_Chars (Ptr .. Max));
457 Store_Compilation_Switch
458 ("-gnateD" & Switch_Chars (Ptr .. Max));
461 -- -gnateE (extra exception information)
464 Exception_Extra_Info := True;
467 -- -gnatef (full source path for brief error messages)
470 Store_Switch := False;
472 Full_Path_Name_For_Brief_Errors := True;
474 -- -gnateG (save preprocessor output)
477 Generate_Processed_File := True;
480 -- -gnateI (index of unit in multi-unit source)
484 Scan_Pos (Switch_Chars, Max, Ptr, Multiple_Unit_Index, C);
486 -- -gnatem (mapping file)
489 Store_Switch := False;
492 -- There may be an equal sign between -gnatem and
493 -- the path name of the mapping file.
495 if Ptr <= Max and then Switch_Chars (Ptr) = '=' then
500 Bad_Switch ("-gnatem");
504 new String'(Switch_Chars (Ptr .. Max));
507 -- -gnatep (preprocessing data file)
510 Store_Switch := False;
513 -- There may be an equal sign between -gnatep and
514 -- the path name of the mapping file.
516 if Ptr <= Max and then Switch_Chars (Ptr) = '=' then
521 Bad_Switch ("-gnatep");
524 Preprocessing_Data_File :=
525 new String'(Switch_Chars (Ptr .. Max));
527 -- Store the switch, normalizing to -gnatep=
529 Store_Compilation_Switch
530 ("-gnatep=" & Preprocessing_Data_File.all);
534 -- -gnateP (Treat pragma Pure/Preelaborate errs as warnings)
537 Treat_Categorization_Errors_As_Warnings := True;
539 -- -gnatez (final delimiter of explicit switches)
541 -- All switches that come after -gnatez have been added by
542 -- the GCC driver and are not stored in the ALI file. See
543 -- also -gnatea above.
546 Store_Switch := False;
547 Disable_Switch_Storing;
550 -- -gnateS (generate SCO information)
552 -- Include Source Coverage Obligation information in ALI
553 -- files for the benefit of source coverage analysis tools
557 Generate_SCO := True;
560 -- All other -gnate? switches are unassigned
563 Bad_Switch ("-gnate" & Switch_Chars (Ptr .. Max));
566 -- -gnatE (dynamic elaboration checks)
570 Dynamic_Elaboration_Checks := True;
572 -- -gnatf (full error messages)
576 All_Errors_Mode := True;
578 -- Processing for F switch
582 External_Name_Exp_Casing := Uppercase;
583 External_Name_Imp_Casing := Uppercase;
585 -- Processing for g switch
590 Identifier_Character_Set := 'n';
591 System_Extend_Unit := Empty;
592 Warning_Mode := Treat_As_Error;
594 -- Set Ada 2012 mode explicitly. We don't want to rely on the
595 -- implicit setting here, since for example, we want
596 -- Preelaborate_05 treated as Preelaborate
598 Ada_Version := Ada_2012;
599 Ada_Version_Explicit := Ada_Version;
601 -- Set default warnings and style checks for -gnatg
603 Set_GNAT_Mode_Warnings;
604 Set_GNAT_Style_Check_Options;
606 -- Processing for G switch
610 Print_Generated_Code := True;
612 -- Scan optional integer line limit value
614 if Nat_Present (Switch_Chars, Max, Ptr) then
615 Scan_Nat (Switch_Chars, Max, Ptr, Sprint_Line_Limit, 'G');
616 Sprint_Line_Limit := Nat'Max (Sprint_Line_Limit, 40);
619 -- Processing for h switch
623 Usage_Requested := True;
625 -- Processing for H switch
631 -- Processing for i switch
635 Bad_Switch ("-gnati");
639 C := Switch_Chars (Ptr);
649 Identifier_Character_Set := C;
653 Bad_Switch ("-gnati" & Switch_Chars (Ptr .. Max));
656 -- Processing for I switch
660 Ignore_Rep_Clauses := True;
662 -- Processing for j switch
666 Scan_Nat (Switch_Chars, Max, Ptr, Error_Msg_Line_Length, C);
668 -- Processing for k switch
673 (Switch_Chars, Max, Ptr, Maximum_File_Name_Length, C);
675 -- Processing for l switch
681 -- There may be an equal sign between -gnatl and a file name
683 if Ptr <= Max and then Switch_Chars (Ptr) = '=' then
685 Osint.Fail ("file name for -gnatl= is null");
687 Opt.Full_List_File_Name :=
688 new String'(Switch_Chars (Ptr + 1 .. Max));
693 -- Processing for L switch
697 Dump_Source_Text := True;
699 -- Processing for m switch
703 Scan_Nat (Switch_Chars, Max, Ptr, Maximum_Messages, C);
705 -- Processing for n switch
709 Inline_Active := True;
711 -- Processing for N switch
715 Inline_Active := True;
716 Front_End_Inlining := True;
718 -- Processing for o switch
722 Suppress_Options (Overflow_Check) := False;
723 Opt.Enable_Overflow_Checks := True;
725 -- Processing for O switch
728 Store_Switch := False;
730 Output_File_Name_Present := True;
732 -- Processing for p switch
737 -- Skip processing if cancelled by subsequent -gnat-p
739 if Switch_Subsequently_Cancelled ("p", Args, Arg_Rank) then
740 Store_Switch := False;
743 -- Set all specific options as well as All_Checks in the
744 -- Suppress_Options array, excluding Elaboration_Check,
745 -- since this is treated specially because we do not want
746 -- -gnatp to disable static elaboration processing.
748 for J in Suppress_Options'Range loop
749 if J /= Elaboration_Check then
750 Suppress_Options (J) := True;
754 Validity_Checks_On := False;
755 Opt.Suppress_Checks := True;
756 Opt.Enable_Overflow_Checks := False;
759 -- Processing for P switch
763 Polling_Required := True;
765 -- Processing for q switch
769 Try_Semantics := True;
771 -- Processing for Q switch
775 Force_ALI_Tree_File := True;
776 Try_Semantics := True;
778 -- Processing for r switch
782 Treat_Restrictions_As_Warnings := True;
784 -- Processing for R switch
787 Back_Annotate_Rep_Info := True;
788 List_Representation_Info := 1;
791 while Ptr <= Max loop
792 C := Switch_Chars (Ptr);
794 if C in '1' .. '3' then
795 List_Representation_Info :=
796 Character'Pos (C) - Character'Pos ('0');
798 elsif Switch_Chars (Ptr) = 's' then
799 List_Representation_Info_To_File := True;
801 elsif Switch_Chars (Ptr) = 'm' then
802 List_Representation_Info_Mechanisms := True;
805 Bad_Switch ("-gnatR" & Switch_Chars (Ptr .. Max));
811 -- Processing for s switch
814 if not First_Switch then
816 ("-gnats must be first if combined with other switches");
820 Operating_Mode := Check_Syntax;
822 -- Processing for S switch
825 Print_Standard := True;
828 -- Processing for t switch
833 Back_Annotate_Rep_Info := True;
835 -- Processing for T switch
839 Scan_Pos (Switch_Chars, Max, Ptr, Table_Factor, C);
841 -- Processing for u switch
847 -- Processing for U switch
851 Unique_Error_Tag := True;
853 -- Processing for v switch
857 Verbose_Mode := True;
859 -- Processing for V switch
862 Store_Switch := False;
866 Bad_Switch ("-gnatV");
873 Set_Validity_Check_Options
874 (Switch_Chars (Ptr .. Max), OK, Ptr);
877 Bad_Switch ("-gnatV" & Switch_Chars (Ptr .. Max));
880 for Index in First_Char + 1 .. Max loop
881 Store_Compilation_Switch
882 ("-gnatV" & Switch_Chars (Index));
889 -- Processing for w switch
892 Store_Switch := False;
896 Bad_Switch ("-gnatw");
899 while Ptr <= Max loop
900 C := Switch_Chars (Ptr);
902 -- Case of dot switch
904 if C = '.' and then Ptr < Max then
906 C := Switch_Chars (Ptr);
908 if Set_Dot_Warning_Switch (C) then
909 Store_Compilation_Switch ("-gnatw." & C);
911 Bad_Switch ("-gnatw." & Switch_Chars (Ptr .. Max));
914 -- Normal case, no dot
917 if Set_Warning_Switch (C) then
918 Store_Compilation_Switch ("-gnatw" & C);
920 Bad_Switch ("-gnatw" & Switch_Chars (Ptr .. Max));
929 -- Processing for W switch
935 Bad_Switch ("-gnatW");
939 Wide_Character_Encoding_Method :=
940 Get_WC_Encoding_Method (Switch_Chars (Ptr));
942 when Constraint_Error =>
943 Bad_Switch ("-gnatW" & Switch_Chars (Ptr .. Max));
946 Wide_Character_Encoding_Method_Specified := True;
948 Upper_Half_Encoding :=
949 Wide_Character_Encoding_Method in
950 WC_Upper_Half_Encoding_Method;
954 -- Processing for x switch
958 Xref_Active := False;
960 -- Processing for X switch
964 Extensions_Allowed := True;
965 Ada_Version := Ada_Version_Type'Last;
966 Ada_Version_Explicit := Ada_Version_Type'Last;
968 -- Processing for y switch
974 Set_Default_Style_Check_Options;
977 Store_Switch := False;
983 Set_Style_Check_Options
984 (Switch_Chars (Ptr .. Max), OK, Ptr);
988 ("bad -gnaty switch (" &
989 Style_Msg_Buf (1 .. Style_Msg_Len) & ')');
992 Ptr := First_Char + 1;
993 while Ptr <= Max loop
994 if Switch_Chars (Ptr) = 'M' then
999 or else Switch_Chars (Ptr) not in '0' .. '9';
1002 Store_Compilation_Switch
1003 ("-gnaty" & Switch_Chars (First_Char .. Ptr - 1));
1006 Store_Compilation_Switch
1007 ("-gnaty" & Switch_Chars (Ptr));
1014 -- Processing for z switch
1018 -- -gnatz must be the first and only switch in Switch_Chars,
1019 -- and is a two-letter switch.
1021 if Ptr /= Switch_Chars'First + 5
1022 or else (Max - Ptr + 1) > 2
1025 ("-gnatz* may not be combined with other switches");
1029 Bad_Switch ("-gnatz");
1034 -- Only one occurrence of -gnat* is permitted
1036 if Distribution_Stub_Mode = No_Stubs then
1037 case Switch_Chars (Ptr) is
1039 Distribution_Stub_Mode := Generate_Receiver_Stub_Body;
1042 Distribution_Stub_Mode := Generate_Caller_Stub_Body;
1045 Bad_Switch ("-gnatz" & Switch_Chars (Ptr .. Max));
1051 Osint.Fail ("only one -gnatz* switch allowed");
1054 -- Processing for Z switch
1059 ("-gnatZ is no longer supported: consider using --RTS=zcx");
1061 -- Note on language version switches: whenever a new language
1062 -- version switch is added, function Switch.Is_Language_Switch and
1063 -- procedure Switch.M.Normalize_Compiler_Switches must be updated.
1065 -- Processing for 83 switch
1069 Bad_Switch ("-gnat8");
1074 if Switch_Chars (Ptr) /= '3' then
1075 Bad_Switch ("-gnat8" & Switch_Chars (Ptr .. Max));
1078 Ada_Version := Ada_83;
1079 Ada_Version_Explicit := Ada_Version;
1082 -- Processing for 95 switch
1086 Bad_Switch ("-gnat9");
1091 if Switch_Chars (Ptr) /= '5' then
1092 Bad_Switch ("-gnat9" & Switch_Chars (Ptr .. Max));
1095 Ada_Version := Ada_95;
1096 Ada_Version_Explicit := Ada_Version;
1099 -- Processing for 05 switch
1103 Bad_Switch ("-gnat0");
1108 if Switch_Chars (Ptr) /= '5' then
1109 Bad_Switch ("-gnat0" & Switch_Chars (Ptr .. Max));
1112 Ada_Version := Ada_2005;
1113 Ada_Version_Explicit := Ada_Version;
1116 -- Processing for 12 switch
1120 Bad_Switch ("-gnat1");
1125 if Switch_Chars (Ptr) /= '2' then
1126 Bad_Switch ("-gnat1" & Switch_Chars (Ptr .. Max));
1129 Ada_Version := Ada_2012;
1130 Ada_Version_Explicit := Ada_Version;
1133 -- Processing for 2005 and 2012 switches
1136 if Ptr > Max - 3 then
1137 Bad_Switch ("-gnat" & Switch_Chars (Ptr .. Max));
1139 elsif Switch_Chars (Ptr .. Ptr + 3) = "2005" then
1140 Ada_Version := Ada_2005;
1142 elsif Switch_Chars (Ptr .. Ptr + 3) = "2012" then
1143 Ada_Version := Ada_2012;
1146 Bad_Switch ("-gnat" & Switch_Chars (Ptr .. Ptr + 3));
1149 Ada_Version_Explicit := Ada_Version;
1152 -- Switch cancellation, currently only -gnat-p is allowed.
1153 -- All we do here is the error checking, since the actual
1154 -- processing for switch cancellation is done by calls to
1155 -- Switch_Subsequently_Cancelled at the appropriate point.
1159 -- Simple ignore -gnat-p
1161 if Switch_Chars = "-gnat-p" then
1164 -- Any other occurrence of minus is ignored. This is for
1165 -- maximum compatibility with previous version which ignored
1166 -- all occurrences of minus.
1169 Store_Switch := False;
1173 -- We ignore '/' in switches, this is historical, still needed???
1176 Store_Switch := False;
1178 -- Anything else is an error (illegal switch character)
1181 Bad_Switch ("-gnat" & Switch_Chars (Ptr .. Max));
1184 if Store_Switch then
1185 Store_Compilation_Switch
1186 ("-gnat" & Switch_Chars (First_Char .. Ptr - 1));
1189 First_Switch := False;
1192 end Scan_Front_End_Switches;
1194 -----------------------------------
1195 -- Switch_Subsequently_Cancelled --
1196 -----------------------------------
1198 function Switch_Subsequently_Cancelled
1201 Arg_Rank : Positive) return Boolean
1204 -- Loop through arguments following the current one
1206 for Arg in Arg_Rank + 1 .. Args'Last loop
1207 if Args (Arg).all = "-gnat-" & C then
1212 -- No match found, not cancelled
1215 end Switch_Subsequently_Cancelled;