From 1ffcd2151b0e30e64105674c1b6cb2dff1e2911c Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Tue, 29 Aug 2006 17:41:56 -0700 Subject: [PATCH] [PATCH] sparse_error() should not silence info() after sparse_error()s sparse_error() sets max_warnings = 0 to silence subsequent sparse_warning()s or info()s; however, this also silences the info() after that sparse_error() and subsequent sparse_errors() which still get shown. bad_expr_type runs into this problem: it reports an error with sparse_error() and then provides further information with info(), which the user never sees. Make info() continue to print as long as the immediately preceeding warning or error does. Signed-off-by: Josh Triplett Signed-off-by: Linus Torvalds --- lib.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib.c b/lib.c index e2705efd..cd79453c 100644 --- a/lib.c +++ b/lib.c @@ -94,12 +94,13 @@ static void do_warn(const char *type, struct position pos, const char * fmt, va_ } static int max_warnings = 100; +static int show_info = 1; void info(struct position pos, const char * fmt, ...) { va_list args; - if (!max_warnings) + if (!show_info) return; va_start(args, fmt); do_warn("", pos, fmt, args); @@ -110,11 +111,15 @@ void warning(struct position pos, const char * fmt, ...) { va_list args; - if (!max_warnings) + if (!max_warnings) { + show_info = 0; return; + } - if (!--max_warnings) + if (!--max_warnings) { + show_info = 0; fmt = "too many warnings"; + } va_start(args, fmt); do_warn("warning: ", pos, fmt, args); @@ -126,10 +131,12 @@ void sparse_error(struct position pos, const char * fmt, ...) static int errors = 0; va_list args; die_if_error = 1; + show_info = 1; /* Shut up warnings after an error */ max_warnings = 0; if (errors > 100) { static int once = 0; + show_info = 0; if (once) return; fmt = "too many errors"; -- 2.11.4.GIT