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 (disable atomic synchronization)
446 Suppress_Options
(Atomic_Synchronization
) := True;
448 -- -gnateD switch (preprocessing symbol definition)
451 Store_Switch
:= False;
455 Bad_Switch
("-gnateD");
458 Add_Symbol_Definition
(Switch_Chars
(Ptr
.. Max
));
462 Store_Compilation_Switch
463 ("-gnateD" & Switch_Chars
(Ptr
.. Max
));
466 -- -gnateE (extra exception information)
469 Exception_Extra_Info
:= True;
472 -- -gnatef (full source path for brief error messages)
475 Store_Switch
:= False;
477 Full_Path_Name_For_Brief_Errors
:= True;
479 -- -gnateG (save preprocessor output)
482 Generate_Processed_File
:= True;
485 -- -gnateI (index of unit in multi-unit source)
489 Scan_Pos
(Switch_Chars
, Max
, Ptr
, Multiple_Unit_Index
, C
);
491 -- -gnatem (mapping file)
494 Store_Switch
:= False;
497 -- There may be an equal sign between -gnatem and
498 -- the path name of the mapping file.
500 if Ptr
<= Max
and then Switch_Chars
(Ptr
) = '=' then
505 Bad_Switch
("-gnatem");
509 new String'(Switch_Chars (Ptr .. Max));
512 -- -gnatep (preprocessing data file)
515 Store_Switch := False;
518 -- There may be an equal sign between -gnatep and
519 -- the path name of the mapping file.
521 if Ptr <= Max and then Switch_Chars (Ptr) = '=' then
526 Bad_Switch ("-gnatep");
529 Preprocessing_Data_File :=
530 new String'(Switch_Chars
(Ptr
.. Max
));
532 -- Store the switch, normalizing to -gnatep=
534 Store_Compilation_Switch
535 ("-gnatep=" & Preprocessing_Data_File
.all);
539 -- -gnateP (Treat pragma Pure/Preelaborate errs as warnings)
542 Treat_Categorization_Errors_As_Warnings
:= True;
544 -- -gnatez (final delimiter of explicit switches)
546 -- All switches that come after -gnatez have been added by
547 -- the GCC driver and are not stored in the ALI file. See
548 -- also -gnatea above.
551 Store_Switch
:= False;
552 Disable_Switch_Storing
;
555 -- -gnateS (generate SCO information)
557 -- Include Source Coverage Obligation information in ALI
558 -- files for the benefit of source coverage analysis tools
562 Generate_SCO
:= True;
565 -- All other -gnate? switches are unassigned
568 Bad_Switch
("-gnate" & Switch_Chars
(Ptr
.. Max
));
571 -- -gnatE (dynamic elaboration checks)
575 Dynamic_Elaboration_Checks
:= True;
577 -- -gnatf (full error messages)
581 All_Errors_Mode
:= True;
583 -- Processing for F switch
587 External_Name_Exp_Casing
:= Uppercase
;
588 External_Name_Imp_Casing
:= Uppercase
;
590 -- Processing for g switch
595 Identifier_Character_Set
:= 'n';
596 System_Extend_Unit
:= Empty
;
597 Warning_Mode
:= Treat_As_Error
;
599 -- Set Ada 2012 mode explicitly. We don't want to rely on the
600 -- implicit setting here, since for example, we want
601 -- Preelaborate_05 treated as Preelaborate
603 Ada_Version
:= Ada_2012
;
604 Ada_Version_Explicit
:= Ada_Version
;
606 -- Set default warnings and style checks for -gnatg
608 Set_GNAT_Mode_Warnings
;
609 Set_GNAT_Style_Check_Options
;
611 -- Processing for G switch
615 Print_Generated_Code
:= True;
617 -- Scan optional integer line limit value
619 if Nat_Present
(Switch_Chars
, Max
, Ptr
) then
620 Scan_Nat
(Switch_Chars
, Max
, Ptr
, Sprint_Line_Limit
, 'G');
621 Sprint_Line_Limit
:= Nat
'Max (Sprint_Line_Limit
, 40);
624 -- Processing for h switch
628 Usage_Requested
:= True;
630 -- Processing for H switch
636 -- Processing for i switch
640 Bad_Switch
("-gnati");
644 C
:= Switch_Chars
(Ptr
);
654 Identifier_Character_Set
:= C
;
658 Bad_Switch
("-gnati" & Switch_Chars
(Ptr
.. Max
));
661 -- Processing for I switch
665 Ignore_Rep_Clauses
:= True;
667 -- Processing for j switch
671 Scan_Nat
(Switch_Chars
, Max
, Ptr
, Error_Msg_Line_Length
, C
);
673 -- Processing for k switch
678 (Switch_Chars
, Max
, Ptr
, Maximum_File_Name_Length
, C
);
680 -- Processing for l switch
686 -- There may be an equal sign between -gnatl and a file name
688 if Ptr
<= Max
and then Switch_Chars
(Ptr
) = '=' then
690 Osint
.Fail
("file name for -gnatl= is null");
692 Opt
.Full_List_File_Name
:=
693 new String'(Switch_Chars (Ptr + 1 .. Max));
698 -- Processing for L switch
702 Dump_Source_Text := True;
704 -- Processing for m switch
708 Scan_Nat (Switch_Chars, Max, Ptr, Maximum_Messages, C);
710 -- Processing for n switch
714 Inline_Active := True;
716 -- Processing for N switch
720 Inline_Active := True;
721 Front_End_Inlining := True;
723 -- Processing for o switch
727 Suppress_Options (Overflow_Check) := False;
728 Opt.Enable_Overflow_Checks := True;
730 -- Processing for O switch
733 Store_Switch := False;
735 Output_File_Name_Present := True;
737 -- Processing for p switch
742 -- Skip processing if cancelled by subsequent -gnat-p
744 if Switch_Subsequently_Cancelled ("p", Args, Arg_Rank) then
745 Store_Switch := False;
748 -- Set all specific options as well as All_Checks in the
749 -- Suppress_Options array, excluding Elaboration_Check,
750 -- since this is treated specially because we do not want
751 -- -gnatp to disable static elaboration processing. Also
752 -- exclude Atomic_Synchronization, since this is not a real
755 for J in Suppress_Options'Range loop
756 if J /= Elaboration_Check
757 and then J /= Atomic_Synchronization
759 Suppress_Options (J) := True;
763 Validity_Checks_On := False;
764 Opt.Suppress_Checks := True;
765 Opt.Enable_Overflow_Checks := False;
768 -- Processing for P switch
772 Polling_Required := True;
774 -- Processing for q switch
778 Try_Semantics := True;
780 -- Processing for Q switch
784 Force_ALI_Tree_File := True;
785 Try_Semantics := True;
787 -- Processing for r switch
791 Treat_Restrictions_As_Warnings := True;
793 -- Processing for R switch
796 Back_Annotate_Rep_Info := True;
797 List_Representation_Info := 1;
800 while Ptr <= Max loop
801 C := Switch_Chars (Ptr);
803 if C in '1' .. '3' then
804 List_Representation_Info :=
805 Character'Pos (C) - Character'Pos ('0');
807 elsif Switch_Chars (Ptr) = 's
' then
808 List_Representation_Info_To_File := True;
810 elsif Switch_Chars (Ptr) = 'm
' then
811 List_Representation_Info_Mechanisms := True;
814 Bad_Switch ("-gnatR" & Switch_Chars (Ptr .. Max));
820 -- Processing for s switch
823 if not First_Switch then
825 ("-gnats must be first if combined with other switches");
829 Operating_Mode := Check_Syntax;
831 -- Processing for S switch
834 Print_Standard := True;
837 -- Processing for t switch
842 Back_Annotate_Rep_Info := True;
844 -- Processing for T switch
848 Scan_Pos (Switch_Chars, Max, Ptr, Table_Factor, C);
850 -- Processing for u switch
856 -- Processing for U switch
860 Unique_Error_Tag := True;
862 -- Processing for v switch
866 Verbose_Mode := True;
868 -- Processing for V switch
871 Store_Switch := False;
875 Bad_Switch ("-gnatV");
882 Set_Validity_Check_Options
883 (Switch_Chars (Ptr .. Max), OK, Ptr);
886 Bad_Switch ("-gnatV" & Switch_Chars (Ptr .. Max));
889 for Index in First_Char + 1 .. Max loop
890 Store_Compilation_Switch
891 ("-gnatV" & Switch_Chars (Index));
898 -- Processing for w switch
901 Store_Switch := False;
905 Bad_Switch ("-gnatw");
908 while Ptr <= Max loop
909 C := Switch_Chars (Ptr);
911 -- Case of dot switch
913 if C = '.' and then Ptr < Max then
915 C := Switch_Chars (Ptr);
917 if Set_Dot_Warning_Switch (C) then
918 Store_Compilation_Switch ("-gnatw." & C);
920 Bad_Switch ("-gnatw." & Switch_Chars (Ptr .. Max));
923 -- Normal case, no dot
926 if Set_Warning_Switch (C) then
927 Store_Compilation_Switch ("-gnatw" & C);
929 Bad_Switch ("-gnatw" & Switch_Chars (Ptr .. Max));
938 -- Processing for W switch
944 Bad_Switch ("-gnatW");
948 Wide_Character_Encoding_Method :=
949 Get_WC_Encoding_Method (Switch_Chars (Ptr));
951 when Constraint_Error =>
952 Bad_Switch ("-gnatW" & Switch_Chars (Ptr .. Max));
955 Wide_Character_Encoding_Method_Specified := True;
957 Upper_Half_Encoding :=
958 Wide_Character_Encoding_Method in
959 WC_Upper_Half_Encoding_Method;
963 -- Processing for x switch
967 Xref_Active := False;
969 -- Processing for X switch
973 Extensions_Allowed := True;
974 Ada_Version := Ada_Version_Type'Last;
975 Ada_Version_Explicit := Ada_Version_Type'Last;
977 -- Processing for y switch
983 Set_Default_Style_Check_Options;
986 Store_Switch := False;
992 Set_Style_Check_Options
993 (Switch_Chars (Ptr .. Max), OK, Ptr);
997 ("bad -gnaty switch (" &
998 Style_Msg_Buf (1 .. Style_Msg_Len) & ')');
1001 Ptr := First_Char + 1;
1002 while Ptr <= Max loop
1003 if Switch_Chars (Ptr) = 'M
' then
1008 or else Switch_Chars (Ptr) not in '0' .. '9';
1011 Store_Compilation_Switch
1012 ("-gnaty" & Switch_Chars (First_Char .. Ptr - 1));
1015 Store_Compilation_Switch
1016 ("-gnaty" & Switch_Chars (Ptr));
1023 -- Processing for z switch
1027 -- -gnatz must be the first and only switch in Switch_Chars,
1028 -- and is a two-letter switch.
1030 if Ptr /= Switch_Chars'First + 5
1031 or else (Max - Ptr + 1) > 2
1034 ("-gnatz* may not be combined with other switches");
1038 Bad_Switch ("-gnatz");
1043 -- Only one occurrence of -gnat* is permitted
1045 if Distribution_Stub_Mode = No_Stubs then
1046 case Switch_Chars (Ptr) is
1048 Distribution_Stub_Mode := Generate_Receiver_Stub_Body;
1051 Distribution_Stub_Mode := Generate_Caller_Stub_Body;
1054 Bad_Switch ("-gnatz" & Switch_Chars (Ptr .. Max));
1060 Osint.Fail ("only one -gnatz* switch allowed");
1063 -- Processing for Z switch
1068 ("-gnatZ is no longer supported: consider using --RTS=zcx");
1070 -- Note on language version switches: whenever a new language
1071 -- version switch is added, Switch.M.Normalize_Compiler_Switches
1074 -- Processing for 83 switch
1078 Bad_Switch ("-gnat8");
1083 if Switch_Chars (Ptr) /= '3' then
1084 Bad_Switch ("-gnat8" & Switch_Chars (Ptr .. Max));
1087 Ada_Version := Ada_83;
1088 Ada_Version_Explicit := Ada_Version;
1091 -- Processing for 95 switch
1095 Bad_Switch ("-gnat9");
1100 if Switch_Chars (Ptr) /= '5' then
1101 Bad_Switch ("-gnat9" & Switch_Chars (Ptr .. Max));
1104 Ada_Version := Ada_95;
1105 Ada_Version_Explicit := Ada_Version;
1108 -- Processing for 05 switch
1112 Bad_Switch ("-gnat0");
1117 if Switch_Chars (Ptr) /= '5' then
1118 Bad_Switch ("-gnat0" & Switch_Chars (Ptr .. Max));
1121 Ada_Version := Ada_2005;
1122 Ada_Version_Explicit := Ada_Version;
1125 -- Processing for 12 switch
1129 Bad_Switch ("-gnat1");
1134 if Switch_Chars (Ptr) /= '2' then
1135 Bad_Switch ("-gnat1" & Switch_Chars (Ptr .. Max));
1138 Ada_Version := Ada_2012;
1139 Ada_Version_Explicit := Ada_Version;
1142 -- Processing for 2005 and 2012 switches
1145 if Ptr > Max - 3 then
1146 Bad_Switch ("-gnat" & Switch_Chars (Ptr .. Max));
1148 elsif Switch_Chars (Ptr .. Ptr + 3) = "2005" then
1149 Ada_Version := Ada_2005;
1151 elsif Switch_Chars (Ptr .. Ptr + 3) = "2012" then
1152 Ada_Version := Ada_2012;
1155 Bad_Switch ("-gnat" & Switch_Chars (Ptr .. Ptr + 3));
1158 Ada_Version_Explicit := Ada_Version;
1161 -- Switch cancellation, currently only -gnat-p is allowed.
1162 -- All we do here is the error checking, since the actual
1163 -- processing for switch cancellation is done by calls to
1164 -- Switch_Subsequently_Cancelled at the appropriate point.
1168 -- Simple ignore -gnat-p
1170 if Switch_Chars = "-gnat-p" then
1173 -- Any other occurrence of minus is ignored. This is for
1174 -- maximum compatibility with previous version which ignored
1175 -- all occurrences of minus.
1178 Store_Switch := False;
1182 -- We ignore '/' in switches, this is historical, still needed???
1185 Store_Switch := False;
1187 -- Anything else is an error (illegal switch character)
1190 Bad_Switch ("-gnat" & Switch_Chars (Ptr .. Max));
1193 if Store_Switch then
1194 Store_Compilation_Switch
1195 ("-gnat" & Switch_Chars (First_Char .. Ptr - 1));
1198 First_Switch := False;
1201 end Scan_Front_End_Switches;
1203 -----------------------------------
1204 -- Switch_Subsequently_Cancelled --
1205 -----------------------------------
1207 function Switch_Subsequently_Cancelled
1210 Arg_Rank : Positive) return Boolean
1213 -- Loop through arguments following the current one
1215 for Arg in Arg_Rank + 1 .. Args'Last loop
1216 if Args (Arg).all = "-gnat-" & C then
1221 -- No match found, not cancelled
1224 end Switch_Subsequently_Cancelled;