mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
Reporter: Add ExprRuntimeWarning()
...and update Expr.cc invalidation messages to use it. This aligns the warning format to the one used by runtime errors.
This commit is contained in:
parent
0e97c29eb8
commit
a07b0c333f
4 changed files with 26 additions and 28 deletions
|
@ -174,6 +174,21 @@ void Reporter::ExprRuntimeError(const detail::Expr* expr, const char* fmt, ...)
|
|||
throw InterpreterException();
|
||||
}
|
||||
|
||||
void Reporter::ExprRuntimeWarning(const detail::Expr* expr, const char* fmt, ...)
|
||||
{
|
||||
ODesc d;
|
||||
expr->Describe(&d);
|
||||
|
||||
PushLocation(expr->GetLocationInfo());
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
FILE* out = EmitToStderr(warnings_to_stderr) ? stderr : nullptr;
|
||||
DoLog("expression warning", reporter_warning, out, nullptr, nullptr, true, true,
|
||||
d.Description(), fmt, ap);
|
||||
va_end(ap);
|
||||
PopLocation();
|
||||
}
|
||||
|
||||
void Reporter::RuntimeError(const detail::Location* location, const char* fmt, ...)
|
||||
{
|
||||
++errors;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue