OSDN Git Service

* adadecode.c, adadecode.h, aux-io.c, s-traces.adb, s-traces.ads,
[pf3gnuchains/gcc-fork.git] / gcc / ada / switch-c.adb
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                             S W I T C H - C                              --
6 --                                                                          --
7 --                                 B o d y                                  --
8 --                                                                          --
9 --                            $Revision$
10 --                                                                          --
11 --          Copyright (C) 2001-2002 Free Software Foundation, Inc.          --
12 --                                                                          --
13 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
14 -- terms of the  GNU General Public License as published  by the Free Soft- --
15 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
16 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
19 -- for  more details.  You should have  received  a copy of the GNU General --
20 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
21 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
22 -- MA 02111-1307, USA.                                                      --
23 --                                                                          --
24 -- GNAT was originally developed  by the GNAT team at  New York University. --
25 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
26 --                                                                          --
27 ------------------------------------------------------------------------------
28
29 with Debug;    use Debug;
30 with Lib;      use Lib;
31 with Osint;    use Osint;
32 with Opt;      use Opt;
33 with Types;    use Types;
34 with Validsw;  use Validsw;
35 with Stylesw;  use Stylesw;
36
37 with System.WCh_Con; use System.WCh_Con;
38
39 package body Switch.C is
40
41    -----------------------------
42    -- Scan_Front_End_Switches --
43    -----------------------------
44
45    procedure Scan_Front_End_Switches (Switch_Chars : String) is
46       Switch_Starts_With_Gnat : Boolean;
47       --  True if first four switch characters are "gnat"
48
49       First_Switch : Boolean := True;
50       --  False for all but first switch
51
52       Ptr : Integer := Switch_Chars'First;
53       Max : constant Integer := Switch_Chars'Last;
54       C   : Character := ' ';
55
56       Store_Switch : Boolean  := True;
57       First_Char   : Integer  := Ptr;
58       Storing      : String   := Switch_Chars;
59       First_Stored : Positive := Ptr + 1;
60       --  The above need comments ???
61
62    begin
63       --  Skip past the initial character (must be the switch character)
64
65       if Ptr = Max then
66          raise Bad_Switch;
67       else
68          Ptr := Ptr + 1;
69       end if;
70
71       --  Remove "gnat" from the switch, if present
72
73       Switch_Starts_With_Gnat :=
74         Ptr + 3 <= Max and then Switch_Chars (Ptr .. Ptr + 3) = "gnat";
75
76       if Switch_Starts_With_Gnat then
77          Ptr := Ptr + 4;
78          First_Stored := Ptr;
79       end if;
80
81       --  Loop to scan through switches given in switch string
82
83       while Ptr <= Max loop
84          Store_Switch := True;
85          First_Char := Ptr;
86          C := Switch_Chars (Ptr);
87
88          --  Processing for a switch
89
90          case Switch_Starts_With_Gnat is
91
92             when False =>
93             --  There are only two front-end switches that
94             --  do not start with -gnat, namely -I and --RTS
95
96                if Switch_Chars (Ptr) = 'I' then
97                   Store_Switch := False;
98
99                   Ptr := Ptr + 1;
100
101                   if Ptr > Max then
102                      raise Bad_Switch;
103                   end if;
104
105                   --  Find out whether this is a -I- or regular -Ixxx switch
106
107                   if Ptr = Max and then Switch_Chars (Ptr) = '-' then
108                      Look_In_Primary_Dir := False;
109
110                   else
111                      Add_Src_Search_Dir (Switch_Chars (Ptr .. Max));
112                   end if;
113
114                   Ptr := Max + 1;
115
116                --  Processing of the --RTS switch. --RTS has been modified by
117                --  gcc and is now of the form -fRTS
118                elsif Ptr + 3 <= Max and then
119                  Switch_Chars (Ptr .. Ptr + 3) = "fRTS"
120                then
121                   Ptr := Ptr + 1;
122
123                   if Ptr + 4 > Max or else Switch_Chars (Ptr + 3) /= '=' then
124                      Osint.Fail ("missing path for --RTS");
125                   else
126
127                      --  valid --RTS switch
128                      Opt.No_Stdinc := True;
129                      Opt.RTS_Switch := True;
130
131                      declare
132                         Src_Path_Name : String_Ptr := Get_RTS_Search_Dir
133                           (Switch_Chars (Ptr + 4 .. Max), Include);
134                         Lib_Path_Name : String_Ptr := Get_RTS_Search_Dir
135                           (Switch_Chars (Ptr + 4 .. Max), Objects);
136                      begin
137                         if Src_Path_Name /= null and then
138                           Lib_Path_Name /= null
139                         then
140                            Add_Search_Dirs (Src_Path_Name, Include);
141                            Add_Search_Dirs (Lib_Path_Name, Objects);
142                            Ptr := Max + 1;
143                         elsif  Src_Path_Name = null
144                           and Lib_Path_Name = null then
145                            Osint.Fail ("RTS path not valid: missing " &
146                                        "adainclude and adalib directories");
147                         elsif Src_Path_Name = null then
148                            Osint.Fail ("RTS path not valid: missing " &
149                                        "adainclude directory");
150                         elsif  Lib_Path_Name = null then
151                            Osint.Fail ("RTS path not valid: missing " &
152                                        "adalib directory");
153                         end if;
154                      end;
155                   end if;
156                else
157                   raise Bad_Switch;
158                end if;
159
160          when True =>
161             --  Process -gnat* options
162
163             case C is
164
165             when 'a' =>
166                Ptr := Ptr + 1;
167                Assertions_Enabled := True;
168
169             --  Processing for A switch
170
171             when 'A' =>
172                Ptr := Ptr + 1;
173                Config_File := False;
174
175             --  Processing for b switch
176
177             when 'b' =>
178                Ptr := Ptr + 1;
179                Brief_Output := True;
180
181             --  Processing for c switch
182
183             when 'c' =>
184                if not First_Switch then
185                   Osint.Fail
186                     ("-gnatc myust be first if combined with other switches");
187                end if;
188
189                Ptr := Ptr + 1;
190                Operating_Mode := Check_Semantics;
191
192             --  Processing for C switch
193
194             when 'C' =>
195                Ptr := Ptr + 1;
196                Compress_Debug_Names := True;
197
198             --  Processing for d switch
199
200             when 'd' =>
201                Store_Switch := False;
202                Storing (First_Stored) := 'd';
203                --  Note: for the debug switch, the remaining characters in this
204                --  switch field must all be debug flags, since all valid switch
205                --  characters are also valid debug characters.
206
207                --  Loop to scan out debug flags
208
209                while Ptr < Max loop
210                   Ptr := Ptr + 1;
211                   C := Switch_Chars (Ptr);
212                   exit when C = ASCII.NUL or else C = '/' or else C = '-';
213
214                   if C in '1' .. '9' or else
215                      C in 'a' .. 'z' or else
216                      C in 'A' .. 'Z'
217                   then
218                      Set_Debug_Flag (C);
219                      Storing (First_Stored + 1) := C;
220                      Store_Compilation_Switch
221                        (Storing (Storing'First .. First_Stored + 1));
222
223                   else
224                      raise Bad_Switch;
225                   end if;
226                end loop;
227
228                --  Make sure Zero_Cost_Exceptions is set if gnatdX set. This
229                --  is for backwards compatibility with old versions and usage.
230
231                if Debug_Flag_XX then
232                   Zero_Cost_Exceptions_Set := True;
233                   Zero_Cost_Exceptions_Val := True;
234                end if;
235
236                return;
237
238             --  Processing for D switch
239
240             when 'D' =>
241                Ptr := Ptr + 1;
242
243                --  Note: -gnatD also sets -gnatx (to turn off cross-reference
244                --  generation in the ali file) since otherwise this generation
245                --  gets confused by the "wrong" Sloc values put in the tree.
246
247                Debug_Generated_Code := True;
248                Xref_Active := False;
249                Set_Debug_Flag ('g');
250
251             --  Processing for e switch
252
253             when 'e' =>
254                Ptr := Ptr + 1;
255
256                if Ptr > Max then
257                   raise Bad_Switch;
258                end if;
259
260                case Switch_Chars (Ptr) is
261
262                   --  Configuration pragmas
263
264                   when 'c' =>
265                      Store_Switch := False;
266                      Ptr := Ptr + 1;
267
268                      if Ptr > Max then
269                         raise Bad_Switch;
270                      end if;
271
272                      Config_File_Name :=
273                         new String'(Switch_Chars (Ptr .. Max));
274
275                      return;
276
277                   --  Mapping file
278
279                   when 'm' =>
280                      Store_Switch := False;
281                      Ptr := Ptr + 1;
282
283                      if Ptr > Max then
284                         raise Bad_Switch;
285                      end if;
286
287                      Mapping_File_Name :=
288                        new String'(Switch_Chars (Ptr .. Max));
289                      return;
290
291                   when others =>
292                      raise Bad_Switch;
293                end case;
294
295             --  Processing for E switch
296
297             when 'E' =>
298                Ptr := Ptr + 1;
299                Dynamic_Elaboration_Checks := True;
300
301             --  Processing for f switch
302
303             when 'f' =>
304                Ptr := Ptr + 1;
305                All_Errors_Mode := True;
306
307             --  Processing for F switch
308
309             when 'F' =>
310                Ptr := Ptr + 1;
311                External_Name_Exp_Casing := Uppercase;
312                External_Name_Imp_Casing := Uppercase;
313
314             --  Processing for g switch
315
316             when 'g' =>
317                Ptr := Ptr + 1;
318                GNAT_Mode                := True;
319                Identifier_Character_Set := 'n';
320                Warning_Mode             := Treat_As_Error;
321                Check_Unreferenced       := True;
322                Check_Withs              := True;
323
324                Set_Default_Style_Check_Options;
325
326             --  Processing for G switch
327
328             when 'G' =>
329                Ptr := Ptr + 1;
330                Print_Generated_Code := True;
331
332             --  Processing for h switch
333
334             when 'h' =>
335                Ptr := Ptr + 1;
336                Usage_Requested := True;
337
338             --  Processing for H switch
339
340             when 'H' =>
341                Ptr := Ptr + 1;
342                HLO_Active := True;
343
344             --  Processing for i switch
345
346             when 'i' =>
347                if Ptr = Max then
348                   raise Bad_Switch;
349                end if;
350
351                Ptr := Ptr + 1;
352                C := Switch_Chars (Ptr);
353
354                if C in '1' .. '5'
355                  or else C = '8'
356                  or else C = '9'
357                  or else C = 'p'
358                  or else C = 'f'
359                  or else C = 'n'
360                  or else C = 'w'
361                then
362                   Identifier_Character_Set := C;
363                   Ptr := Ptr + 1;
364
365                else
366                   raise Bad_Switch;
367                end if;
368
369             --  Processing for k switch
370
371             when 'k' =>
372                Ptr := Ptr + 1;
373                Scan_Pos (Switch_Chars, Max, Ptr, Maximum_File_Name_Length);
374
375             --  Processing for l switch
376
377             when 'l' =>
378                Ptr := Ptr + 1;
379                Full_List := True;
380
381             --  Processing for L switch
382
383             when 'L' =>
384                Ptr := Ptr + 1;
385                Zero_Cost_Exceptions_Set := True;
386                Zero_Cost_Exceptions_Val := False;
387
388             --  Processing for m switch
389
390             when 'm' =>
391                Ptr := Ptr + 1;
392                Scan_Pos (Switch_Chars, Max, Ptr, Maximum_Errors);
393
394             --  Processing for n switch
395
396             when 'n' =>
397                Ptr := Ptr + 1;
398                Inline_Active := True;
399
400             --  Processing for N switch
401
402             when 'N' =>
403                Ptr := Ptr + 1;
404                Inline_Active := True;
405                Front_End_Inlining := True;
406
407             --  Processing for o switch
408
409             when 'o' =>
410                Ptr := Ptr + 1;
411                Suppress_Options.Overflow_Checks := False;
412                Opt.Enable_Overflow_Checks := True;
413
414             --  Processing for O switch
415
416             when 'O' =>
417                Ptr := Ptr + 1;
418                Output_File_Name_Present := True;
419
420             --  Processing for p switch
421
422             when 'p' =>
423                Ptr := Ptr + 1;
424                Suppress_Options.Access_Checks        := True;
425                Suppress_Options.Accessibility_Checks := True;
426                Suppress_Options.Discriminant_Checks  := True;
427                Suppress_Options.Division_Checks      := True;
428                Suppress_Options.Elaboration_Checks   := True;
429                Suppress_Options.Index_Checks         := True;
430                Suppress_Options.Length_Checks        := True;
431                Suppress_Options.Overflow_Checks      := True;
432                Suppress_Options.Range_Checks         := True;
433                Suppress_Options.Storage_Checks       := True;
434                Suppress_Options.Tag_Checks           := True;
435
436                Validity_Checks_On := False;
437                Opt.Suppress_Checks := True;
438                Opt.Enable_Overflow_Checks := False;
439
440             --  Processing for P switch
441
442             when 'P' =>
443                Ptr := Ptr + 1;
444                Polling_Required := True;
445
446             --  Processing for q switch
447
448             when 'q' =>
449                Ptr := Ptr + 1;
450                Try_Semantics := True;
451
452             --  Processing for q switch
453
454             when 'Q' =>
455                Ptr := Ptr + 1;
456                Force_ALI_Tree_File := True;
457                Try_Semantics := True;
458
459             --  Processing for R switch
460
461             when 'R' =>
462                Ptr := Ptr + 1;
463                Back_Annotate_Rep_Info := True;
464
465                if Ptr <= Max
466                  and then Switch_Chars (Ptr) in '0' .. '9'
467                then
468                   C := Switch_Chars (Ptr);
469
470                   if C in '4' .. '9' then
471                      raise Bad_Switch;
472                   else
473                      List_Representation_Info :=
474                        Character'Pos (C) - Character'Pos ('0');
475                      Ptr := Ptr + 1;
476                   end if;
477
478                   if Ptr <= Max and then Switch_Chars (Ptr) = 's' then
479                      Ptr := Ptr + 1;
480
481                      if List_Representation_Info /= 0 then
482                         List_Representation_Info_To_File := True;
483                      end if;
484                   end if;
485
486                else
487                   List_Representation_Info := 1;
488                end if;
489
490             --  Processing for s switch
491
492             when 's' =>
493                if not First_Switch then
494                   Osint.Fail
495                     ("-gnats myust be first if combined with other switches");
496                end if;
497
498                Ptr := Ptr + 1;
499                Operating_Mode := Check_Syntax;
500
501             --  Processing for t switch
502
503             when 't' =>
504                Ptr := Ptr + 1;
505                Tree_Output := True;
506                Back_Annotate_Rep_Info := True;
507
508             --  Processing for T switch
509
510             when 'T' =>
511                Ptr := Ptr + 1;
512                Scan_Pos (Switch_Chars, Max, Ptr, Table_Factor);
513
514             --  Processing for u switch
515
516             when 'u' =>
517                Ptr := Ptr + 1;
518                List_Units := True;
519
520             --  Processing for U switch
521
522             when 'U' =>
523                Ptr := Ptr + 1;
524                Unique_Error_Tag := True;
525
526             --  Processing for v switch
527
528             when 'v' =>
529                Ptr := Ptr + 1;
530                Verbose_Mode := True;
531
532             --  Processing for V switch
533
534             when 'V' =>
535                Store_Switch := False;
536                Storing (First_Stored) := 'V';
537                Ptr := Ptr + 1;
538
539                if Ptr > Max then
540                   raise Bad_Switch;
541
542                else
543                   declare
544                      OK  : Boolean;
545
546                   begin
547                      Set_Validity_Check_Options
548                        (Switch_Chars (Ptr .. Max), OK, Ptr);
549
550                      if not OK then
551                         raise Bad_Switch;
552                      end if;
553
554                      for Index in First_Char + 1 .. Max loop
555                         Storing (First_Stored + 1) :=
556                           Switch_Chars (Index);
557                         Store_Compilation_Switch
558                           (Storing (Storing'First .. First_Stored + 1));
559                      end loop;
560                   end;
561                end if;
562
563                Ptr := Max + 1;
564
565             --  Processing for w switch
566
567             when 'w' =>
568                Store_Switch := False;
569                Storing (First_Stored) := 'w';
570                Ptr := Ptr + 1;
571
572                if Ptr > Max then
573                   raise Bad_Switch;
574                end if;
575
576                while Ptr <= Max loop
577                   C := Switch_Chars (Ptr);
578
579                   case C is
580
581                      when 'a' =>
582                         Constant_Condition_Warnings     := True;
583                         Elab_Warnings                   := True;
584                         Check_Unreferenced              := True;
585                         Check_Withs                     := True;
586                         Check_Unreferenced_Formals      := True;
587                         Implementation_Unit_Warnings    := True;
588                         Ineffective_Inline_Warnings     := True;
589                         Warn_On_Redundant_Constructs    := True;
590
591                      when 'A' =>
592                         Constant_Condition_Warnings     := False;
593                         Elab_Warnings                   := False;
594                         Check_Unreferenced              := False;
595                         Check_Withs                     := False;
596                         Check_Unreferenced_Formals      := False;
597                         Implementation_Unit_Warnings    := False;
598                         Warn_On_Biased_Rounding         := False;
599                         Warn_On_Dereference             := False;
600                         Warn_On_Hiding                  := False;
601                         Warn_On_Redundant_Constructs    := False;
602                         Ineffective_Inline_Warnings     := False;
603
604                      when 'b' =>
605                         Warn_On_Biased_Rounding         := True;
606
607                      when 'B' =>
608                         Warn_On_Biased_Rounding         := False;
609
610                      when 'c' =>
611                         Constant_Condition_Warnings     := True;
612
613                      when 'C' =>
614                         Constant_Condition_Warnings     := False;
615
616                      when 'd' =>
617                         Warn_On_Dereference             := True;
618
619                      when 'D' =>
620                         Warn_On_Dereference             := False;
621
622                      when 'e' =>
623                         Warning_Mode                    := Treat_As_Error;
624
625                      when 'f' =>
626                         Check_Unreferenced_Formals      := True;
627
628                      when 'F' =>
629                         Check_Unreferenced_Formals      := False;
630
631                      when 'h' =>
632                         Warn_On_Hiding                  := True;
633
634                      when 'H' =>
635                         Warn_On_Hiding                  := False;
636
637                      when 'i' =>
638                         Implementation_Unit_Warnings    := True;
639
640                      when 'I' =>
641                         Implementation_Unit_Warnings    := False;
642
643                      when 'l' =>
644                         Elab_Warnings                   := True;
645
646                      when 'L' =>
647                         Elab_Warnings                   := False;
648
649                      when 'o' =>
650                         Address_Clause_Overlay_Warnings := True;
651
652                      when 'O' =>
653                         Address_Clause_Overlay_Warnings := False;
654
655                      when 'p' =>
656                         Ineffective_Inline_Warnings     := True;
657
658                      when 'P' =>
659                         Ineffective_Inline_Warnings     := False;
660
661                      when 'r' =>
662                         Warn_On_Redundant_Constructs    := True;
663
664                      when 'R' =>
665                         Warn_On_Redundant_Constructs    := False;
666
667                      when 's' =>
668                         Warning_Mode                    := Suppress;
669
670                      when 'u' =>
671                         Check_Unreferenced              := True;
672                         Check_Withs                     := True;
673                         Check_Unreferenced_Formals      := True;
674
675                      when 'U' =>
676                         Check_Unreferenced              := False;
677                         Check_Withs                     := False;
678                         Check_Unreferenced_Formals      := False;
679
680                         --  Allow and ignore 'w' so that the old
681                         --  format (e.g. -gnatwuwl) will work.
682
683                      when 'w' =>
684                         null;
685
686                      when others =>
687                         raise Bad_Switch;
688                   end case;
689
690                   if C /= 'w' then
691                      Storing (First_Stored + 1) := C;
692                      Store_Compilation_Switch
693                        (Storing (Storing'First .. First_Stored + 1));
694                   end if;
695
696                   Ptr := Ptr + 1;
697                end loop;
698
699                return;
700
701             --  Processing for W switch
702
703             when 'W' =>
704                Ptr := Ptr + 1;
705
706                if Ptr > Max then
707                   raise Bad_Switch;
708                end if;
709
710                for J in WC_Encoding_Method loop
711                   if Switch_Chars (Ptr) = WC_Encoding_Letters (J) then
712                      Wide_Character_Encoding_Method := J;
713                      exit;
714
715                   elsif J = WC_Encoding_Method'Last then
716                      raise Bad_Switch;
717                   end if;
718                end loop;
719
720                Upper_Half_Encoding :=
721                  Wide_Character_Encoding_Method in
722                  WC_Upper_Half_Encoding_Method;
723
724                Ptr := Ptr + 1;
725
726             --  Processing for x switch
727
728             when 'x' =>
729                Ptr := Ptr + 1;
730                Xref_Active := False;
731
732             --  Processing for X switch
733
734             when 'X' =>
735                Ptr := Ptr + 1;
736                Extensions_Allowed := True;
737
738             --  Processing for y switch
739
740             when 'y' =>
741                Ptr := Ptr + 1;
742
743                if Ptr > Max then
744                   Set_Default_Style_Check_Options;
745
746                else
747                   Store_Switch := False;
748                   Storing (First_Stored) := 'y';
749
750                   declare
751                      OK  : Boolean;
752                      Last_Stored : Integer;
753
754                   begin
755                      Set_Style_Check_Options
756                        (Switch_Chars (Ptr .. Max), OK, Ptr);
757
758                      if not OK then
759                         raise Bad_Switch;
760                      end if;
761
762                      Ptr := First_Char + 1;
763
764                      while Ptr <= Max loop
765                         Last_Stored := First_Stored + 1;
766                         Storing (Last_Stored) := Switch_Chars (Ptr);
767
768                         if Switch_Chars (Ptr) = 'M' then
769                            loop
770                               Ptr := Ptr + 1;
771                               exit when Ptr > Max
772                                 or else Switch_Chars (Ptr) not in '0' .. '9';
773                               Last_Stored := Last_Stored + 1;
774                               Storing (Last_Stored) := Switch_Chars (Ptr);
775                            end loop;
776
777                         else
778                            Ptr := Ptr + 1;
779                         end if;
780
781                         Store_Compilation_Switch
782                           (Storing (Storing'First .. Last_Stored));
783                      end loop;
784                   end;
785                end if;
786
787             --  Processing for z switch
788
789             when 'z' =>
790                Ptr := Ptr + 1;
791
792                --  Allowed for compiler, only if this is the only
793                --  -z switch, we do not allow multiple occurrences
794
795                if Distribution_Stub_Mode = No_Stubs then
796                   case Switch_Chars (Ptr) is
797                      when 'r' =>
798                         Distribution_Stub_Mode := Generate_Receiver_Stub_Body;
799
800                      when 'c' =>
801                         Distribution_Stub_Mode := Generate_Caller_Stub_Body;
802
803                      when others =>
804                         raise Bad_Switch;
805                   end case;
806
807                   Ptr := Ptr + 1;
808
809                end if;
810
811             --  Processing for Z switch
812
813             when 'Z' =>
814                Ptr := Ptr + 1;
815                Zero_Cost_Exceptions_Set := True;
816                Zero_Cost_Exceptions_Val := True;
817
818             --  Processing for 83 switch
819
820             when '8' =>
821
822                if Ptr = Max then
823                   raise Bad_Switch;
824                end if;
825
826                Ptr := Ptr + 1;
827
828                if Switch_Chars (Ptr) /= '3' then
829                   raise Bad_Switch;
830                else
831                   Ptr := Ptr + 1;
832                   Ada_95 := False;
833                   Ada_83 := True;
834                end if;
835
836             --  Ignore extra switch character
837
838             when '/' | '-' =>
839                Ptr := Ptr + 1;
840
841             --  Anything else is an error (illegal switch character)
842
843             when others =>
844                raise Bad_Switch;
845             end case;
846          end case;
847
848          if Store_Switch then
849             Storing (First_Stored .. First_Stored + Ptr - First_Char - 1) :=
850               Switch_Chars (First_Char .. Ptr - 1);
851             Store_Compilation_Switch
852               (Storing (Storing'First .. First_Stored + Ptr - First_Char - 1));
853          end if;
854
855          First_Switch := False;
856       end loop;
857
858    exception
859       when Bad_Switch =>
860          Osint.Fail ("invalid switch: ", (1 => C));
861
862       when Bad_Switch_Value =>
863          Osint.Fail ("numeric value too big for switch: ", (1 => C));
864
865       when Missing_Switch_Value =>
866          Osint.Fail ("missing numeric value for switch: ", (1 => C));
867
868    end Scan_Front_End_Switches;
869
870 end Switch.C;