aboutsummaryrefslogtreecommitdiffstats
path: root/src/errorout.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-05-13 18:27:55 +0200
committerTristan Gingold <tgingold@free.fr>2019-05-13 18:36:16 +0200
commit8d3d2c734d5d5e7e3ac4a14dd691ba8175de67b3 (patch)
tree33e7f322cb0a6b01dd7613a4097c2d088a1c4a88 /src/errorout.adb
parente1c0c598e11723f651aec8a3816fc7d3a36f24c5 (diff)
downloadghdl-8d3d2c734d5d5e7e3ac4a14dd691ba8175de67b3.tar.gz
ghdl-8d3d2c734d5d5e7e3ac4a14dd691ba8175de67b3.tar.bz2
ghdl-8d3d2c734d5d5e7e3ac4a14dd691ba8175de67b3.zip
options: support -Werror=WARN to transform one warning into an error.
Diffstat (limited to 'src/errorout.adb')
-rw-r--r--src/errorout.adb17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/errorout.adb b/src/errorout.adb
index 7906aadba..55ac6c814 100644
--- a/src/errorout.adb
+++ b/src/errorout.adb
@@ -18,7 +18,6 @@
with Name_Table;
with Files_Map; use Files_Map;
-with Flags; use Flags;
with Str_Table;
with Vhdl.Errors; use Vhdl.Errors;
@@ -65,6 +64,16 @@ package body Errorout is
return Warnings_Control (Id).Enabled;
end Is_Warning_Enabled;
+ procedure Warning_Error (Id : Msgid_All_Warnings; As_Error : Boolean) is
+ begin
+ Warnings_Control (Id).Error := As_Error;
+ end Warning_Error;
+
+ function Is_Warning_Error (Id : Msgid_All_Warnings) return Boolean is
+ begin
+ return Warnings_Control (Id).Error;
+ end Is_Warning_Error;
+
function Warning_Image (Id : Msgid_Warnings) return String
is
Img : constant String := Msgid_Warnings'Image (Id);
@@ -166,9 +175,7 @@ package body Errorout is
end if;
-- Reclassify warnings to errors if -Werror.
- if Flags.Warn_Error
- and then (Id = Msgid_Warning or Id in Msgid_Warnings)
- then
+ if Id in Msgid_All_Warnings and then Is_Warning_Error (Id) then
New_Id := Msgid_Error;
else
New_Id := Id;
@@ -400,6 +407,4 @@ package body Errorout is
begin
return (Kind => Earg_Token, Val_Tok => V);
end Make_Earg_Vhdl_Token;
-
-
end Errorout;