/* Register an error. Uses argtypes as described above to specify the
* argument types. Does not print the error, only stores it for
- * OutputError() to print. */
+ * OutputAllErrorWarning() to print. */
void
Error(char *fmt, ...)
{
/* Register a warning. Uses argtypes as described above to specify the
* argument types. Does not print the warning, only stores it for
- * OutputWarning() to print. */
+ * OutputAllErrorWarning() to print. */
void
Warning(char *fmt, ...)
{
warning_count++;
}
+void
+ErrorNow(char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fprintf(stderr, "\n");
+}
+
+void
+WarningNow(char *fmt, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "%s ", _("warning:"));
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fprintf(stderr, "\n");
+}
+
+void
+ErrorAt(char *filename, unsigned long line, char *fmt, ...)
+{
+ /* TODO */
+}
+
+void
+WarningAt(char *filename, unsigned long line, char *fmt, ...)
+{
+ /* TODO */
+}
+
/* Output all previously stored errors and warnings to stderr. */
unsigned int
OutputAllErrorWarning(void)
void Error(char *, ...);
void Warning(char *, ...);
+/* Use Error() and Warning() instead of ErrorAt() and WarningAt() when being
+ * called in line order from a parser. The *At() functions are much slower,
+ * at least in the current implementation.
+ */
+void ErrorAt(char *filename, unsigned long line, char *, ...);
+void WarningAt(char *filename, unsigned long line, char *, ...);
+
+/* These two functions immediately output the error or warning, with no file
+ * or line information. They should be used for errors and warnings outside
+ * the parser stage (at program startup, for instance).
+ */
+void ErrorNow(char *, ...);
+void WarningNow(char *, ...);
+
/* Returns total number of errors to this point in assembly. */
unsigned int OutputAllErrorWarning(void);
/* Register an error. Uses argtypes as described above to specify the
* argument types. Does not print the error, only stores it for
- * OutputError() to print. */
+ * OutputAllErrorWarning() to print. */
void
Error(char *fmt, ...)
{
/* Register a warning. Uses argtypes as described above to specify the
* argument types. Does not print the warning, only stores it for
- * OutputWarning() to print. */
+ * OutputAllErrorWarning() to print. */
void
Warning(char *fmt, ...)
{
warning_count++;
}
+void
+ErrorNow(char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fprintf(stderr, "\n");
+}
+
+void
+WarningNow(char *fmt, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "%s ", _("warning:"));
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fprintf(stderr, "\n");
+}
+
+void
+ErrorAt(char *filename, unsigned long line, char *fmt, ...)
+{
+ /* TODO */
+}
+
+void
+WarningAt(char *filename, unsigned long line, char *fmt, ...)
+{
+ /* TODO */
+}
+
/* Output all previously stored errors and warnings to stderr. */
unsigned int
OutputAllErrorWarning(void)
void Error(char *, ...);
void Warning(char *, ...);
+/* Use Error() and Warning() instead of ErrorAt() and WarningAt() when being
+ * called in line order from a parser. The *At() functions are much slower,
+ * at least in the current implementation.
+ */
+void ErrorAt(char *filename, unsigned long line, char *, ...);
+void WarningAt(char *filename, unsigned long line, char *, ...);
+
+/* These two functions immediately output the error or warning, with no file
+ * or line information. They should be used for errors and warnings outside
+ * the parser stage (at program startup, for instance).
+ */
+void ErrorNow(char *, ...);
+void WarningNow(char *, ...);
+
/* Returns total number of errors to this point in assembly. */
unsigned int OutputAllErrorWarning(void);