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] Allow warning tag in pragma Warnings (Off, string)


This patch allows the use of a warning tag as the second parameter of
a pragma Warnings (Off\On, ...) pragma. The effect is to control all
error messages in that category. This tag may be either [-gnatw?] for
a particular category of errors, or [restriction warning] to cover all
restriction warnings, or [enabled by default] to deal with all other
warnings that are set by default.

The following test is compiled with -gnatj55 -gnatl

     1. pragma Restriction_Warnings (No_Wide_Characters);
     2. package RWarnTag2 is
     3.    pragma Warnings (Off, "[restriction warning]");
     4.    Y : Wide_Wide_Character := 'Y';
     5.    pragma Warnings (On, "[restriction warning]");
     6.    X : Wide_Wide_Character := 'X';
               |
        >>> warning: violation of restriction
            "No_Wide_Characters" at line 1

     7. end;

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

2014-05-21  Robert Dewar  <dewar@adacore.com>

	* errout.adb, erroutc.adb, erroutc.ads: Allow warning tag in pragma
	Warnings (Off, 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]