https://gcc.gnu.org/g:8fde76ed70d3570906f8a08e0900ae29c7ada3f6
commit r16-1854-g8fde76ed70d3570906f8a08e0900ae29c7ada3f6 Author: Viljar Indus <in...@adacore.com> Date: Wed Apr 30 13:53:03 2025 +0300 ada: Use common routine to handle warning counting 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. Diff: --- gcc/ada/errout.adb | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index 5ba44a21d213..c1ceaf2815b6 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -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;