aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-01-04 16:37:07 +0100
committerTristan Gingold <tgingold@free.fr>2019-01-04 21:01:34 +0100
commit577172e2a52076f4099fcdf4bf8a69649488f514 (patch)
tree8d6b1e848417b97446134c5e24d80191ce90d87c /src/vhdl
parent591f3ffe260582cd8057a3470bb1580fea98ebbc (diff)
downloadghdl-577172e2a52076f4099fcdf4bf8a69649488f514.tar.gz
ghdl-577172e2a52076f4099fcdf4bf8a69649488f514.tar.bz2
ghdl-577172e2a52076f4099fcdf4bf8a69649488f514.zip
errorout: discard disabled warnings.
Fix #729
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/errorout.adb5
-rw-r--r--src/vhdl/translate/ortho_front.adb15
2 files changed, 15 insertions, 5 deletions
diff --git a/src/vhdl/errorout.adb b/src/vhdl/errorout.adb
index 5c79be69c..90d30e138 100644
--- a/src/vhdl/errorout.adb
+++ b/src/vhdl/errorout.adb
@@ -212,6 +212,11 @@ package body Errorout is
Line_Pos : Source_Ptr;
pragma Unreferenced (Line_Pos);
begin
+ -- Discard warnings that aren't enabled.
+ if Id in Msgid_Warnings and then not Is_Warning_Enabled (Id) then
+ return;
+ end if;
+
-- Reclassify warnings to errors if -Werror.
if Flags.Warn_Error
and then (Id = Msgid_Warning or Id in Msgid_Warnings)
diff --git a/src/vhdl/translate/ortho_front.adb b/src/vhdl/translate/ortho_front.adb
index f17713b0f..09c44c7aa 100644
--- a/src/vhdl/translate/ortho_front.adb
+++ b/src/vhdl/translate/ortho_front.adb
@@ -221,11 +221,16 @@ package body Ortho_Front is
Flag_Expect_Failure := True;
return 1;
elsif Opt'Length > 7 and then Opt (1 .. 7) = "--ghdl-" then
- if Options.Parse_Option (Opt (7 .. Opt'Last)) then
- return 1;
- else
- return 0;
- end if;
+ declare
+ subtype Str_Type is String (1 .. Opt'Last - 6);
+ begin
+ -- The option paraeter must be normalized (starts at index 1).
+ if Options.Parse_Option (Str_Type (Opt (7 .. Opt'Last))) then
+ return 1;
+ else
+ return 0;
+ end if;
+ end;
elsif Options.Parse_Option (Opt.all) then
return 1;
else