aboutsummaryrefslogtreecommitdiffstats
path: root/src/options.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/options.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/options.adb')
-rw-r--r--src/options.adb17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/options.adb b/src/options.adb
index 553a95545..32d3ca6f1 100644
--- a/src/options.adb
+++ b/src/options.adb
@@ -41,10 +41,25 @@ package body Options is
begin
-- Handle -Werror.
if Opt = "error" then
- Warn_Error := Val;
+ for I in Msgid_Warnings loop
+ Warning_Error (I, Val);
+ end loop;
return True;
end if;
+ -- Handle -Werror=xxx
+ if Opt'Length >= 6
+ and then Opt (Opt'First .. Opt'First + 5) = "error="
+ then
+ for I in Msgid_Warnings loop
+ if Warning_Image (I) = Opt (Opt'First + 6 .. Opt'Last) then
+ Warning_Error (I, Val);
+ return True;
+ end if;
+ end loop;
+ return False;
+ end if;
+
-- Normal warnings.
for I in Msgid_Warnings loop
if Warning_Image (I) = Opt then