]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Add default value at initialization for CodePeer
authorYannick Moy <moy@adacore.com>
Wed, 22 Feb 2023 16:25:33 +0000 (17:25 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 23 May 2023 07:59:05 +0000 (09:59 +0200)
Avoid spurious alarm by CodePeer analysis by adding default value
for a variable initialization.

gcc/ada/

* sem_util.adb (Check_Node): Add default init on local Id.

gcc/ada/sem_util.adb

index c8599d475936db9362ad3c62fc30572f98fc3f5a..baf4cefdfb32f75c8ee59b21f02d8f058d468e8f 100644 (file)
@@ -2618,7 +2618,8 @@ package body Sem_Util is
 
          function Check_Node (N : Node_Id) return Traverse_Result is
             Is_Writable_Actual : Boolean := False;
-            Id                 : Entity_Id;
+            Id                 : Entity_Id := Empty;
+            --  Default init of Id for CodePeer
 
          begin
             if Nkind (N) = N_Identifier then