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] Warning match string does not need leading/trailing asterisks


The warning message pattern given for pragma Warning_As_Error or
for pragma Warnings no longer requires leading and trailing asterisks.
The match can be anywhere in the string without these characters
as shown in this example, compiled with -gnatwa -gnatld7 -gnatj55

Compiling: warnmatch.adb

     1. pragma Warnings (Off, "never read");
     2. pragma Warning_As_Error ("useless");
     3. procedure WarnMatch is
     4.    A : Integer;
     5.    B : Integer;
     6. begin
     7.    A := 3;
           |
        >>> error: useless assignment to "A", value
            never referenced [warning-as-error]

     8. end;

 8 lines: No errors, 1 warning (1 treated as errors)

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

2014-07-16  Robert Dewar  <dewar@adacore.com>

	* gnat_rm.texi: Document that leading/trailing asterisks are
	now implied for the pattern match string for pragma Warnings
	and Warning_As_Error.
	* sem_prag.adb (Acquire_Warning_Match_String): New procedure.
	(Analyze_Pragma, case Warning_As_Error): Call
	Acquire_Warning_Match_String.
	(Analyze_Pragma, case Warnings): Call Acquire_Warning_Match_String.

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]