From d1aea5ddc5c0667762f8e0138c60199ba0f31fe2 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 22 Jun 2016 12:39:31 +0200 Subject: [PATCH] [multiple changes] 2016-06-22 Bob Duff * 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 * sem_prag.adb, sem_ch8.adb: Minor reformatting. From-SVN: r237693 --- gcc/ada/ChangeLog | 14 ++++++++++++++ gcc/ada/g-comlin.adb | 12 +++++++----- gcc/ada/g-comlin.ads | 4 ++-- gcc/ada/sem_ch8.adb | 4 ++-- gcc/ada/sem_prag.adb | 2 +- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 2a9fce93418..b4e4cf5356f 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,17 @@ +2016-06-22 Bob Duff + + * 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 + + * sem_prag.adb, sem_ch8.adb: Minor reformatting. + 2016-06-22 Ed Schonberg * einfo.ads, einfo.adb (Is_Actual_Subtype): New flag, defined diff --git a/gcc/ada/g-comlin.adb b/gcc/ada/g-comlin.adb index 86ac2b59881..5260fec3bd9 100644 --- a/gcc/ada/g-comlin.adb +++ b/gcc/ada/g-comlin.adb @@ -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 diff --git a/gcc/ada/g-comlin.ads b/gcc/ada/g-comlin.ads index 283bf47d4ff..f7585085ac6 100644 --- a/gcc/ada/g-comlin.ads +++ b/gcc/ada/g-comlin.ads @@ -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; diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 44bae7d52e0..e1b31aaa34a 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -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)) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index c266e2d5d02..ccaa8e90f6e 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -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; -- 2.30.2