From b19787b12897fed179053e87cc6a468ca306d799 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 26 Dec 2018 06:07:09 +0100 Subject: sem: avoid duplicate warnings for subprogram interfaces. Fix #719 --- src/vhdl/sem.adb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/vhdl/sem.adb') diff --git a/src/vhdl/sem.adb b/src/vhdl/sem.adb index efa7d34c5..89babd3fc 100644 --- a/src/vhdl/sem.adb +++ b/src/vhdl/sem.adb @@ -1991,6 +1991,7 @@ package body Sem is procedure Sem_Subprogram_Body (Subprg : Iir) is Spec : constant Iir := Get_Subprogram_Specification (Subprg); + Warn_Hide_Enabled : constant Boolean := Is_Warning_Enabled (Warnid_Hide); El : Iir; begin Set_Impure_Depth (Subprg, Iir_Depth_Pure); @@ -2001,7 +2002,10 @@ package body Sem is Open_Declarative_Region; Set_Is_Within_Flag (Spec, True); - -- Add the interface names into the current declarative region. + -- Add the interface names into the current declarative region. + -- (Do not emit warnings for hiding, they were already emitted during + -- analysis of the subprogram spec). + Enable_Warning (Warnid_Hide, False); El := Get_Interface_Declaration_Chain (Spec); while El /= Null_Iir loop Add_Name (El, Get_Identifier (El), False); @@ -2010,6 +2014,7 @@ package body Sem is end if; El := Get_Chain (El); end loop; + Enable_Warning (Warnid_Hide, Warn_Hide_Enabled); Sem_Sequential_Statements (Spec, Subprg); -- cgit v1.2.3