Patchwork [Ada] Follow on work for tagging of warning switches

login
register
mail settings
Submitter Arnaud Charlet
Date Jan. 4, 2013, 9:29 a.m.
Message ID <20130104092907.GA32741@adacore.com>
Download mbox | patch
Permalink /patch/209419/
State New
Headers show

Comments

Arnaud Charlet - Jan. 4, 2013, 9:29 a.m.
Correct some missing cases of setting this switch, document it in
usage. Primarily documentation, so no new test needed. Also makes
clear that this switch is not available in VMS. No test needed.

Tested on x86_64-pc-linux-gnu, committed on trunk

2013-01-04  Robert Dewar  <dewar@adacore.com>

	* gnat_ugn.texi: Document -gnatw.d/w.D (does no apply in VMS mode).
	* usage.adb: Add lines for -gnatw.d/w.D switches.
	* warnsw.adb: Minor fixes (some missing cases of setting
	Warning_Doc_Switch). Reject -gnatw.d and -gnatw.D in VMS mode.

Patch

Index: usage.adb
===================================================================
--- usage.adb	(revision 194894)
+++ usage.adb	(working copy)
@@ -474,6 +474,16 @@ 
    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 ("        e    treat all warnings (but not info) as errors");
    Write_Line ("        .e   turn on every optional info/warning " &
                                                   "(no exceptions)");
Index: gnat_ugn.texi
===================================================================
--- gnat_ugn.texi	(revision 194889)
+++ gnat_ugn.texi	(working copy)
@@ -5214,6 +5214,9 @@ 
 switch are
 @option{-gnatwd} (implicit dereferencing),
 @option{-gnatwh} (hiding),
+@ifclear VMS
+@option{-gnatw.d} (tag warnings with -gnatw switch)
+@end ifclear
 @option{-gnatw.h} (holes (gaps) in record layouts)
 @option{-gnatw.i} (overlapping actuals),
 @option{-gnatw.k} (redefinition of names in standard),
@@ -5362,6 +5365,24 @@ 
 This switch suppresses warnings for implicit dereferences in
 indexed components, slices, and selected components.
 
+@ifclear vms
+@item -gnatw.d
+@emph{Activate tagging of warning messages.}
+@cindex @option{-gnatw.d} (@command{gcc})
+If this switch is set, then warning messages are tagged, either with
+the string ``@option{-gnatw?}'' showing which switch controls the warning,
+or with ``[enabled by default]'' if the warning is not under control of a
+specific @option{-gnatw?} switch. This mode is off by default, and is not
+affected by the use of @code{-gnatwa}.
+
+@item -gnatw.D
+@emph{Deactivate tagging of warning messages.}
+@cindex @option{-gnatw.d} (@command{gcc})
+If this switch is set, then warning messages return to the default
+mode in which warnings are not tagged as described above for
+@code{-gnatw.d}.
+@end ifclear
+
 @item -gnatwe
 @emph{Treat warnings and style checks as errors.}
 @cindex @option{-gnatwe} (@command{gcc})
Index: warnsw.adb
===================================================================
--- warnsw.adb	(revision 194841)
+++ warnsw.adb	(working copy)
@@ -53,11 +53,19 @@ 
             Warn_On_Unrepped_Components         := False;
 
          when 'd' =>
-            Warning_Doc_Switch                     := True;
+            if Open_VMS_On_Target then
+               return False;
+            end if;
 
+            Warning_Doc_Switch                  := True;
+
          when 'D' =>
-            Warning_Doc_Switch                     := False;
+            if Open_VMS_On_Target then
+               return False;
+            end if;
 
+            Warning_Doc_Switch                  := False;
+
          when 'e' =>
             Address_Clause_Overlay_Warnings     := True;
             Check_Unreferenced                  := True;
@@ -68,6 +76,7 @@ 
             Implementation_Unit_Warnings        := True;
             Ineffective_Inline_Warnings         := True;
             List_Inherited_Aspects              := True;
+            Warning_Doc_Switch                  := True;
             Warn_On_Ada_2005_Compatibility      := True;
             Warn_On_Ada_2012_Compatibility      := True;
             Warn_On_All_Unread_Out_Parameters   := True;
@@ -217,6 +226,7 @@ 
       Implementation_Unit_Warnings        := False;
       Ineffective_Inline_Warnings         := True;
       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;
@@ -296,6 +306,7 @@ 
             Implementation_Unit_Warnings        := False;
             Ineffective_Inline_Warnings         := 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;