-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2009, 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- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
+-- or FITNESS FOR A PARTICULAR PURPOSE. --
+-- --
+-- You should have received a copy of the GNU General Public License along --
+-- with this program; see file COPYING3. If not see --
+-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- reference to the Any_Type node, then the message is suppressed.
-- 6. Note that cases 2-5 only apply to error messages, not warning
- -- messages. Warning messages are only suppressed for case 1.
+ -- messages. Warning messages are only suppressed for case 1, and
+ -- when they come from other than the main extended unit.
-- This normal suppression action may be overridden in cases 2-5 (but not
-- in case 1) by setting All_Errors mode, or by setting the special
-- it, since it makes it clear that the continuation is part of an
-- unconditional message.
+ -- Insertion character !! (unconditional warning)
+
+ -- Normally warning messages issued in other than the main unit are
+ -- suppressed. If the message ends with !! then this suppression is
+ -- avoided. This is currently used by the Compile_Time_Warning pragma
+ -- to ensure the message for a with'ed unit is output, and for warnings
+ -- on ineffective back-end inlining, which is detected in units that
+ -- contain subprograms to be inlined in the main program.
+
-- Insertion character ? (Question: warning message)
-- The character ? appearing anywhere in a message makes the message
-- warning instead of a normal error message, and the text of the
- -- message will be preceded by "Warning:" instead of "Error:" in the
- -- normal case. The handling of warnings if further controlled by the
- -- Warning_Mode option (-w switch), see package Opt for further
- -- details, and also by the current setting from pragma Warnings. This
- -- pragma applies only to warnings issued from the semantic phase (not
- -- the parser), but currently all relevant warnings are posted by the
- -- semantic phase anyway. Messages starting with (style) are also
- -- treated as warning messages.
+ -- message will be preceded by "warning:" in the normal case. The
+ -- handling of warnings if further controlled by the Warning_Mode
+ -- option (-w switch), see package Opt for further details, and also by
+ -- the current setting from pragma Warnings. This pragma applies only
+ -- to warnings issued from the semantic phase (not the parser), but
+ -- currently all relevant warnings are posted by the semantic phase
+ -- anyway. Messages starting with (style) are also treated as warning
+ -- 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.
-- messages starting with the \ insertion character). The warning
-- Triggering switch. If non-zero, then ignore errors mode is activated.
-- This is a counter to allow convenient nesting of enable/disable.
+ -----------------------
+ -- CODEFIX Facility --
+ -----------------------
+
+ -- The GPS and GNATBench IDE's have a codefix facility that allows for
+ -- automatic correction of a subset of the errors and warnings issued
+ -- by the compiler. This is done by recognizing the text of specific
+ -- messages using appropriate matching patterns.
+
+ -- The text of such messages should not be altered without coordinating
+ -- with the codefix code. All such messages are marked by a specific
+ -- style of comments, as shown by the following example:
+
+ -- Error_Msg_N -- CODEFIX
+ -- (parameters ....)
+
+ -- Any message marked with this -- CODEFIX comment should not be modified
+ -- without appropriate coordination. If new messages are added which may
+ -- be susceptible to automatic codefix action, they are marked using:
+
+ -- Error_Msg -- CODEFIX???
+ -- (parameters)
+
+ -- And subsequently either the appropriate code is added to codefix and the
+ -- ??? are removed, or it is determined that this is not an appropriate
+ -- case for codefix action, and the comment is removed.
+
------------------------------
-- Error Output Subprograms --
------------------------------
-- suppressed.
procedure Error_Msg_F (Msg : String; N : Node_Id);
- -- Similar to Error_Msg_N except that the message is placed on the
- -- first node of the construct N (First_Node (N)).
+ -- Similar to Error_Msg_N except that the message is placed on the first
+ -- node of the construct N (First_Node (N)).
procedure Error_Msg_NE
(Msg : String;
-- is posted (with the same effect as Error_Msg_N (Msg, N) if and only
-- if Eflag is True and if the node N is within the main extended source
-- unit and comes from source. Typically this is a warning mode flag.
+ -- This routine can only be called during semantic analysis. It may not
+ -- be called during parsing.
procedure Change_Error_Text (Error_Id : Error_Msg_Id; New_Msg : String);
-- The error message text of the message identified by Id is replaced by