diff options
| author | Josh Triplett <josht@us.ibm.com> | 2006-08-29 17:41:56 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-08-29 19:09:31 -0700 |
| commit | 1ffcd2151b0e30e64105674c1b6cb2dff1e2911c (patch) | |
| tree | 8afe4ad63b60d7d74bf9e2bb1594c8f53f5f26d6 | |
| parent | a0db384dbb4bbb605ccef2c4ed06e0850e75907b (diff) | |
| download | sparse-dev-1ffcd2151b0e30e64105674c1b6cb2dff1e2911c.tar.gz | |
[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 <josh@freedesktop.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | lib.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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"; |
