]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/ada/err_vars.ads
[Ada] Bump copyright year
[thirdparty/gcc.git] / gcc / ada / err_vars.ads
index c4c28dafc365fc549b6da6841dcda43f222356c4..7afe70512ffc3beb0aed73d4c68cedd37f0c14d4 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2009, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2020, 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- --
@@ -35,28 +35,15 @@ package Err_Vars is
    --  All of these variables are set when needed, so they do not need to be
    --  initialized. However, there is code that saves and restores existing
    --  values, which may malfunction in -gnatVa mode if the variable has never
-   --  been iniitalized, so we initialize some variables to avoid exceptions
+   --  been initialized, so we initialize some variables to avoid exceptions
    --  from invalid values in such cases.
 
-   ------------------
-   -- Error Counts --
-   ------------------
-
-   Serious_Errors_Detected : Nat := 0;
-   --  This is a count of errors that are serious enough to stop expansion,
-   --  and hence to prevent generation of an object file even if the
-   --  switch -gnatQ is set. Initialized to zero at the start of compilation.
-   --  Initialized for -gnatVa use, see comment above.
-
-   Total_Errors_Detected : Nat := 0;
-   --  Number of errors detected so far. Includes count of serious errors and
-   --  non-serious errors, so this value is always greater than or equal to the
-   --  Serious_Errors_Detected value. Initialized to zero at the start of
-   --  compilation. Initialized for -gnatVa use, see comment above.
-
-   Warnings_Detected : Nat := 0;
-   --  Number of warnings detected. Initialized to zero at the start of
-   --  compilation. Initialized for -gnatVa use, see comment above.
+   --  Note on error counts (Serious_Errors_Detected, Total_Errors_Detected,
+   --  Warnings_Detected, Warning_Info_Messages, Report_Info_Messages). These
+   --  counts might more logically appear in this unit, but we place them
+   --  instead in atree.ads, because of licensing issues. We need to be able
+   --  to access these counts from units that have the more general licensing
+   --  conditions.
 
    ----------------------------------
    -- Error Message Mode Variables --
@@ -68,10 +55,10 @@ package Err_Vars is
    --  variables are not reset by calls to the error message routines, so the
    --  caller is responsible for resetting the default behavior after use.
 
-   Error_Msg_Qual_Level : Int;
+   Error_Msg_Qual_Level : Nat := 0;
    --  Number of levels of qualification required for type name (see the
    --  description of the } insertion character. Note that this value does
-   --  note get reset by any Error_Msg call, so the caller is responsible
+   --  not get reset by any Error_Msg call, so the caller is responsible
    --  for resetting it.
 
    Warn_On_Instance : Boolean := False;
@@ -94,7 +81,7 @@ package Err_Vars is
    Error_Msg_Exception : exception;
    --  Exception raised if Raise_Exception_On_Error is true
 
-   Current_Error_Source_File : Source_File_Index := Internal_Source_File;
+   Current_Error_Source_File : Source_File_Index := No_Source_File;
    --  Id of current messages. Used to post file name when unit changes. This
    --  is initialized to Main_Source_File at the start of a compilation, which
    --  means that no file names will be output unless there are errors in units
@@ -102,6 +89,12 @@ 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;
+   --  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.
+
    ----------------------------------------
    -- Error Message Insertion Parameters --
    ----------------------------------------
@@ -120,6 +113,8 @@ package Err_Vars is
    Error_Msg_Uint_2 : Uint;
    --  Uint values for ^ insertion characters in message
 
+   --  WARNING: There is a matching C declaration of these variables in fe.h
+
    Error_Msg_Sloc : Source_Ptr;
    --  Source location for # insertion character in message
 
@@ -143,7 +138,13 @@ package Err_Vars is
 
    Error_Msg_Warn : Boolean;
    --  Used if current message contains a < insertion character to indicate
-   --  if the current message is a warning message.
+   --  if the current message is a warning message. Must be set appropriately
+   --  before any call to Error_Msg_xxx with a < insertion character present.
+   --  Setting is irrelevant if no < insertion character is present. Note
+   --  that it is not necessary to reset this after using it, since the proper
+   --  procedure is always to set it before issuing such a message. Note that
+   --  the warning documentation tag is always [enabled by default] in the
+   --  case where this flag is True.
 
    Error_Msg_String : String (1 .. 4096);
    Error_Msg_Strlen : Natural;