diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-02-15 09:36:02 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-02-15 09:36:02 +0000 |
commit | 8c9f4284af628ca41726e4ad866fae02099a5893 (patch) | |
tree | 105ad500b107811fbbfd7ea9e65b8eda6afed5b4 /gcc/ada/err_vars.ads | |
parent | 87d5c1d0a1c4aff8c479ddd4f39e54b35cb021ec (diff) | |
download | gcc-8c9f4284af628ca41726e4ad866fae02099a5893.tar.gz |
2006-02-13 Robert Dewar <dewar@adacore.com>
Eric Botcazou <ebotcazou@adacore.com>
* err_vars.ads: Suppress range checks for a couple of assignments
which otherwise cause validity checks with validity checking turned on.
Update comments.
* errout.adb (Error_Msg_Internal): Do not suppress warning messages.
Make message unconditional if it is a warning.
(Error_Msg_NEL): Always output warning messages.
Suppress range checks for a couple of assignments which otherwise
cause validity checks with validity checking turned on.
* errout.ads (Message Insertion Characters): Document that '!' is
implied by '?' in error messages.
* gnat1drv.adb: (Bad_Body): Remove '!' in warning message.
(Gnat1drv): Use a goto to end of main subprogram instead of
Exit_Program (E_Success) so that finalization can occur normally.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111049 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/err_vars.ads')
-rw-r--r-- | gcc/ada/err_vars.ads | 89 |
1 files changed, 53 insertions, 36 deletions
diff --git a/gcc/ada/err_vars.ads b/gcc/ada/err_vars.ads index 1abc4acbe12..66a33fa9d10 100644 --- a/gcc/ada/err_vars.ads +++ b/gcc/ada/err_vars.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2006, 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- -- @@ -32,28 +32,50 @@ with Uintp; use Uintp; package Err_Vars is + ------------------ + -- Error Counts -- + ------------------ + Serious_Errors_Detected : Nat; -- 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. + -- switch -gnatQ is set. Initialized to zero at the start of compilation. Total_Errors_Detected : Nat; - -- 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. + -- 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. Warnings_Detected : Nat; - -- Number of warnings detected + -- Number of warnings detected. Initialized to zero at the start of + -- compilation. - Current_Error_Source_File : Source_File_Index; - -- 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 - -- other than the main unit. However, if the main unit has a pragma - -- Source_Reference line, then this is initialized to No_Source_File, - -- to force an initial reference to the real source file name. + ---------------------------------- + -- Error Message Mode Variables -- + ---------------------------------- + + -- These variables control special error message modes. The initialized + -- values below give the normal default behavior, but they can be reset + -- by the caller to get different behavior as noted in the comments. These + -- 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; + -- 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 + -- for resetting it. + + Warn_On_Instance : Boolean; + -- Normally if a warning is generated in a generic template from the + -- analysis of the template, then the warning really belongs in the + -- template, and the default value of False for this Boolean achieves + -- that effect. If Warn_On_Instance is set True, then the warnings are + -- generated on the instantiation (referring to the template) rather + -- than on the template itself. - Raise_Exception_On_Error : Nat := 0; + Raise_Exception_On_Error : Nat; -- If this value is non-zero, then any attempt to generate an error -- message raises the exception Error_Msg_Exception, and the error -- message is not output. This is used for defending against junk @@ -64,15 +86,24 @@ package Err_Vars is Error_Msg_Exception : exception; -- Exception raised if Raise_Exception_On_Error is true - ----------------------------------------------------- - -- Global Values Used for Error Message Insertions -- - ----------------------------------------------------- + Current_Error_Source_File : Source_File_Index := Internal_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 + -- other than the main unit. However, if the main unit has a pragma + -- Source_Reference line, then this is initialized to No_Source_File, + -- to force an initial reference to the real source file name. + + ---------------------------------------- + -- Error Message Insertion Parameters -- + ---------------------------------------- - -- The following global variables are essentially additional parameters - -- passed to the error message routine for insertion sequences described - -- above. The reason these are passed globally is that the insertion - -- mechanism is essentially an untyped one in which the appropriate - -- variables are set dependingon the specific insertion characters used. + -- The error message routines work with strings that contain insertion + -- sequences that result in the insertion of variable data. The following + -- variables contain the required data. The procedure is to set one or more + -- of the following global variables to appropriate values before making a + -- call to one of the error message routines with a string containing the + -- insertion character to get the value inserted in an appropriate format. Error_Msg_Col : Column_Number; -- Column for @ insertion character in message @@ -97,22 +128,8 @@ package Err_Vars is Error_Msg_Node_2 : Node_Id; -- Node_Id values for & insertion characters in message - Error_Msg_Qual_Level : Int := 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 - -- for resetting it. - Error_Msg_Warn : Boolean; -- Used if current message contains a < insertion character to indicate -- if the current message is a warning message. - Warn_On_Instance : Boolean := False; - -- Normally if a warning is generated in a generic template from the - -- analysis of the template, then the warning really belongs in the - -- template, and the default value of False for this Boolean achieves - -- that effect. If Warn_On_Instance is set True, then the warnings are - -- generated on the instantiation (referring to the template) rather - -- than on the template itself. - end Err_Vars; |