The pragma Warnings (Off, msg) is intended only to delete warnings,
but it was deleting real errors as well. This patch corrects that
mistake.

The following compiles with the indicated message (previously
this message was suppressed).

     1. procedure ErrMsgDelete is
     2.    X : Integer;
     3. begin
     4.    pragma Warnings (Off, "*universal*");
     5.    X := 1.0;
                |
        >>> expected type "Standard.Integer"
        >>> found type universal real

     6.    pragma Warnings (On, "*universal*");
     7. end;

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

2013-09-10  Robert Dewar  <de...@adacore.com>

        * errout.adb (Finalize): Don't delete real errors with specific
        warning control.

Index: errout.adb
===================================================================
--- errout.adb  (revision 202451)
+++ errout.adb  (working copy)
@@ -1302,7 +1302,7 @@
             CE : Error_Msg_Object renames Errors.Table (Cur);
 
          begin
-            if not CE.Deleted
+            if (CE.Warn and not CE.Deleted)
               and then
                 (Warning_Specifically_Suppressed (CE.Sptr, CE.Text)
                    or else

Reply via email to