aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/options.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-11 16:28:34 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-11 16:32:27 +0200
commit635db41c41a436cf0e8d27a5e70898b5332425ed (patch)
treef2cb13f582afff2959091b18b4e834386ad0e7e7 /options.c
parentc9676a3b0349a1053c673243af52a2ef1b272bd7 (diff)
downloadsparse-dev-635db41c41a436cf0e8d27a5e70898b5332425ed.tar.gz
teach sparse about -fmax-errors
Currently, the maximum number of displayed errors is 100. This is nice to not be flooded with error messages when things are really broken but in some situation, for example testing, it is desirable to have all error messages. So, teach sparse about '-fmax-errors=COUNT'. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'options.c')
-rw-r--r--options.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/options.c b/options.c
index 9f05bdf9..c46ad4f5 100644
--- a/options.c
+++ b/options.c
@@ -73,6 +73,7 @@ int dump_macros_only = 0;
unsigned long fdump_ir;
int fhosted = 1;
+unsigned int fmax_errors = 100;
unsigned int fmax_warnings = 100;
int fmem_report = 0;
unsigned long long fmemcpy_max_count = 100000;
@@ -492,6 +493,12 @@ static int handle_fmemcpy_max_count(const char *arg, const char *opt, const stru
return 1;
}
+static int handle_fmax_errors(const char *arg, const char *opt, const struct flag *flag, int options)
+{
+ opt_uint(arg, opt, &fmax_errors, OPTNUM_UNLIMITED);
+ return 1;
+}
+
static int handle_fmax_warnings(const char *arg, const char *opt, const struct flag *flag, int options)
{
opt_uint(arg, opt, &fmax_warnings, OPTNUM_UNLIMITED);
@@ -504,6 +511,7 @@ static struct flag fflags[] = {
{ "freestanding", &fhosted, NULL, OPT_INVERSE },
{ "hosted", &fhosted },
{ "linearize", NULL, handle_fpasses, PASS_LINEARIZE },
+ { "max-errors=", NULL, handle_fmax_errors },
{ "max-warnings=", NULL, handle_fmax_warnings },
{ "mem-report", &fmem_report },
{ "memcpy-max-count=", NULL, handle_fmemcpy_max_count },