int getErrorErrors () { return error_info.errors; }
void setTraceLevel (int i) { error_info.trace = i; }
-void errorv(const char *id, int level, va_list ap)
+void errorv(const char *id, int level, const char *s, va_list ap)
{
- const char *s;
int flags;
if (level < error_info.trace) return;
sfprintf(sfstderr, "line %d: ", error_info.line);
}
}
- s = va_arg(ap, char *);
sfvprintf(sfstderr, s, ap);
if (flags & ERROR_SYSTEM)
sfprintf(sfstderr, "\n%s", strerror(errno));
void error(int level, ...)
{
va_list ap;
+ const char *s;
va_start(ap, level);
- errorv(NiL, level, ap);
+ s = va_arg(ap, char *);
+ errorv(NiL, level, s, ap);
va_end(ap);
}
void errorf(void *handle, void *discipline, int level, ...)
{
va_list ap;
+ const char *s;
va_start(ap, level);
+ s = va_arg(ap, char *);
errorv((discipline
- && handle) ? *((char **) handle) : (char *) handle, level, ap);
+ && handle) ? *((char **) handle) : (char *) handle, level, s, ap);
va_end(ap);
}
extern void error(int, ...);
extern void errorf(void *, void *, int, ...);
- extern void errorv(const char *, int, va_list);
+ extern void errorv(const char *, int, const char *, va_list);
#endif
gverrorf (Expr_t *handle, Exdisc_t *discipline, int level, ...)
{
va_list ap;
+ const char *s;
va_start(ap, level);
+ s = va_arg(ap, char *);
errorv((discipline
- && handle) ? *((char **) handle) : (char *) handle, level, ap);
+ && handle) ? *((char **) handle) : (char *) handle, level, s, ap);
va_end(ap);
if (level >= ERROR_ERROR) {