diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-10-29 12:03:27 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-10-29 12:03:27 +0100 |
commit | a5a809b2b9948b6b390d56d5a645b00b5e183c8a (patch) | |
tree | 6616e736e6245bfa07207817435e403b4e13eb41 /gcc | |
parent | 54f471f02471d0e135ad1d9683b89afe92ff3a15 (diff) | |
download | gcc-a5a809b2b9948b6b390d56d5a645b00b5e183c8a.zip gcc-a5a809b2b9948b6b390d56d5a645b00b5e183c8a.tar.gz gcc-a5a809b2b9948b6b390d56d5a645b00b5e183c8a.tar.bz2 |
[multiple changes]
2012-10-29 Robert Dewar <dewar@adacore.com>
* 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 <schonberg@adacore.com>
* sem_ch6.adb: Call Build_Subprogrm_Instance_Renamings only when
generating code.
2012-10-29 Robert Dewar <dewar@adacore.com>
* 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.
From-SVN: r192929
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/ada/exp_ch3.adb | 4 | ||||
-rw-r--r-- | gcc/ada/exp_ch9.adb | 2 | ||||
-rw-r--r-- | gcc/ada/gnat_ugn.texi | 19 | ||||
-rw-r--r-- | gcc/ada/sem_ch6.adb | 6 | ||||
-rw-r--r-- | gcc/ada/snames.adb-tmpl | 9 | ||||
-rw-r--r-- | gcc/ada/snames.ads-tmpl | 3 | ||||
-rw-r--r-- | gcc/ada/ug_words | 2 | ||||
-rw-r--r-- | gcc/ada/vms_data.ads | 4 | ||||
-rw-r--r-- | gcc/ada/xr_tabls.adb | 27 | ||||
-rw-r--r-- | gcc/ada/xr_tabls.ads | 7 |
11 files changed, 73 insertions, 26 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f6550b6..0793113 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,19 @@ +2012-10-29 Robert Dewar <dewar@adacore.com> + + * 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 <schonberg@adacore.com> + + * sem_ch6.adb: Call Build_Subprogrm_Instance_Renamings only when + generating code. + +2012-10-29 Robert Dewar <dewar@adacore.com> + + * 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 <gingold@adacore.com> * 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 83ae4e4..0e703da 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 f103e92..8ce3870 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 b94f035..1a38806 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 ffebc9b..37dc5be 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 e314d99..9255395 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 c187600..7987c8a 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 a3ca962..b1b45c4 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 c33bb8f..8c1c1eb 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 2bc2932..61ac675 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 9aa47bc..b328b82 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; |