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


Andrew Pinski wrote:
> Is setvbuf always available on all the targets which we support as
> the host/build?  Yes it is included in C89 but we don't require
> a C89 host library, only a C89 compiler to bootstrap with.

setvbuf is called in toplev.c:
#ifdef IO_BUFFER_SIZE
  setvbuf (asm_out_file, xmalloc (IO_BUFFER_SIZE),
	   _IOFBF, IO_BUFFER_SIZE);
#endif

Now, IO_BUFFER_SIZE is defined nowhere, but some googling revealed that when
it was still defined, it was defined without further conditionals, i.e. like
so (from http://gcc.gnu.org/ml/gcc-patches/2001-03/msg01213.html):

Index: config/i386/xm-sco.h
--- config/i386/xm-sco.h	Fri Mar 16 13:37:18 2001
+++ config/i386/xm-sco.h	Tue May  5 13:32:27 1998
@@ -1,5 +0,0 @@
-/* Configuration for GCC for Intel i386 running SCO.  */
-
-/* Big buffers improve performance.  */
-
-#define IO_BUFFER_SIZE (0x8000 - 1024)

>From this I conclude that calling setvbuf is safe.  I had actually refrained
from making that call "setlinebuf (stderr);" as that is less portable
according to the glibc docs.

Thanks,
- Tobi


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