aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-03-30 12:52:44 +0200
committerTristan Gingold <tgingold@free.fr>2020-03-31 18:29:05 +0200
commit5aa87ef99e4f5ba046d215ac6d99a645ce7a0e1d (patch)
tree3f1d11fc04a38cafa07f67ab3fbaf9f0abb3521d
parent570a6b767eaedb0398072005c36313c062235488 (diff)
downloadghdl-5aa87ef99e4f5ba046d215ac6d99a645ce7a0e1d.tar.gz
ghdl-5aa87ef99e4f5ba046d215ac6d99a645ce7a0e1d.tar.bz2
ghdl-5aa87ef99e4f5ba046d215ac6d99a645ce7a0e1d.zip
options: handle -fmax-errors=
-rw-r--r--src/errorout.ads2
-rw-r--r--src/options.adb8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/errorout.ads b/src/errorout.ads
index 5888193dc..f8cd0eb29 100644
--- a/src/errorout.ads
+++ b/src/errorout.ads
@@ -24,7 +24,7 @@ package Errorout is
Nbr_Errors : Natural := 0;
-- Maximum number of errors, before silent them.
- Max_Nbr_Errors : constant Natural := 100;
+ Max_Nbr_Errors : Natural := 100;
type Msgid_Type is
(
diff --git a/src/options.adb b/src/options.adb
index f43ee7663..2e04f977e 100644
--- a/src/options.adb
+++ b/src/options.adb
@@ -174,6 +174,14 @@ package body Options is
Error_Msg_Option ("numeric value expected after -ftabstop=");
return Option_Err;
end;
+ elsif Opt'Length > 13 and then Opt (1 .. 13) = "-fmax-errors=" then
+ begin
+ Max_Nbr_Errors := Natural'Value (Opt (14 .. Opt'Last));
+ exception
+ when Constraint_Error =>
+ Error_Msg_Option ("numeric value expected after -fmax-errors=");
+ return Option_Err;
+ end;
elsif Opt = "--bootstrap" then
Bootstrap := True;
elsif Opt = "-fexplicit" then