From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23883 invoked by alias); 25 May 2005 16:48:05 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 23817 invoked by uid 48); 25 May 2005 16:48:00 -0000 Date: Wed, 25 May 2005 17:04:00 -0000 Message-ID: <20050525164800.23816.qmail@sourceware.org> From: "stevenj at alum dot mit dot edu" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050223193435.20179.stevenj@fftw.org> References: <20050223193435.20179.stevenj@fftw.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libfortran/20179] cannot mix C and Fortran I/O X-Bugzilla-Reason: CC X-SW-Source: 2005-05/txt/msg03392.txt.bz2 List-Id: ------- Additional Comments From stevenj at alum dot mit dot edu 2005-05-25 16:47 ------- It was already noted above that adding fflush to the user's code would fix the output. As a quality-of-implementation issue, however, I would suggest that libgfortran should do it. 1) Interoperating well with code in other languages, and especially with C (the de facto lingua franca) is increasingly important nowadays. 2) libc is the most common way to write to stdio. Arguably, the onus is on code using other libraries to interoperate well with it, rather than vice versa. (We're not talking about C code with some random home-brewed I/O library here.) 3) Fortran 2000 has a standard way to call C functions in libraries that may not have been designed to be called from non-C languages, and it won't always be practical to modify the C code to call fflush (e.g. the source may not even be available). Nor can the Fortran user herself easily call fflush(stdout), because that call is not available (?) in Fortran. Hence, if it is to be done at all in such cases, it has to be done in libgfortran. 4) If the performance loss of calling fflush before outputting to stdio in libgfortran is negligible (I have no data, just a guess), why is this even a question? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20179