public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1681] [Ada] Make -gnatU and -gnatw.d the default
@ 2021-06-21 11:05 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-06-21 11:05 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:805f081980883d3c4fd3b90dc3baadd529c86839

commit r12-1681-g805f081980883d3c4fd3b90dc3baadd529c86839
Author: Ghjuvan Lacambre <lacambre@adacore.com>
Date:   Wed Feb 10 15:52:34 2021 +0100

    [Ada] Make -gnatU and -gnatw.d the default
    
    gcc/ada/
    
            * debug.adb: Document -gnatd_U as taken.
            * err_vars.ads (Warning_Doc_Switch): Set to True.
            * errout.ads (Errout): Update documentation.
            * gnat1drv.adb (Adjust_Global_Switches): React to -gnatd_U.
            * hostparm.ads (Tag_Errors): Set to True.
            * opt.ads (Unique_Error_Tag): Document -gnatd_U.

Diff:
---
 gcc/ada/debug.adb    | 5 ++++-
 gcc/ada/err_vars.ads | 2 +-
 gcc/ada/errout.ads   | 2 +-
 gcc/ada/gnat1drv.adb | 6 ++++++
 gcc/ada/hostparm.ads | 5 +++--
 gcc/ada/opt.ads      | 3 ++-
 6 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb
index 0694f23647c..3f1fa55932a 100644
--- a/gcc/ada/debug.adb
+++ b/gcc/ada/debug.adb
@@ -186,7 +186,7 @@ package body Debug is
    --  d_R
    --  d_S
    --  d_T  Output trace information on invocation path recording
-   --  d_U
+   --  d_U  Disable prepending messages with "error:".
    --  d_V  Enable verifications on the expanded tree
    --  d_W
    --  d_X
@@ -1017,6 +1017,9 @@ package body Debug is
    --  d_T  The compiler outputs trace information to standard output whenever
    --       an invocation path is recorded.
 
+   --  d_U  Disable prepending 'error:' to error messages. This used to be the
+   --       default and can be seen as the opposite of -gnatU.
+
    --  d_V  Enable verification of the expanded code before calling the backend
    --       and generate error messages on each inconsistency found.
 
diff --git a/gcc/ada/err_vars.ads b/gcc/ada/err_vars.ads
index 0dd7c7ff316..366df629d74 100644
--- a/gcc/ada/err_vars.ads
+++ b/gcc/ada/err_vars.ads
@@ -89,7 +89,7 @@ package Err_Vars is
    --  Source_Reference line, then this is initialized to No_Source_File,
    --  to force an initial reference to the real source file name.
 
-   Warning_Doc_Switch : Boolean := False;
+   Warning_Doc_Switch : Boolean := True;
    --  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
diff --git a/gcc/ada/errout.ads b/gcc/ada/errout.ads
index 0a4ad621f5f..1e34bc52b33 100644
--- a/gcc/ada/errout.ads
+++ b/gcc/ada/errout.ads
@@ -519,7 +519,7 @@ package Errout is
    --  The prefixes error and warning are supplied automatically (depending
    --  on the use of the ? insertion character), and the call to the error
    --  message routine supplies the text. The "error: " prefix is omitted
-   --  in brief error message formats.
+   --  if -gnatd_U is among the options given to gnat.
 
    --  Reserved Ada keywords in the message are in the default keyword case
    --  (determined from the given source program), surrounded by quotation
diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb
index 7177533df5a..59b9595cf2f 100644
--- a/gcc/ada/gnat1drv.adb
+++ b/gcc/ada/gnat1drv.adb
@@ -153,6 +153,12 @@ procedure Gnat1drv is
 
       Map_Pragma_Name (From => Name_Gnat_Annotate, To => Name_Annotate);
 
+      --  -gnatd_U disables prepending error messages with "error:"
+
+      if Debug_Flag_Underscore_UU then
+         Unique_Error_Tag := False;
+      end if;
+
       --  -gnatd.M enables Relaxed_RM_Semantics
 
       if Debug_Flag_Dot_MM then
diff --git a/gcc/ada/hostparm.ads b/gcc/ada/hostparm.ads
index da0fbe40ae1..4d128ccdb20 100644
--- a/gcc/ada/hostparm.ads
+++ b/gcc/ada/hostparm.ads
@@ -56,9 +56,10 @@ package Hostparm is
    --  of file names in the library, must be at least Max_Line_Length, but
    --  can be larger.
 
-   Tag_Errors : constant Boolean := False;
+   Tag_Errors : constant Boolean := True;
    --  If set to true, then brief form error messages will be prefaced by
-   --  the string "error:". Used as default for Opt.Unique_Error_Tag.
+   --  the string "error:". Used as default for Opt.Unique_Error_Tag. Disabled
+   --  by gnatd_U.
 
    Exclude_Missing_Objects : constant Boolean := True;
    --  If set to true, gnatbind will exclude from consideration all
diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads
index 827bbeff9c9..99626e965d0 100644
--- a/gcc/ada/opt.ads
+++ b/gcc/ada/opt.ads
@@ -1651,7 +1651,8 @@ package Opt is
    Unique_Error_Tag : Boolean := Tag_Errors;
    --  GNAT
    --  Indicates if error messages are to be prefixed by the string error:
-   --  Initialized from Tag_Errors, can be forced on with the -gnatU switch.
+   --  Initialized from Tag_Errors, can be forced on with the -gnatU switch and
+   --  disabled with -gnatd_U.
 
    Unnest_Subprogram_Mode : Boolean := False;
    --  If true, activates the circuitry for unnesting subprograms (see the spec


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-21 11:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21 11:05 [gcc r12-1681] [Ada] Make -gnatU and -gnatw.d the default Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).