/* E R R O R A N D D I A G N O S T I C R O U T I N E S */
#include <system.h>
+#if __STDC__
+#include <stdarg.h>
+#else
#include <varargs.h>
+#endif
#include "errout.h"
#include "LLlex.h"
else fprint(ERROUT, s);
}
+#if __STDC__
+/*VARARGS1*/
+error(char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ err_hdr("");
+ err_occurred = 1;
+ doprnt(ERROUT, fmt, ap);
+ fprint(ERROUT, "\n");
+ va_end(ap);
+}
+
+/*VARARGS1*/
+warning(char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ err_hdr("(warning) ");
+ doprnt(ERROUT, fmt, ap);
+ fprint(ERROUT, "\n");
+ va_end(ap);
+}
+
+/*VARARGS1*/
+crash(char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ err_hdr("CRASH\007 ");
+ doprnt(ERROUT, fmt, ap);
+ fprint(ERROUT, "\n");
+ va_end(ap);
+ sys_stop(S_ABORT);
+}
+
+/*VARARGS1*/
+fatal(char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ err_hdr("fatal error -- ");
+ doprnt(ERROUT, fmt, ap);
+ fprint(ERROUT, "\n");
+ va_end(ap);
+ sys_stop(S_EXIT);
+}
+#else /* __STDC__ */
/*VARARGS1*/
error(va_alist)
va_dcl
va_end(ap);
sys_stop(S_EXIT);
}
+#endif
}
if (!InsertFile(source, (char **) 0, &dummy)) /* read the source file */
- fatal("%s: no source file %s\n", prog_name,
+ fatal("%s: no source file %s", prog_name,
source ? source : "stdin");
if (source) WorkingDir = getwdir(dummy);
preprocess(source);