diff mbox series

[Ada] Initialize variable to Empty

Message ID 20211025150910.GA346525@adacore.com
State New
Headers show
Series [Ada] Initialize variable to Empty | expand

Commit Message

Pierre-Marie de Rodat Oct. 25, 2021, 3:09 p.m. UTC
CodePeer was warning about this variable being potentially used without
being initialized.

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

gcc/ada/

	* sem_ch8.adb (Analyze_Subprogram_Renaming): Set New_S to Empty.
diff mbox series

Patch

diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -3099,7 +3099,7 @@  package body Sem_Ch8 is
       --  related formal type is class-wide.
 
       Inst_Node    : Node_Id   := Empty;
-      New_S        : Entity_Id;
+      New_S        : Entity_Id := Empty;
       Wrapped_Prim : Entity_Id := Empty;
 
    --  Start of processing for Analyze_Subprogram_Renaming