]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 22 Jun 2016 10:39:31 +0000 (12:39 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 22 Jun 2016 10:39:31 +0000 (12:39 +0200)
2016-06-22  Bob Duff  <duff@adacore.com>

* g-comlin.ads (Parameter_Type): Change subtype of Last to
Natural.
* g-comlin.adb (Set_Parameter): Change subtype of Last to
Natural.
(Getopt): Check for Arg = "", and Switches /= "".
(Internal_Initialize_Option_Scan): Check for Argument (Parser,
Index) /= "".

2016-06-22  Gary Dismukes  <dismukes@adacore.com>

* sem_prag.adb, sem_ch8.adb: Minor reformatting.

From-SVN: r237693

gcc/ada/ChangeLog
gcc/ada/g-comlin.adb
gcc/ada/g-comlin.ads
gcc/ada/sem_ch8.adb
gcc/ada/sem_prag.adb

index 2a9fce93418f2cc04ebb76565ff52872fe561e1a..b4e4cf5356f9937d9577315a8103ae94147f25fe 100644 (file)
@@ -1,3 +1,17 @@
+2016-06-22  Bob Duff  <duff@adacore.com>
+
+       * g-comlin.ads (Parameter_Type): Change subtype of Last to
+       Natural.
+       * g-comlin.adb (Set_Parameter): Change subtype of Last to
+       Natural.
+       (Getopt): Check for Arg = "", and Switches /= "".
+       (Internal_Initialize_Option_Scan): Check for Argument (Parser,
+       Index) /= "".
+
+2016-06-22  Gary Dismukes  <dismukes@adacore.com>
+
+       * sem_prag.adb, sem_ch8.adb: Minor reformatting.
+
 2016-06-22  Ed Schonberg  <schonberg@adacore.com>
 
        * einfo.ads, einfo.adb (Is_Actual_Subtype): New flag, defined
index 86ac2b5988155786ee6a2993ba8e4a9ddd682cef..5260fec3bd9f9e1e1b2779139f836b1c223a3132 100644 (file)
@@ -56,7 +56,7 @@ package body GNAT.Command_Line is
      (Variable : out Parameter_Type;
       Arg_Num  : Positive;
       First    : Positive;
-      Last     : Positive;
+      Last     : Natural;
       Extra    : Character := ASCII.NUL);
    pragma Inline (Set_Parameter);
    --  Set the parameter that will be returned by Parameter below
@@ -621,7 +621,7 @@ package body GNAT.Command_Line is
          --  If we are on a new item, test if this might be a switch
 
          if Parser.Current_Index = Arg'First then
-            if Arg (Arg'First) /= Parser.Switch_Character then
+            if Arg = "" or else Arg (Arg'First) /= Parser.Switch_Character then
 
                --  If it isn't a switch, return it immediately. We also know it
                --  isn't the parameter to a previous switch, since that has
@@ -705,7 +705,7 @@ package body GNAT.Command_Line is
                  (if Concatenate then Parser.Current_Index else Arg'Last);
             end if;
 
-            if Switches (Switches'First) = '*' then
+            if Switches /= "" and then Switches (Switches'First) = '*' then
 
                --  Always prepend the switch character, so that users know
                --  that this comes from a switch on the command line. This
@@ -1061,7 +1061,9 @@ package body GNAT.Command_Line is
          Section_Num := Section_Num + 1;
 
          for Index in 1 .. Parser.Arg_Count loop
-            if Argument (Parser, Index)(1) = Parser.Switch_Character
+            pragma Assert (Argument (Parser, Index)'First = 1);
+            if Argument (Parser, Index) /= ""
+              and then Argument (Parser, Index)(1) = Parser.Switch_Character
               and then
                 Argument (Parser, Index) = Parser.Switch_Character &
                                              Section_Delimiters
@@ -1127,7 +1129,7 @@ package body GNAT.Command_Line is
      (Variable : out Parameter_Type;
       Arg_Num  : Positive;
       First    : Positive;
-      Last     : Positive;
+      Last     : Natural;
       Extra    : Character := ASCII.NUL)
    is
    begin
index 283bf47d4ff6c7f4dbbf6f6f2d995456af486534..f7585085ac6a9b2cf23f42a824610d2550200de0 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---                     Copyright (C) 1999-2015, AdaCore                     --
+--                     Copyright (C) 1999-2016, AdaCore                     --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -1030,7 +1030,7 @@ private
    type Parameter_Type is record
       Arg_Num : Positive;
       First   : Positive;
-      Last    : Positive;
+      Last    : Natural;
       Extra   : Character;
    end record;
 
index 44bae7d52e013890f1adf3b601eb9fe451d857a0..e1b31aaa34abbbd4b7a9a4872cae3d37d968ef14 100644 (file)
@@ -1037,8 +1037,8 @@ package body Sem_Ch8 is
            and then not Is_Access_Constant (Etype (Nam))
          then
             Error_Msg_N
-               ("(Ada 2005): the renamed object is not access-to-constant "
-                & "(RM 8.5.1(6))", N);
+              ("(Ada 2005): the renamed object is not access-to-constant "
+               & "(RM 8.5.1(6))", N);
 
          elsif not Constant_Present (Access_Definition (N))
            and then Is_Access_Constant (Etype (Nam))
index c266e2d5d02b8dd44f8b026b16f2678af5998cae..ccaa8e90f6e9193cba8a83f5e43273f87f79033d 100644 (file)
@@ -5061,7 +5061,7 @@ package body Sem_Prag is
          end if;
 
          --  An expression cannot be considered static if its resolution failed
-         --  or if it erroneous. Stop the analysis of the related pragma.
+         --  or if it's erroneous. Stop the analysis of the related pragma.
 
          if Etype (Expr) = Any_Type or else Error_Posted (Expr) then
             raise Pragma_Exit;