re PR fortran/19182 (Error messages seem to be printed slower)
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
Sun, 16 Jan 2005 17:44:17 +0000 (17:44 +0000)
committerPaul Brook <pbrook@gcc.gnu.org>
Sun, 16 Jan 2005 17:44:17 +0000 (17:44 +0000)
2005-01-16  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>

PR fortran/19182
* error.c (error_char): Line-buffer errors / warnings.

From-SVN: r93734

gcc/fortran/ChangeLog
gcc/fortran/error.c

index d90e50eb45005660eee86cb130615266a04abad5..01687ef236a66c95fe2f82e7ef972bfe2c9a9108 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-16  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/19182
+       * error.c (error_char): Line-buffer errors / warnings.
+
 2005-01-16  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
 
        * trans-intrinsic.c (gfc_conv_intrinsic_ishft): Fix signed /
index 7f0b57ca02f45a58897f8a09d9fced7f081cfb19..a8eae5641237863ee5146072a1563ae0e4917a8a 100644 (file)
@@ -86,7 +86,20 @@ error_char (char c)
   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;
+           }
+       }
     }
 }