From 655203b01bcbec0253f2860f970f5c6e9f57df89 Mon Sep 17 00:00:00 2001 From: erg Date: Fri, 31 Oct 2008 17:14:54 +0000 Subject: [PATCH] Modify error library to allow warning messages to be turned off --- lib/ast/error.c | 2 ++ lib/ast/error.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/ast/error.c b/lib/ast/error.c index 9c5a042bf..dc98815a4 100644 --- a/lib/ast/error.c +++ b/lib/ast/error.c @@ -41,12 +41,14 @@ void setErrorFileLine (char* src, int line) { void setErrorId (char* id) { error_info.id = id; } void setErrorErrors (int errors) { error_info.errors = errors; } int getErrorErrors () { return error_info.errors; } +void setTraceLevel (int i) { error_info.trace = i; } void errorv(const char *id, int level, va_list ap) { char *s; int flags; + if (level < error_info.trace) return; if (level < 0) flags = 0; else { diff --git a/lib/ast/error.h b/lib/ast/error.h index 953fd5eff..baeb0e5dc 100644 --- a/lib/ast/error.h +++ b/lib/ast/error.h @@ -33,6 +33,7 @@ extern "C" { int indent; int line; int warnings; + int trace; char *file; char *id; } Error_info_t; @@ -57,6 +58,7 @@ extern "C" { extern Error_info_t error_info; + extern void setTraceLevel (int); extern void setErrorLine (int); extern void setErrorFileLine (char*, int); extern void setErrorId (char*); -- 2.40.0