diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-05-21 13:05:25 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-05-21 13:05:25 +0200 |
commit | 17cf9038e10e7b5249645d22621287ffb8280143 (patch) | |
tree | c4ae7b5f562ad64a46ade314191f1169ecc0f74d /gcc | |
parent | 632f2871edb2859c94d8fca573a1f74606a14332 (diff) | |
download | gcc-17cf9038e10e7b5249645d22621287ffb8280143.zip gcc-17cf9038e10e7b5249645d22621287ffb8280143.tar.gz gcc-17cf9038e10e7b5249645d22621287ffb8280143.tar.bz2 |
[multiple changes]
2014-05-21 Robert Dewar <dewar@adacore.com>
* gnat_ugn.texi: Clearly document -gnatw.g (GNAT warnings).
Clearly document -gnatyg (GNAT style switches).
* usage.adb: Add line line for -gnatw.g (GNAT warnings) More
detail for line for -gnatyg (GNAT style switches) -gnatw.d/D is
available for VMS after all.
* warnsw.adb: Reorganize to eliminate duplicated code
(Restore_Warnings): Add a couple of missing entries
(Save_Warnings): Add a couple of missing entries.
* warnsw.ads: Add missing entries to Warning_Record (not clear
what the impact is).
2014-05-21 Robert Dewar <dewar@adacore.com>
* errout.adb (Set_Msg_Insertion_Warning): Handle ?*? (restriction
warning) case.
* errout.ads: Document ?*? (restriction warning) insertion.
* erroutc.adb (Get_Warning_Tag): Deal with ?*? (restriction
warning) case.
* erroutc.ads: Document use of * for restriction warning tag.
* restrict.adb (Restriction_Msg): Tag with ?*? instead of ??.
2014-05-21 Ed Schonberg <schonberg@adacore.com>
* sem_ch9.adb (Push_Scope_And_Install_Discriminants): Do not
make discriminants immediately visible when analyzing an aspect
of a subtype declaration.
(Uninstall_Discriminants): Do not apply to the entity in a
subtype declaration.
From-SVN: r210693
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 31 | ||||
-rw-r--r-- | gcc/ada/errout.adb | 6 | ||||
-rw-r--r-- | gcc/ada/errout.ads | 19 | ||||
-rw-r--r-- | gcc/ada/erroutc.adb | 4 | ||||
-rw-r--r-- | gcc/ada/erroutc.ads | 20 | ||||
-rw-r--r-- | gcc/ada/gnat_ugn.texi | 14 | ||||
-rw-r--r-- | gcc/ada/restrict.adb | 4 | ||||
-rw-r--r-- | gcc/ada/sem_ch9.adb | 71 | ||||
-rw-r--r-- | gcc/ada/usage.adb | 21 | ||||
-rw-r--r-- | gcc/ada/warnsw.adb | 268 | ||||
-rw-r--r-- | gcc/ada/warnsw.ads | 4 |
11 files changed, 242 insertions, 220 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7e65a87..31891da8 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,34 @@ +2014-05-21 Robert Dewar <dewar@adacore.com> + + * gnat_ugn.texi: Clearly document -gnatw.g (GNAT warnings). + Clearly document -gnatyg (GNAT style switches). + * usage.adb: Add line line for -gnatw.g (GNAT warnings) More + detail for line for -gnatyg (GNAT style switches) -gnatw.d/D is + available for VMS after all. + * warnsw.adb: Reorganize to eliminate duplicated code + (Restore_Warnings): Add a couple of missing entries + (Save_Warnings): Add a couple of missing entries. + * warnsw.ads: Add missing entries to Warning_Record (not clear + what the impact is). + +2014-05-21 Robert Dewar <dewar@adacore.com> + + * errout.adb (Set_Msg_Insertion_Warning): Handle ?*? (restriction + warning) case. + * errout.ads: Document ?*? (restriction warning) insertion. + * erroutc.adb (Get_Warning_Tag): Deal with ?*? (restriction + warning) case. + * erroutc.ads: Document use of * for restriction warning tag. + * restrict.adb (Restriction_Msg): Tag with ?*? instead of ??. + +2014-05-21 Ed Schonberg <schonberg@adacore.com> + + * sem_ch9.adb (Push_Scope_And_Install_Discriminants): Do not + make discriminants immediately visible when analyzing an aspect + of a subtype declaration. + (Uninstall_Discriminants): Do not apply to the entity in a + subtype declaration. + 2014-05-21 Ed Schonberg <schonberg@adacore.com> * sem_util.adb: Code clean up. diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index b625589..897c11f 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- 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- -- @@ -2764,7 +2764,9 @@ package body Errout is elsif P + 1 <= Text'Last and then (Text (P) in 'a' .. 'z' or else - Text (P) in 'A' .. 'Z') + Text (P) in 'A' .. 'Z' + or else + Text (P) = '*') and then Text (P + 1) = C then Warning_Msg_Char := Text (P); diff --git a/gcc/ada/errout.ads b/gcc/ada/errout.ads index 2a91a13..8c561fb 100644 --- a/gcc/ada/errout.ads +++ b/gcc/ada/errout.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- 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- -- @@ -60,10 +60,12 @@ package Errout is -- Exception raised if Raise_Exception_On_Error is true Warning_Doc_Switch : Boolean renames Err_Vars.Warning_Doc_Switch; - -- If this is set True, then the ??/?x?/?X? sequences in error messages - -- are active (see errout.ads for details). If this switch is False, then - -- these sequences are ignored (i.e. simply equivalent to a single ?). The - -- -gnatw.d switch sets this flag True, -gnatw.D sets this flag False. + -- If this is set True, then the ??/?*?/?x?/?X? sequences in error messages + -- generate appropriate tags for the output error messages. If this switch + -- is False, then these sequences are still recognized (for the purposes + -- of implementing pragmas Warnings (Off,..) and Warning_As_Pragma(...) but + -- do not result in adding the error message tag. The -gnatw.d switch sets + -- this flag True, -gnatw.D sets this flag False. ----------------------------------- -- Suppression of Error Messages -- @@ -281,7 +283,7 @@ package Errout is -- messages, and the usual style is to include it, since it makes it -- clear that the continuation is part of a warning message. -- - -- Note: this usage is obsolete, use ??, ?x? or ?X? instead to specify + -- Note: this usage is obsolete, use ?? ?*? ?x? ?X? instead to specify -- the string to be added when Warn_Doc_Switch is set to True. If this -- switch is True, then for simple ? messages it has no effect. This -- simple form is to ease transition and will be removed later. @@ -302,6 +304,11 @@ package Errout is -- letter corresponding to the lower case letter x in the message. -- For continuations, use this on each continuation message. + -- Insertion character ?*? (restriction warning) + -- Like ?, but if the flag Warn_Doc_Switch is True, adds the string + -- "[restriction warning]" at the end of the warning message. For + -- continuations, use this on each continuation message. + -- Insertion character < (Less Than: conditional warning message) -- The character < appearing anywhere in a message is used for a -- conditional error message. If Error_Msg_Warn is True, then the diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb index 3f16702..5a7a11a 100644 --- a/gcc/ada/erroutc.adb +++ b/gcc/ada/erroutc.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- 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- -- @@ -310,6 +310,8 @@ package body Erroutc is if Warn and then Warn_Chr /= ' ' then if Warn_Chr = '?' then return "[enabled by default]"; + elsif Warn_Chr = '*' then + return "[restriction warning]"; elsif Warn_Chr in 'a' .. 'z' then return "[-gnatw" & Warn_Chr & ']'; else pragma Assert (Warn_Chr in 'A' .. 'Z'); diff --git a/gcc/ada/erroutc.ads b/gcc/ada/erroutc.ads index 5861128..03bc8c9 100644 --- a/gcc/ada/erroutc.ads +++ b/gcc/ada/erroutc.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- 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- -- @@ -64,10 +64,11 @@ package Erroutc is Warning_Msg_Char : Character; -- Warning character, valid only if Is_Warning_Msg is True - -- ' ' -- ? appeared on its own in message - -- '?' -- ?? appeared in message - -- 'x' -- ?x? appeared in message - -- 'X' -- ?x? appeared in message (X is upper case of x) + -- ' ' -- ? appeared on its own in message + -- '?' -- ?? appeared in message + -- 'x' -- ?x? appeared in message (x = a .. z) + -- 'X' -- ?X? appeared in message (X = A .. Z) + -- '*' -- ?*? appeared in message Is_Style_Msg : Boolean := False; -- Set True to indicate if the current message is a style message @@ -201,10 +202,11 @@ package Erroutc is Warn_Chr : Character; -- Warning character (note: set even if Warning_Doc_Switch is False) - -- ' ' -- ? appeared on its own in message or no ? in message - -- '?' -- ?? appeared in message - -- 'x' -- ?x? appeared in message - -- 'X' -- ?x? appeared in message (X is upper case of x) + -- ' ' -- ? appeared on its own in message + -- '?' -- ?? appeared in message + -- 'x' -- ?x? appeared in message (x = a .. z) + -- 'X' -- ?X? appeared in message (X = A .. Z) + -- '*' -- ?*? appeared in message Style : Boolean; -- True if style message (starts with "(style)") diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 4912c97..f2ebbcb46 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -4018,7 +4018,7 @@ Internal GNAT implementation mode. This should not be used for applications programs, it is intended only for use by the compiler and its run-time library. For documentation, see the GNAT sources. Note that @option{^-gnatg^/GNAT_INTERNAL^} implies -@option{^-gnatwae^/WARNINGS=ALL,ERRORS^} and +@option{^-gnatw.ge^/WARNINGS=GNAT,ERRORS^} and @option{^-gnatyg^/STYLE_CHECKS=GNAT^} so that all standard warnings and all standard style options are turned on. All warnings and style messages are treated as errors. @@ -5167,6 +5167,14 @@ Manual requirement that such warnings appear). @cindex @option{-gnatwG} (@command{gcc}) This switch suppresses warnings for unrecognized pragmas. +@item -gnatw.g +@emph{Warnings used for GNAT sources} +@cindex @option{-gnatw.g} (@command{gcc}) +This switch sets the warning categories that are used by the standard +GNAT style. Currently this is equivalent to +@option{-gnatwAao.sI.C.V.X} +but more warnings may be added in the future without advanced notice. + @item -gnatwh @emph{Activate warnings on hiding.} @cindex @option{-gnatwh} (@command{gcc}) @@ -6381,7 +6389,9 @@ in the source text. @emph{GNAT style mode.} The set of style check switches is set to match that used by the GNAT sources. This may be useful when developing code that is eventually intended to be -incorporated into GNAT. For further details, see GNAT sources. +incorporated into GNAT. Currently this is equivalent to @option{-gnatwydISux}) +but additional style switches may be added to this set in the future without +advance notice. @item ^h^HTABS^ @emph{No horizontal tabs.} diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb index 01cd907..abf294a 100644 --- a/gcc/ada/restrict.adb +++ b/gcc/ada/restrict.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- 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- -- @@ -1047,7 +1047,7 @@ package body Restrict is -- Set warning message if warning if Restriction_Warnings (R) then - Add_Str ("??"); + Add_Str ("?*?"); -- If real violation (not warning), then mark it as non-serious unless -- it is a violation of No_Finalization in which case we leave it as a diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index 1e2e832..7559930 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- 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- -- @@ -3447,7 +3447,13 @@ package body Sem_Ch9 is begin if Has_Discriminants (E) then Push_Scope (E); - Install_Discriminants (E); + + -- Make discriminants visible for type declarations and protected + -- type declarations, not for subtype declarations (RM 13.1.1 (12/3)) + + if Nkind (Parent (E)) /= N_Subtype_Declaration then + Install_Discriminants (E); + end if; end if; end Push_Scope_And_Install_Discriminants; @@ -3461,40 +3467,45 @@ package body Sem_Ch9 is Outer : Entity_Id; begin - Disc := First_Discriminant (E); - while Present (Disc) loop - if Disc /= Current_Entity (Disc) then - Prev := Current_Entity (Disc); - while Present (Prev) - and then Present (Homonym (Prev)) - and then Homonym (Prev) /= Disc - loop - Prev := Homonym (Prev); - end loop; - else - Prev := Empty; - end if; + -- Discriminants have been made visible for type declarations and + -- protected type declarations, not for subtype declarations. + + if Nkind (Parent (E)) /= N_Subtype_Declaration then + Disc := First_Discriminant (E); + while Present (Disc) loop + if Disc /= Current_Entity (Disc) then + Prev := Current_Entity (Disc); + while Present (Prev) + and then Present (Homonym (Prev)) + and then Homonym (Prev) /= Disc + loop + Prev := Homonym (Prev); + end loop; + else + Prev := Empty; + end if; - Set_Is_Immediately_Visible (Disc, False); + Set_Is_Immediately_Visible (Disc, False); - Outer := Homonym (Disc); - while Present (Outer) and then Scope (Outer) = E loop - Outer := Homonym (Outer); - end loop; + Outer := Homonym (Disc); + while Present (Outer) and then Scope (Outer) = E loop + Outer := Homonym (Outer); + end loop; - -- Reset homonym link of other entities, but do not modify link - -- between entities in current scope, so that the back-end can have - -- a proper count of local overloadings. + -- Reset homonym link of other entities, but do not modify link + -- between entities in current scope, so that the back-end can + -- have a proper count of local overloadings. - if No (Prev) then - Set_Name_Entity_Id (Chars (Disc), Outer); + if No (Prev) then + Set_Name_Entity_Id (Chars (Disc), Outer); - elsif Scope (Prev) /= Scope (Disc) then - Set_Homonym (Prev, Outer); - end if; + elsif Scope (Prev) /= Scope (Disc) then + Set_Homonym (Prev, Outer); + end if; - Next_Discriminant (Disc); - end loop; + Next_Discriminant (Disc); + end loop; + end if; end Uninstall_Discriminants; ------------------------------------------- diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb index 99fb652..4516bb2 100644 --- a/gcc/ada/usage.adb +++ b/gcc/ada/usage.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- 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- -- @@ -121,8 +121,8 @@ begin Write_Eol; -- Individual lines for switches. Write_Switch_Char outputs fourteen - -- characters, so the remaining message is allowed to be a maximum - -- of 65 characters to be comfortable in an 80 character window. + -- characters, so the remaining message is allowed to be a maximum of + -- 65 characters to be comfortable in an 80 character window. -- Line for -gnata switch @@ -494,16 +494,8 @@ begin Write_Line (" .C* turn off warnings for unrepped components"); Write_Line (" d turn on warnings for implicit dereference"); Write_Line (" D* turn off warnings for implicit dereference"); - - -- Switches -gnatw.d/w.D not available on VMS - - if not OpenVMS_On_Target then - Write_Line - (" .d turn on tagging of warnings with -gnatw switch"); - Write_Line - (" .D* turn off tagging of warnings with -gnatw switch"); - end if; - + Write_Line (" .d turn on tagging of warnings with -gnatw switch"); + Write_Line (" .D* turn off tagging of warnings with -gnatw switch"); Write_Line (" e treat all warnings (but not info) as errors"); Write_Line (" .e turn on every optional info/warning " & "(no exceptions)"); @@ -511,6 +503,7 @@ begin Write_Line (" F* turn off warnings for unreferenced formal"); Write_Line (" g*+ turn on warnings for unrecognized pragma"); Write_Line (" G turn off warnings for unrecognized pragma"); + Write_Line (" .g turn on GNAT warnings, same as Aao.sI.C.V.X"); Write_Line (" h turn on warnings for hiding declarations"); Write_Line (" H* turn off warnings for hiding declarations"); Write_Line (" .h turn on warnings for holes in records"); @@ -640,7 +633,7 @@ begin Write_Line (" d check no DOS line terminators"); Write_Line (" e check end/exit labels present"); Write_Line (" f check no form feeds/vertical tabs in source"); - Write_Line (" g check standard GNAT style rules"); + Write_Line (" g check standard GNAT style rules, same as ydISux"); Write_Line (" h check no horizontal tabs in source"); Write_Line (" i check if-then layout"); Write_Line (" I check mode in"); diff --git a/gcc/ada/warnsw.adb b/gcc/ada/warnsw.adb index f07fdf9..9691c10 100644 --- a/gcc/ada/warnsw.adb +++ b/gcc/ada/warnsw.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1999-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 1999-2014, Free Software Foundation, Inc. -- -- -- -- 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- -- @@ -29,6 +29,65 @@ with Output; use Output; package body Warnsw is + -- Local Subprograms + + procedure All_Warnings (Setting : Boolean); + -- Sets all warnings off if Setting = False, and on if Setting = True + + procedure WA_Warnings; + -- Turn on all warnings set by -gnatwa (also used by -gnatw.g) + + ------------------ + -- All_Warnings -- + ------------------ + + procedure All_Warnings (Setting : Boolean) is + begin + Address_Clause_Overlay_Warnings := Setting; + Check_Unreferenced := Setting; + Check_Unreferenced_Formals := Setting; + Check_Withs := Setting; + Constant_Condition_Warnings := Setting; + Elab_Warnings := Setting; + Implementation_Unit_Warnings := Setting; + Ineffective_Inline_Warnings := Setting; + List_Body_Required_Info := Setting; + List_Inherited_Aspects := Setting; + Warn_On_Ada_2005_Compatibility := Setting; + Warn_On_Ada_2012_Compatibility := Setting; + Warn_On_All_Unread_Out_Parameters := Setting; + Warn_On_Assertion_Failure := Setting; + Warn_On_Assumed_Low_Bound := Setting; + Warn_On_Atomic_Synchronization := Setting; + Warn_On_Bad_Fixed_Value := Setting; + Warn_On_Biased_Representation := Setting; + Warn_On_Constant := Setting; + Warn_On_Deleted_Code := Setting; + Warn_On_Dereference := Setting; + Warn_On_Export_Import := Setting; + Warn_On_Hiding := Setting; + Warn_On_Modified_Unread := Setting; + Warn_On_No_Value_Assigned := Setting; + Warn_On_Non_Local_Exception := Setting; + Warn_On_Object_Renames_Function := Setting; + Warn_On_Obsolescent_Feature := Setting; + Warn_On_Overlap := Setting; + Warn_On_Overridden_Size := Setting; + Warn_On_Parameter_Order := Setting; + Warn_On_Questionable_Missing_Parens := Setting; + Warn_On_Record_Holes := Setting; + Warn_On_Redundant_Constructs := Setting; + Warn_On_Reverse_Bit_Order := Setting; + Warn_On_Standard_Redefinition := Setting; + Warn_On_Suspicious_Contract := Setting; + Warn_On_Suspicious_Modulus_Value := Setting; + Warn_On_Unchecked_Conversion := Setting; + Warn_On_Unordered_Enumeration_Type := Setting; + Warn_On_Unrecognized_Pragma := Setting; + Warn_On_Unrepped_Components := Setting; + Warn_On_Warnings_Off := Setting; + end All_Warnings; + ---------------------- -- Restore_Warnings -- ---------------------- @@ -57,6 +116,8 @@ package body Warnsw is W.List_Body_Required_Info; List_Inherited_Aspects := W.List_Inherited_Aspects; + No_Warn_On_Non_Local_Exception := + W.No_Warn_On_Non_Local_Exception; Warning_Doc_Switch := W.Warning_Doc_Switch; Warn_On_Ada_2005_Compatibility := @@ -155,6 +216,8 @@ package body Warnsw is List_Body_Required_Info; W.List_Inherited_Aspects := List_Inherited_Aspects; + W.No_Warn_On_Non_Local_Exception := + No_Warn_On_Non_Local_Exception; W.Warning_Doc_Switch := Warning_Doc_Switch; W.Warn_On_Ada_2005_Compatibility := @@ -221,7 +284,6 @@ package body Warnsw is Warn_On_Unrepped_Components; W.Warn_On_Warnings_Off := Warn_On_Warnings_Off; - return W; end Save_Warnings; @@ -257,48 +319,7 @@ package body Warnsw is Warning_Doc_Switch := False; when 'e' => - Address_Clause_Overlay_Warnings := True; - Check_Unreferenced := True; - Check_Unreferenced_Formals := True; - Check_Withs := True; - Constant_Condition_Warnings := True; - Elab_Warnings := True; - Implementation_Unit_Warnings := True; - Ineffective_Inline_Warnings := True; - List_Body_Required_Info := True; - List_Inherited_Aspects := True; - Warn_On_Ada_2005_Compatibility := True; - Warn_On_Ada_2012_Compatibility := True; - Warn_On_All_Unread_Out_Parameters := True; - Warn_On_Assertion_Failure := True; - Warn_On_Assumed_Low_Bound := True; - Warn_On_Atomic_Synchronization := True; - Warn_On_Bad_Fixed_Value := True; - Warn_On_Biased_Representation := True; - Warn_On_Constant := True; - Warn_On_Deleted_Code := True; - Warn_On_Dereference := True; - Warn_On_Export_Import := True; - Warn_On_Hiding := True; - Warn_On_Modified_Unread := True; - Warn_On_No_Value_Assigned := True; - Warn_On_Non_Local_Exception := True; - Warn_On_Object_Renames_Function := True; - Warn_On_Obsolescent_Feature := True; - Warn_On_Overlap := True; - Warn_On_Overridden_Size := True; - Warn_On_Parameter_Order := True; - Warn_On_Questionable_Missing_Parens := True; - Warn_On_Record_Holes := True; - Warn_On_Redundant_Constructs := True; - Warn_On_Reverse_Bit_Order := True; - Warn_On_Standard_Redefinition := True; - Warn_On_Suspicious_Contract := True; - Warn_On_Unchecked_Conversion := True; - Warn_On_Unordered_Enumeration_Type := True; - Warn_On_Unrecognized_Pragma := True; - Warn_On_Unrepped_Components := True; - Warn_On_Warnings_Off := True; + All_Warnings (True); when 'g' => Set_GNAT_Mode_Warnings; @@ -417,48 +438,23 @@ package body Warnsw is procedure Set_GNAT_Mode_Warnings is begin + -- Set -gnatwa warnings and no others + + All_Warnings (False); + WA_Warnings; + + -- These warnings are added to the -gnatwa set + Address_Clause_Overlay_Warnings := True; - Check_Unreferenced := True; - Check_Unreferenced_Formals := True; - Check_Withs := True; - Constant_Condition_Warnings := True; - Elab_Warnings := False; + Warn_On_Overridden_Size := True; + + -- These warnings are removed from the -gnatwa set + Implementation_Unit_Warnings := False; - Ineffective_Inline_Warnings := True; - List_Body_Required_Info := False; - List_Inherited_Aspects := False; - Warning_Doc_Switch := False; - Warn_On_Ada_2005_Compatibility := True; - Warn_On_Ada_2012_Compatibility := True; - Warn_On_All_Unread_Out_Parameters := False; - Warn_On_Assertion_Failure := True; - Warn_On_Assumed_Low_Bound := True; - Warn_On_Atomic_Synchronization := False; - Warn_On_Bad_Fixed_Value := True; - Warn_On_Biased_Representation := True; - Warn_On_Constant := True; - Warn_On_Deleted_Code := False; - Warn_On_Dereference := False; - Warn_On_Export_Import := True; - Warn_On_Hiding := False; - Warn_On_Modified_Unread := True; - Warn_On_No_Value_Assigned := True; Warn_On_Non_Local_Exception := False; - Warn_On_Object_Renames_Function := True; - Warn_On_Obsolescent_Feature := True; - Warn_On_Overlap := True; - Warn_On_Overridden_Size := True; - Warn_On_Parameter_Order := True; - Warn_On_Questionable_Missing_Parens := True; - Warn_On_Record_Holes := False; - Warn_On_Redundant_Constructs := True; + No_Warn_On_Non_Local_Exception := True; Warn_On_Reverse_Bit_Order := False; - Warn_On_Suspicious_Contract := True; - Warn_On_Unchecked_Conversion := True; - Warn_On_Unordered_Enumeration_Type := False; - Warn_On_Unrecognized_Pragma := True; Warn_On_Unrepped_Components := False; - Warn_On_Warnings_Off := False; end Set_GNAT_Mode_Warnings; ------------------------ @@ -469,80 +465,10 @@ package body Warnsw is begin case C is when 'a' => - Check_Unreferenced := True; - Check_Unreferenced_Formals := True; - Check_Withs := True; - Constant_Condition_Warnings := True; - Implementation_Unit_Warnings := True; - Ineffective_Inline_Warnings := True; - Warn_On_Ada_2005_Compatibility := True; - Warn_On_Ada_2012_Compatibility := True; - Warn_On_Assertion_Failure := True; - Warn_On_Assumed_Low_Bound := True; - Warn_On_Bad_Fixed_Value := True; - Warn_On_Biased_Representation := True; - Warn_On_Constant := True; - Warn_On_Export_Import := True; - Warn_On_Modified_Unread := True; - Warn_On_No_Value_Assigned := True; - Warn_On_Non_Local_Exception := True; - Warn_On_Object_Renames_Function := True; - Warn_On_Obsolescent_Feature := True; - Warn_On_Overlap := True; - Warn_On_Parameter_Order := True; - Warn_On_Questionable_Missing_Parens := True; - Warn_On_Redundant_Constructs := True; - Warn_On_Reverse_Bit_Order := True; - Warn_On_Suspicious_Contract := True; - Warn_On_Unchecked_Conversion := True; - Warn_On_Unrecognized_Pragma := True; - Warn_On_Unrepped_Components := True; + WA_Warnings; when 'A' => - Address_Clause_Overlay_Warnings := False; - Check_Unreferenced := False; - Check_Unreferenced_Formals := False; - Check_Withs := False; - Constant_Condition_Warnings := False; - Elab_Warnings := False; - Implementation_Unit_Warnings := False; - Ineffective_Inline_Warnings := False; - List_Body_Required_Info := False; - List_Inherited_Aspects := False; - Warning_Doc_Switch := False; - Warn_On_Ada_2005_Compatibility := False; - Warn_On_Ada_2012_Compatibility := False; - Warn_On_All_Unread_Out_Parameters := False; - Warn_On_Assertion_Failure := False; - Warn_On_Assumed_Low_Bound := False; - Warn_On_Bad_Fixed_Value := False; - Warn_On_Biased_Representation := False; - Warn_On_Constant := False; - Warn_On_Deleted_Code := False; - Warn_On_Dereference := False; - Warn_On_Export_Import := False; - Warn_On_Hiding := False; - Warn_On_Modified_Unread := False; - Warn_On_No_Value_Assigned := False; - Warn_On_Non_Local_Exception := False; - Warn_On_Object_Renames_Function := False; - Warn_On_Obsolescent_Feature := False; - Warn_On_Overlap := False; - Warn_On_Overridden_Size := False; - Warn_On_Parameter_Order := False; - Warn_On_Record_Holes := False; - Warn_On_Questionable_Missing_Parens := False; - Warn_On_Redundant_Constructs := False; - Warn_On_Reverse_Bit_Order := False; - Warn_On_Standard_Redefinition := False; - Warn_On_Suspicious_Contract := False; - Warn_On_Suspicious_Modulus_Value := False; - Warn_On_Unchecked_Conversion := False; - Warn_On_Unordered_Enumeration_Type := False; - Warn_On_Unrecognized_Pragma := False; - Warn_On_Unrepped_Components := False; - Warn_On_Warnings_Off := False; - + All_Warnings (False); No_Warn_On_Non_Local_Exception := True; when 'b' => @@ -704,4 +630,40 @@ package body Warnsw is return True; end Set_Warning_Switch; + ----------------- + -- WA_Warnings -- + ----------------- + + procedure WA_Warnings is + begin + Check_Unreferenced := True; + Check_Unreferenced_Formals := True; + Check_Withs := True; + Constant_Condition_Warnings := True; + Implementation_Unit_Warnings := True; + Ineffective_Inline_Warnings := True; + Warn_On_Ada_2005_Compatibility := True; + Warn_On_Ada_2012_Compatibility := True; + Warn_On_Assertion_Failure := True; + Warn_On_Assumed_Low_Bound := True; + Warn_On_Bad_Fixed_Value := True; + Warn_On_Biased_Representation := True; + Warn_On_Constant := True; + Warn_On_Export_Import := True; + Warn_On_Modified_Unread := True; + Warn_On_No_Value_Assigned := True; + Warn_On_Non_Local_Exception := True; + Warn_On_Object_Renames_Function := True; + Warn_On_Obsolescent_Feature := True; + Warn_On_Overlap := True; + Warn_On_Parameter_Order := True; + Warn_On_Questionable_Missing_Parens := True; + Warn_On_Redundant_Constructs := True; + Warn_On_Reverse_Bit_Order := True; + Warn_On_Suspicious_Contract := True; + Warn_On_Unchecked_Conversion := True; + Warn_On_Unrecognized_Pragma := True; + Warn_On_Unrepped_Components := True; + end WA_Warnings; + end Warnsw; diff --git a/gcc/ada/warnsw.ads b/gcc/ada/warnsw.ads index fd6027b..89c5fb1 100644 --- a/gcc/ada/warnsw.ads +++ b/gcc/ada/warnsw.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1999-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 1999-2014, Free Software Foundation, Inc. -- -- -- -- 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- -- @@ -71,6 +71,7 @@ package Warnsw is Ineffective_Inline_Warnings : Boolean; List_Body_Required_Info : Boolean; List_Inherited_Aspects : Boolean; + No_Warn_On_Non_Local_Exception : Boolean; Warning_Doc_Switch : Boolean; Warn_On_Ada_2005_Compatibility : Boolean; Warn_On_Ada_2012_Compatibility : Boolean; @@ -99,6 +100,7 @@ package Warnsw is Warn_On_Reverse_Bit_Order : Boolean; Warn_On_Standard_Redefinition : Boolean; Warn_On_Suspicious_Contract : Boolean; + Warn_On_Suspicious_Modulus_Value : Boolean; Warn_On_Unchecked_Conversion : Boolean; Warn_On_Unordered_Enumeration_Type : Boolean; Warn_On_Unrecognized_Pragma : Boolean; |