]> gcc.gnu.org Git - gcc.git/commitdiff
g-comlin.adb (For_Each_Simple_Switch): Take care of switches not part of any alias...
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 20 Aug 2008 15:30:04 +0000 (17:30 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 20 Aug 2008 15:30:04 +0000 (17:30 +0200)
2008-08-20  Jerome Lambourg  <lambourg@adacore.com>

* g-comlin.adb (For_Each_Simple_Switch): Take care of switches not part
of any alias or prefix but having attached parameters (as \"-O2\").

From-SVN: r139314

gcc/ada/ChangeLog
gcc/ada/g-comlin.adb

index dde77de3831c33977b3a68366dba3c72a4defc55..b01ef1013b34ede17dbdd335ed3d3e7b9902fd17 100644 (file)
@@ -1,3 +1,24 @@
+2008-08-20  Vincent Celier  <celier@adacore.com>
+
+       * prj-nmsc.adb (Check_Naming_Schemes): Accept source file names for
+       gprbuild when casing is MixedCase, whatever the casing of the letters
+       in the file name.
+
+2008-08-20  Gary Dismukes  <dismukes@adacore.com>
+
+       * exp_ch3.adb (Build_Array_Init_Proc): Clarify comment related to
+       creating dummy init proc.
+       (Requires_Init_Proc): Return False in the case No_Default_Initialization
+       is in force and the type does not have associated default
+       initialization. Move test of Is_Public (with tests of restrictions
+       No_Initialize_Scalars and No_Default_Initialization) to end, past tests
+       for default initialization.
+
+2008-08-20  Jerome Lambourg  <lambourg@adacore.com>
+
+       * g-comlin.adb (For_Each_Simple_Switch): Take care of switches not part
+       of any alias or prefix but having attached parameters (as \"-O2\").
+
 2008-08-20  Robert Dewar  <dewar@adacore.com>
 
        * s-fileio.adb: Minor reformatting
index d37d06b68a3f7cd4bb2f5669d259fb63cecd2749..e3070414dc3ba5d7a5172c68edb1c914ec9ae1c2 100644 (file)
@@ -1566,6 +1566,50 @@ package body GNAT.Command_Line is
          end loop;
       end if;
 
+      --  Determine if the added switch is a known switch with parameter
+      --  attached.
+      if Parameter = ""
+        and then Cmd.Config /= null
+        and then Cmd.Config.Switches /= null
+      then
+         for S in Cmd.Config.Switches'Range loop
+            declare
+               Sw    : constant String :=
+                         Actual_Switch (Cmd.Config.Switches (S).all);
+               Last  : Natural;
+               Param : Natural;
+
+            begin
+               if Switch'Length >= Sw'Length
+                 --  Verify that switch starts with Sw
+                 and then Looking_At (Switch, Switch'First, Sw)
+               then
+                  Param := Switch'First + Sw'Length - 1;
+                  Last := Param;
+
+                  if Can_Have_Parameter (Cmd.Config.Switches (S).all) then
+                     while Last < Switch'Last
+                       and then Switch (Last + 1) in '0' .. '9'
+                     loop
+                        Last := Last + 1;
+                     end loop;
+                  end if;
+
+                  --  If the full Switch is a known switch with attached
+                  --  parameter, then we use this parameter in the callback.
+                  if Last = Switch'Last then
+                     Callback
+                       (Switch (Switch'First .. Param),
+                        Switch (Param + 1 .. Last));
+
+                     return;
+
+                  end if;
+               end if;
+            end;
+         end loop;
+      end if;
+
       Callback (Switch, Parameter);
    end For_Each_Simple_Switch;
 
This page took 0.092424 seconds and 5 git commands to generate.