From: charlet Date: Mon, 29 Oct 2012 11:03:27 +0000 (+0000) Subject: 2012-10-29 Robert Dewar X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0a1ae14d8559867ebcdd78abc5bc199f0d757364;p=thirdparty%2Fgcc.git 2012-10-29 Robert Dewar * xr_tabls.adb, xr_tabls.ads, exp_ch9.adb, snames.adb-tmpl, snames.ads-tmpl, exp_ch3.adb: Minor reformatting. 2012-10-29 Ed Schonberg * sem_ch6.adb: Call Build_Subprogrm_Instance_Renamings only when generating code. 2012-10-29 Robert Dewar * gnat_ugn.texi: Add documentation for -gnatw.k/-gnatw.K. * ug_words: Add entries for -gnatw.k/.K for [NO]STANDARD_REDEFINITION. * vms_data.ads: Add entries for [NO]STANDARD_REDEFINITION. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192929 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f6550b68018f..0793113072e8 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,19 @@ +2012-10-29 Robert Dewar + + * xr_tabls.adb, xr_tabls.ads, exp_ch9.adb, snames.adb-tmpl, + snames.ads-tmpl, exp_ch3.adb: Minor reformatting. + +2012-10-29 Ed Schonberg + + * sem_ch6.adb: Call Build_Subprogrm_Instance_Renamings only when + generating code. + +2012-10-29 Robert Dewar + + * gnat_ugn.texi: Add documentation for -gnatw.k/-gnatw.K. + * ug_words: Add entries for -gnatw.k/.K for [NO]STANDARD_REDEFINITION. + * vms_data.ads: Add entries for [NO]STANDARD_REDEFINITION. + 2012-10-29 Tristan Gingold * exp_ch9.adb, s-tarest.ads, exp_ch3.adb: Update comments. diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 83ae4e4c711a..0e703da2237c 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -1538,7 +1538,7 @@ package body Exp_Ch3 is end if; -- Add _Chain (not done in the restricted profile because not used, - -- see comment of Create_Restricted_Task in s-tarest.ads). + -- see comment for Create_Restricted_Task in s-tarest.ads). if not Restricted_Profile then Append_To (Args, Make_Identifier (Loc, Name_uChain)); @@ -7809,7 +7809,7 @@ package body Exp_Ch3 is if not Restricted_Profile then -- No _Chain for the restricted profile because not used, see - -- comment of Create_Restricted_Task in s-tarest.ads. + -- comment for Create_Restricted_Task in s-tarest.ads. Append_To (Formals, Make_Parameter_Specification (Loc, diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index f103e924593f..8ce3870f0023 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -912,7 +912,7 @@ package body Exp_Ch9 is begin -- Activation chain is never used in restricted profile, see comment - -- of Create_Restricted_Task in s-tarest.ads. + -- for Create_Restricted_Task in s-tarest.ads. if Restricted_Profile then return; diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index b94f035ba918..1a38806f8c04 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -5159,6 +5159,7 @@ switch are @option{-gnatwh} (hiding), @option{-gnatw.h} (holes (gaps) in record layouts) @option{-gnatw.i} (overlapping actuals), +@option{-gnatw.k} (redefinition of names in standard), @option{-gnatwl} (elaboration warnings), @option{-gnatw.l} (inherited aspects), @option{-gnatw.o} (warn on values set by out parameters ignored), @@ -5469,6 +5470,24 @@ This warning can also be turned on using @option{-gnatwa}. @cindex @option{-gnatwK} (@command{gcc}) This switch disables warnings on variables that could be declared constants. +@item -gnatw.k +@emph{Activate warnings on redefinition of names in standard.} +@cindex @option{-gnatw.k} (@command{gcc}) +This switch activates warnings for declarations that declare a name that +is defined in package Standard. Such declarations can be confusing, +especially since the names in package Standard continue to be directly +visible, meaning that use visibiliy on such redeclared names does not +work as expected. Names of discriminants and components in records are +not included in this check. +This warning is not part of the warnings activated by @option{-gnatwa}. +It must be explicitly activated. + +@item -gnatw.K +@emph{Suppress warnings on variables that could be constants.} +@cindex @option{-gnatwK} (@command{gcc}) +This switch activates warnings for declarations that declare a name that +is defined in package Standard. + @item -gnatwl @emph{Activate warnings for elaboration pragmas.} @cindex @option{-gnatwl} (@command{gcc}) diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index ffebc9b7fd60..37dc5befbcf0 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -2726,10 +2726,14 @@ package body Sem_Ch6 is Last_Real_Spec_Entity := Last_Entity (Spec_Id); -- Within an instance, add local renaming declarations so that - -- gdb can retrieve the values of actuals more easily. + -- gdb can retrieve the values of actuals more easily. This is + -- only relevant if generating code (and indeed we definitely + -- do not want these definitions -gnatc mode, because that would + -- confuse ASIS). if Is_Generic_Instance (Spec_Id) and then Is_Wrapper_Package (Current_Scope) + and then Expander_Active then Build_Subprogram_Instance_Renamings (N, Current_Scope); end if; diff --git a/gcc/ada/snames.adb-tmpl b/gcc/ada/snames.adb-tmpl index e314d99aa891..9255395ffe4d 100644 --- a/gcc/ada/snames.adb-tmpl +++ b/gcc/ada/snames.adb-tmpl @@ -423,11 +423,12 @@ package body Snames is -- Is_Partition_Elaboration_Policy -- ------------------------------------- - function Is_Partition_Elaboration_Policy_Name (N : Name_Id) - return Boolean is + function Is_Partition_Elaboration_Policy_Name + (N : Name_Id) return Boolean + is begin - return N in First_Partition_Elaboration_Policy_Name - .. Last_Partition_Elaboration_Policy_Name; + return N in First_Partition_Elaboration_Policy_Name .. + Last_Partition_Elaboration_Policy_Name; end Is_Partition_Elaboration_Policy_Name; ----------------------------- diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index c187600694ca..7987c8a41fd8 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -1915,7 +1915,8 @@ package Snames is function Is_Locking_Policy_Name (N : Name_Id) return Boolean; -- Test to see if the name N is the name of a recognized locking policy - function Is_Partition_Elaboration_Policy_Name (N : Name_Id) return Boolean; + function Is_Partition_Elaboration_Policy_Name + (N : Name_Id) return Boolean; -- Test to see if the name N is the name of a recognized partition -- elaboration policy. diff --git a/gcc/ada/ug_words b/gcc/ada/ug_words index a3ca962922ae..b1b45c407cba 100644 --- a/gcc/ada/ug_words +++ b/gcc/ada/ug_words @@ -170,6 +170,8 @@ gcc -c ^ GNAT COMPILE -gnatw.P ^ /WARNINGS=NO_PARAMETER_ORDER -gnatw.h ^ /WARNINGS=OVERRIDING_SIZE -gnatw.H ^ /WARNINGS=NOOVERRIDING_SIZE +-gnatw.k ^ /WARNINGS=STANDARD_REDEFINITION +-gnatw.K ^ /WARNINGS=NOSTANDARD_REDEFINITION -gnatwq ^ /WARNINGS=MISSING_PARENS -gnatwQ ^ /WARNINGS=NOMISSING_PARENS -gnatwr ^ /WARNINGS=REDUNDANT diff --git a/gcc/ada/vms_data.ads b/gcc/ada/vms_data.ads index c33bb8f71f60..8c1c1eb73ec9 100644 --- a/gcc/ada/vms_data.ads +++ b/gcc/ada/vms_data.ads @@ -3070,6 +3070,10 @@ package VMS_Data is "-gnatwk " & "NOCONSTANT_VARIABLES " & "-gnatwK " & + "STANDARD_REDEFINITION " & + "-gnatw.k " & + "NOSTANDARD_REDEFINITION " & + "-gnatw.K " & "ELABORATION " & "-gnatwl " & "NOELABORATION " & diff --git a/gcc/ada/xr_tabls.adb b/gcc/ada/xr_tabls.adb index 2bc293259034..61ac67523b0b 100644 --- a/gcc/ada/xr_tabls.adb +++ b/gcc/ada/xr_tabls.adb @@ -295,10 +295,10 @@ package body Xr_Tabls is then New_Decl.Match := Default_Match or else Match (File_Ref, Line, Column); - New_Decl.Is_Parameter := New_Decl.Is_Parameter or else Is_Param; + New_Decl.Is_Parameter := New_Decl.Is_Parameter or Is_Param; elsif New_Decl /= null then - New_Decl.Is_Parameter := New_Decl.Is_Parameter or else Is_Param; + New_Decl.Is_Parameter := New_Decl.Is_Parameter or Is_Param; end if; return New_Decl; @@ -413,22 +413,23 @@ package body Xr_Tabls is when '=' | '<' | '>' | '^' => - -- Create a dummy declaration in the table to report it as a - -- parameter. + -- Create dummy declaration in table to report it as a parameter + -- In a given ALI file, the declaration of the subprogram comes -- before the declaration of the parameter. However, it is -- possible that another ALI file has been parsed that also - -- references the parameter (for instance a named parameter in a - -- call), so we need to check whether there already exists a + -- references the parameter (for instance a named parameter in + -- a call), so we need to check whether there already exists a -- declaration for the parameter. - New_Decl := Add_Declaration - (File_Ref => File_Ref, - Symbol => "", - Line => Line, - Column => Column, - Decl_Type => ' ', - Is_Parameter => True); + New_Decl := + Add_Declaration + (File_Ref => File_Ref, + Symbol => "", + Line => Line, + Column => Column, + Decl_Type => ' ', + Is_Parameter => True); when 'e' | 'z' | 't' | 'p' | 'P' | 'k' | 'd' => return; diff --git a/gcc/ada/xr_tabls.ads b/gcc/ada/xr_tabls.ads index 9aa47bc95458..b328b82b9034 100644 --- a/gcc/ada/xr_tabls.ads +++ b/gcc/ada/xr_tabls.ads @@ -88,10 +88,9 @@ package Xr_Tabls is -- removed, but the new entity is never inserted. Symbol_Match should be -- set to False if the name of the symbol doesn't match the pattern from -- the command line. In that case, the entity will not be output by - -- gnatfind. If Symbol_Match is True, the entity will only be output if the - -- file name itself matches. - -- Is_Parameter should be set to True if the entity is known to be a - -- subprogram parameter. + -- gnatfind. If Symbol_Match is True, the entity will only be output if + -- the file name itself matches. Is_Parameter should be set to True if + -- the entity is known to be a subprogram parameter. procedure Add_Parent (Declaration : in out Declaration_Reference;