]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix bug in -gnatw.o switch (unreferenced out parameters)
authorBob Duff <duff@adacore.com>
Sun, 27 Apr 2025 19:15:51 +0000 (15:15 -0400)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 30 Jun 2025 13:47:23 +0000 (15:47 +0200)
Fixes this bug: If -gnatw.o is specified, it is ignored unless
-gnatwm is also specified (either directly, or as part of a
catch-all switch like -gnatwa).

gcc/ada/ChangeLog:

* sem_warn.adb (Warn_On_Useless_Assignments):
Enable Warn_On_Useless_Assignment in the case of
Warn_On_All_Unread_Out_Parameters.

gcc/ada/sem_warn.adb

index 74f9fe304dfb76c6c9315ce108b762b40c74c908..32eee3370e2680da0f9258ebef19907c1100b677 100644 (file)
@@ -4743,7 +4743,7 @@ package body Sem_Warn is
       Ent : Entity_Id;
 
    begin
-      if Warn_On_Modified_Unread
+      if (Warn_On_Modified_Unread or Warn_On_All_Unread_Out_Parameters)
         and then In_Extended_Main_Source_Unit (E)
       then
          Ent := First_Entity (E);