This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] PR 19182


Daniel Jacobowitz wrote:
> That's not a good assumption - xm files are for particular host
> systems, so this only asserts that setvbuf is available on i386/SCO.
> 
> You may need to autoconf for this.

Since I found no way of autoconf'ing for something on the host, I looked at
adding line buffering to the error printing routines, and it's easy.  Consider
the previous patch withdrawn and this one instead.

Bubblestrapped and regtested on i686-pc-linux.  I also verified manually that
nothing weird happens to our error messages, as this might not get caught due
to the dg-trickery needed to deal with our fancy error printing. Ok?

- Tobi

2005-01-08  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>

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

Index: error.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/error.c,v
retrieving revision 1.9
diff -u -p -r1.9 error.c
--- error.c     3 Jan 2005 21:43:49 -0000       1.9
+++ error.c     8 Jan 2005 00:03:29 -0000
@@ -86,7 +86,20 @@ error_char (char c)
   else
     {
       if (c != 0)
-       fputc (c, stderr);
+       {
+         /* We build up complete lines before passing handing things
+            over to the library in order ot speed up error printing.  */
+         static char line[MAX_ERROR_MESSAGE];
+         static int index = 0;
+
+         line[index++] = c;
+         if (c == '\n')
+           {
+             line[index] = '\0';
+             fputs (line, stderr);
+             index = 0;
+           }
+       }
     }
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]