/* Handle errors.
- Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation,
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation,
Inc.
Contributed by Andy Vaught & Niels Kristian Bech Jensen
#include "config.h"
#include "system.h"
-
-#include <string.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-
#include "flags.h"
#include "gfortran.h"
else
{
if (c != 0)
- fputc (c, stderr);
+ {
+ /* We build up complete lines before handing things
+ over to the library in order to speed up error printing. */
+ static char line[MAX_ERROR_MESSAGE + 1];
+ static int index = 0;
+
+ line[index++] = c;
+ if (c == '\n' || index == MAX_ERROR_MESSAGE)
+ {
+ line[index] = '\0';
+ fputs (line, stderr);
+ index = 0;
+ }
+ }
}
}
/* Possibly issue a warning/error about use of a nonstandard (or deleted)
feature. An error/warning will be issued if the currently selected
standard does not contain the requested bits. Return FAILURE if
- and error is generated. */
+ an error is generated. */
try
gfc_notify_std (int std, const char *format, ...)