Commit 2dcf2584 by Robert Dewar Committed by Arnaud Charlet

errout.ads: Update comments for new handling of info: messages

2008-04-08  Robert Dewar  <dewar@adacore.com>

	* errout.ads: Update comments for new handling of info: messages

	* erroutc.adb (Matches): New procedure
	(Warning_Specifically_Suppressed): Modified to handle multiple * chars
	(Is_Style_Or_Info_Msg): New name for Is_Style_Msg, now set for
	 info messages as well as style messages.

	* erroutc.ads: Remove unneeded fields from Specific_Warning_Entry

	* sem_elab.adb (Supply_Bodies): Create actual bodies for stubbed
	subprograms.
	(Check_A_Call): Special "info: " warnings now have ? in the text
	(Elab_Warning): Use info message in static case

From-SVN: r134024
parent 68c3f02a
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -275,14 +275,21 @@ package Errout is ...@@ -275,14 +275,21 @@ package Errout is
-- Insertion character ? (Question: warning message) -- Insertion character ? (Question: warning message)
-- The character ? appearing anywhere in a message makes the message -- The character ? appearing anywhere in a message makes the message
-- warning instead of a normal error message, and the text of the -- warning instead of a normal error message, and the text of the
-- message will be preceded by "Warning:" instead of "Error:" in the -- message will be preceded by "warning:" in the normal case. The
-- normal case. The handling of warnings if further controlled by the -- handling of warnings if further controlled by the Warning_Mode
-- Warning_Mode option (-w switch), see package Opt for further -- option (-w switch), see package Opt for further details, and also by
-- details, and also by the current setting from pragma Warnings. This -- the current setting from pragma Warnings. This pragma applies only
-- pragma applies only to warnings issued from the semantic phase (not -- to warnings issued from the semantic phase (not the parser), but
-- the parser), but currently all relevant warnings are posted by the -- currently all relevant warnings are posted by the semantic phase
-- semantic phase anyway. Messages starting with (style) are also -- anyway. Messages starting with (style) are also treated as warning
-- treated as warning messages. -- messages.
--
-- Note: when a warning message is output, the text of the message is
-- preceded by "warning: " in the normal case. An exception to this
-- rule occurs when the text of the message starts with "info: " in
-- which case this string is not prepended. This allows callers to
-- label certain warnings as informational messages, rather than as
-- warning messages requiring some action.
-- --
-- Note: the presence of ? is ignored in continuation messages (i.e. -- Note: the presence of ? is ignored in continuation messages (i.e.
-- messages starting with the \ insertion character). The warning -- messages starting with the \ insertion character). The warning
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -52,6 +52,7 @@ package Erroutc is ...@@ -52,6 +52,7 @@ package Erroutc is
Is_Style_Msg : Boolean := False; Is_Style_Msg : Boolean := False;
-- Set True to indicate if the current message is a style message -- Set True to indicate if the current message is a style message
-- (i.e. a message whose text starts with the cahracters "(style)").
Is_Serious_Error : Boolean := False; Is_Serious_Error : Boolean := False;
-- Set by Set_Msg_Text to indicate if current message is serious error -- Set by Set_Msg_Text to indicate if current message is serious error
...@@ -267,25 +268,12 @@ package Erroutc is ...@@ -267,25 +268,12 @@ package Erroutc is
Msg : String_Ptr; Msg : String_Ptr;
-- Message from pragma Warnings (Off, string) -- Message from pragma Warnings (Off, string)
Pattern : String_Ptr;
-- Same as Msg, excluding initial and final asterisks if present. The
-- lower bound of this string is always one.
Patlen : Natural;
-- Length of pattern string (excluding initial/final asterisks)
Open : Boolean; Open : Boolean;
-- Set to True if OFF has been encountered with no matching ON -- Set to True if OFF has been encountered with no matching ON
Used : Boolean; Used : Boolean;
-- Set to True if entry has been used to suppress a warning -- Set to True if entry has been used to suppress a warning
Star_Start : Boolean;
-- True if given pattern had * at start
Star_End : Boolean;
-- True if given pattern had * at end
Config : Boolean; Config : Boolean;
-- True if pragma is configuration pragma (in which case no matching -- True if pragma is configuration pragma (in which case no matching
-- Off pragma is required, and it is not required that a specific -- Off pragma is required, and it is not required that a specific
...@@ -482,12 +470,12 @@ package Erroutc is ...@@ -482,12 +470,12 @@ package Erroutc is
procedure Test_Style_Warning_Serious_Msg (Msg : String); procedure Test_Style_Warning_Serious_Msg (Msg : String);
-- Sets Is_Warning_Msg true if Msg is a warning message (contains a -- Sets Is_Warning_Msg true if Msg is a warning message (contains a
-- question mark character), and False otherwise. Sets Is_Style_Msg -- question mark character), and False otherwise. Is_Style_Msg is set true
-- true if Msg is a style message (starts with "(style)"). Sets -- if Msg is a style message (starts with "(style)". Sets Is_Serious_Error
-- Is_Serious_Error True unless the message is a warning or style -- True unless the message is a warning or style/info message or contains
-- message or contains the character | indicating a non-serious -- the character | indicating a non-serious error message. Note that the
-- error message. Note that the call has no effect for continuation -- call has no effect for continuation messages (those whose first
-- messages (those whose first character is \). -- character is '\').
function Warnings_Suppressed (Loc : Source_Ptr) return Boolean; function Warnings_Suppressed (Loc : Source_Ptr) return Boolean;
-- Determines if given location is covered by a warnings off suppression -- Determines if given location is covered by a warnings off suppression
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment