From 9d10278a9ca0d90a5fe82fa6e7dfb7d7dcb0f38a Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Sun, 9 Dec 2018 23:39:57 -0800 Subject: [PATCH] --errorMax:0 means: unlimited --- compiler/commands.nim | 10 +++++++--- doc/advopt.txt | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/compiler/commands.nim b/compiler/commands.nim index 576a7dc7fe..40283489c1 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -618,10 +618,14 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo; expectNoArg(conf, switch, arg, pass, info) incl(conf.globalOptions, optRun) of "errormax": - # Note: `nim check` (etc) can overwrite this; - # `0` is meaningless and has same effect as `1` expectArg(conf, switch, arg, pass, info) - conf.errorMax = parseInt(arg) + conf.errorMax = block: + # Note: `nim check` (etc) can overwrite this. + # `0` is meaningless, give it a useful meaning as in clang's -ferror-limit + # If user doesn't set this flag and the code doesn't either, it'd + # have the same effect as errorMax = 1 + let ret = parseInt(arg) + if ret == 0: high(int) else: ret of "verbosity": expectArg(conf, switch, arg, pass, info) let verbosity = parseInt(arg) diff --git a/doc/advopt.txt b/doc/advopt.txt index 11af58392e..eca7b0a084 100644 --- a/doc/advopt.txt +++ b/doc/advopt.txt @@ -103,7 +103,7 @@ Advanced options: value = number of processors (0 for auto-detect) --incremental:on|off only recompile the changed modules (experimental!) --verbosity:0|1|2|3 set Nim's verbosity level (1 is default) - --errorMax:int stop after n (>=1) errors in semantic pass + --errorMax:int stop after n errors in semantic pass; 0 means unlimited --experimental:$1 enable experimental language feature -v, --version show detailed version information