This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Cleanup handling of info and warning messages


This is a fairly major internal reorganization of how info and warning
messages are handled. Info messages for elaboration are now tagged
as [-gnatel] if warning tagging is activated (-gnatw.d), and info
messages coming from instantiations are consistently labeled as such
as shown by this example, compiled with -gnatw.e -gnatl

     1. generic
     2. package IWInfoD is
     3.   type Handle_Type is private;
     4.   function CH return Handle_Type;
                   |
        >>> info: "IWInfoD" requires body ("CH" requires completion)

     5. private
     6.   type Handle_Type is
     7.   record
     8.     Initialised : Boolean;
     9.   end record;
    10. end;

     1. package body IWInfoD is
     2.   function CH return Handle_Type is
     3.   begin
     4.     return (Initialised => False);
     5.   end CH;
     6. end;

     1. with IWInfoD;
     2. generic
     3.   with package My_D is new IWInfoD;
          |
        >>> info: in instantiation at iwinfod.ads:4
        >>> info: "My_D" requires body ("CH" requires completion)

     4.   with procedure Method (Client : in out My_D.Handle_Type);
     5. package IWInfo is
     6. private
     7.   procedure C;
                    |
        >>> info: "IWInfo" requires body ("C" requires completion)

     8. end;

     1. package body IWInfoD is
     2.   function CH return Handle_Type is
     3.   begin
     4.     return (Initialised => False);
     5.   end CH;
     6. end;

prior to this fix the messages on line 3 of the IWinfo spec
were inconsistent with the first saying warning: and the
second saying info: which was confusing

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-06-11  Robert Dewar  <dewar@adacore.com>

	* errout.adb (Warn_Insertion): New function.
	(Error_Msg): Use Warn_Insertion and Prescan_Message.
	(Error_Msg_Internal): Set Info field of error object.
	(Error_Msg_NEL): Use Prescan_Message.
	(Set_Msg_Text): Don't store info: at start of message.
	(Skip_Msg_Insertion_Warning): New name for Set_Msg_Insertion_Warning.
	(Skip_Msg_Insertion_Warning): Now just skips warning insertion.
	* errout.ads: Document new ?$? and >$> insertion sequences
	Document use of "(style)" and "info: "
	* erroutc.adb (dmsg): Print several missing fields
	(Get_Warning_Tag): Handle -gnatel case (?$?)  (Output_Msg_Text):
	Deal with new tagging of info messages
	* erroutc.ads: Is_Info_Msg: New global (Error_Msg_Object):
	Add field Info (Prescan_Message): New procedure, this procedure
	replaces the old Test_Style_Warning_Serious_Unconditional_Msg
	* errutil.adb, exp_util.adb, par-ch7.adb, sem_ch13.adb, sem_ch7.adb,
	sem_elab.adb: Follow new rules for info message (info belongs
	only at the start of a message, and only in the first message,
	not in any of the continuations).

	* gnat_ugn.texi: Document full set of warning tags.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]