Next_Arg : Positive;
-- Next argument to be scanned
+ Arg_Count : constant Natural := Natural (save_argc - 1);
+ Args : Argument_List (1 .. Arg_Count);
+
Output_File_Name_Seen : Boolean := False;
-- Set to True after having scanned file_name for switch "-gnatO file"
Last : constant Natural := Switch_Last (Switch_Chars);
begin
- -- Skip -o, -G or internal GCC switches together with their argument.
+ -- Skip -o or internal GCC switches together with their argument.
if Switch_Chars (First .. Last) = "o"
- or else Switch_Chars (First .. Last) = "G"
or else Is_Internal_GCC_Switch (Switch_Chars)
then
Next_Arg := Next_Arg + 1;
+ -- Store -G xxx as -Gxxx and go directly to the next argument.
+
+ elsif Switch_Chars (First .. Last) = "G" then
+ Next_Arg := Next_Arg + 1;
+
+ -- Should never get there with -G not followed by an argument,
+ -- but use defensive code nonetheless.
+ -- Store as -Gxxx to avoid storing parameters in ALI files that
+ -- might create confusion.
+
+ if Next_Arg <= Args'Last then
+ Store_Compilation_Switch (Switch_Chars & Args (Next_Arg).all);
+ end if;
+
-- Do not record -quiet switch
elsif Switch_Chars (First .. Last) = "quiet" then
end if;
end Scan_Back_End_Switches;
- -- Local variables
-
- Arg_Count : constant Natural := Natural (save_argc - 1);
- Args : Argument_List (1 .. Arg_Count);
-
-- Start of processing for Scan_Compiler_Arguments
begin