aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-01-06 20:10:05 +0100
committerTristan Gingold <tgingold@free.fr>2023-01-06 20:10:05 +0100
commit7271dab481f4caf0d3eb248c3ee65d87eaa6564c (patch)
treeb6c73b1b51060d67a31a8f15eab3bd61d4f8c84e
parent7de3e6802525a035f11258c9f3fca0a9fcac3b1e (diff)
downloadghdl-7271dab481f4caf0d3eb248c3ee65d87eaa6564c.tar.gz
ghdl-7271dab481f4caf0d3eb248c3ee65d87eaa6564c.tar.bz2
ghdl-7271dab481f4caf0d3eb248c3ee65d87eaa6564c.zip
vhdl-sem_lib: disable warnings for -c/-m on ieee units. For #2200
-rw-r--r--src/vhdl/vhdl-sem_lib.adb22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/vhdl/vhdl-sem_lib.adb b/src/vhdl/vhdl-sem_lib.adb
index 3eccac5e0..b7e5b6d1d 100644
--- a/src/vhdl/vhdl-sem_lib.adb
+++ b/src/vhdl/vhdl-sem_lib.adb
@@ -16,10 +16,12 @@
with Flags;
with Name_Table;
with Files_Map;
-with Vhdl.Utils; use Vhdl.Utils;
+with Std_Names;
with Errorout; use Errorout;
-with Vhdl.Errors; use Vhdl.Errors;
with Libraries; use Libraries;
+
+with Vhdl.Errors; use Vhdl.Errors;
+with Vhdl.Utils; use Vhdl.Utils;
with Vhdl.Scanner;
with Vhdl.Parse;
with Vhdl.Disp_Tree;
@@ -369,6 +371,22 @@ package body Vhdl.Sem_Lib is
-- used. In that case, warnings shouldn't be disabled.
Disable_All_Warnings;
Load_Parse_Design_Unit (Design_Unit, Loc);
+ else
+ -- For -c/-r or -m, disable warnings in ieee.
+ -- Ideally, we need turn warnings off for non-user units, but
+ -- is there an easy way to know what are they ?
+ -- Probably units that have been analyzed don't need warnings,
+ -- except when outdated ?
+ declare
+ File : constant Iir := Get_Design_File (Design_Unit);
+ Lib : constant Iir := Get_Library (File);
+ begin
+ if Lib /= Work_Library
+ and then Get_Identifier (Lib) = Std_Names.Name_Ieee
+ then
+ Disable_All_Warnings;
+ end if;
+ end;
end if;
Error := False;