From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18727 invoked by alias); 24 May 2005 23:51:25 -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 18713 invoked by uid 48); 24 May 2005 23:51:20 -0000 Date: Wed, 25 May 2005 00:15:00 -0000 Message-ID: <20050524235120.18710.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/msg03329.txt.bz2 List-Id: ------- Additional Comments From stevenj at alum dot mit dot edu 2005-05-24 23:51 ------- I doubt that merely omitting close() from the end of the library will entirely fix the problem. You really need to add an fflush before every output to stdio. For example, modify ciotst.f to: program ciotst call cio write(*,*) 'Hello world.' call cio end The g77 output is: foo bar baz Hello world. foo bar baz as you would expect, but the gfortran output is in the wrong order (as well as missing the final "baz" in my unpatched gfortran) because of missing flushes: foo bar Hello world. bazfoo bar (If you look in libf2c you'll see that it uses fflush in a number of places.) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20179