]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Use common routine to handle warning counting
authorViljar Indus <indus@adacore.com>
Wed, 30 Apr 2025 10:53:03 +0000 (13:53 +0300)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 1 Jul 2025 08:29:40 +0000 (10:29 +0200)
gcc/ada/ChangeLog:

* errout.adb (Delete_Warning_And_Continuations): Use
Decrease_Error_Msg_Count to update the message counts.
(Delete_Warning): Likewise.
(To_Be_Removed): Likewise.

gcc/ada/errout.adb

index 5ba44a21d2137da080653abe726bd1d6a9055ca3..c1ceaf2815b661eaef5e6f0deb77be36525c6115 100644 (file)
@@ -277,11 +277,7 @@ package body Errout is
          begin
             if not M.Deleted then
                M.Deleted := True;
-               Warnings_Detected := Warnings_Detected - 1;
-
-               if M.Warn_Err then
-                  Warnings_Treated_As_Errors := Warnings_Treated_As_Errors - 1;
-               end if;
+               Decrease_Error_Msg_Count (M);
             end if;
 
             Id := M.Next;
@@ -1803,11 +1799,7 @@ package body Errout is
       begin
          if not Errors.Table (E).Deleted then
             Errors.Table (E).Deleted := True;
-            Warnings_Detected := Warnings_Detected - 1;
-
-            if Errors.Table (E).Warn_Err then
-               Warnings_Treated_As_Errors := Warnings_Treated_As_Errors - 1;
-            end if;
+            Decrease_Error_Msg_Count (Errors.Table (E));
          end if;
       end Delete_Warning;
 
@@ -3335,11 +3327,7 @@ package body Errout is
 
                and then not Errors.Table (E).Uncond
             then
-               Warnings_Detected := Warnings_Detected - 1;
-
-               if Errors.Table (E).Warn_Err then
-                  Warnings_Treated_As_Errors := Warnings_Treated_As_Errors - 1;
-               end if;
+               Decrease_Error_Msg_Count (Errors.Table (E));
 
                return True;