public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/20179] New: cannot mix C and Fortran I/O
@ 2005-02-23 23:34 gcc-bugzilla at gcc dot gnu dot org
  2005-02-24  6:43 ` [Bug libfortran/20179] " pinskia at gcc dot gnu dot org
                   ` (21 more replies)
  0 siblings, 22 replies; 27+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2005-02-23 23:34 UTC (permalink / raw)
  To: gcc-bugs


When calling a C library from a gfortran-compiled program, C stdio is only
partially written.

Ability to mix languages as needed is really important in many practical
applications these days, so this would be nice to fix.  I suspect that
there is simply a missing fflush (or similar) somewhere, since the
problem appears when you have a printf with a missing newline (as in the
test case below) or when doing character-based (putc) I/O.

Environment:
System: Linux fftw.org 2.6.3-1-686-smp #2 SMP Tue Feb 24 20:29:08 EST 2004 i686 GNU/Linux
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../configure --prefix=/home/stevenj/gcc4 --enable-languages=c,f95

How-To-Repeat:
Create two files, cio.c and ciotst.f, to be compiled in gcc and gfortran:

cio.c:
   #include <stdio.h>
   void cio_(void){
     printf("foo\n");
     printf("bar\n");
     printf("baz");
   }

ciotst.f:
      program ciotst
      call cio
      end

Compile:
	gcc -c cio.c
	gfortran ciotst.f cio.o -o ciotst

Run:
	./ciotst

Output:
foo
bar

Expected output (e.g. what I get with g77):
foo
bar
baz

(Note that last line is missing a newline.)

-- 
           Summary: cannot mix C and Fortran I/O
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: stevenj at fftw dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20179


^ permalink raw reply	[flat|nested] 27+ messages in thread
[parent not found: <bug-20179-9955@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2005-10-30 13:49 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-23 23:34 [Bug fortran/20179] New: cannot mix C and Fortran I/O gcc-bugzilla at gcc dot gnu dot org
2005-02-24  6:43 ` [Bug libfortran/20179] " pinskia at gcc dot gnu dot org
2005-02-24  8:19 ` pinskia at gcc dot gnu dot org
2005-02-24 12:22 ` Thomas dot Koenig at online dot de
2005-02-24 13:29 ` stevenj at fftw dot org
2005-02-28  1:49 ` tobi at gcc dot gnu dot org
2005-05-22 22:09 ` fxcoudert at gcc dot gnu dot org
2005-05-23 17:14 ` fxcoudert at gcc dot gnu dot org
2005-05-25  0:15 ` stevenj at alum dot mit dot edu
2005-05-25 11:23 ` fxcoudert at gcc dot gnu dot org
2005-05-25 17:04 ` stevenj at alum dot mit dot edu
2005-05-25 18:43 ` fxcoudert at gcc dot gnu dot org
2005-05-30  7:43 ` cvs-commit at gcc dot gnu dot org
2005-05-30  7:45 ` cvs-commit at gcc dot gnu dot org
2005-05-30  7:51 ` fxcoudert at gcc dot gnu dot org
2005-06-17 18:12 ` pinskia at gcc dot gnu dot org
2005-09-08 20:59 ` fxcoudert at gcc dot gnu dot org
2005-09-10 16:06 ` fxcoudert at gcc dot gnu dot org
2005-09-10 16:16 ` fxcoudert at gcc dot gnu dot org
2005-09-11 13:35 ` cvs-commit at gcc dot gnu dot org
2005-09-11 18:55 ` cvs-commit at gcc dot gnu dot org
2005-09-12 10:15 ` T dot Farago at lumc dot nl
2005-09-12 11:18 ` fxcoudert at gcc dot gnu dot org
     [not found] <bug-20179-9955@http.gcc.gnu.org/bugzilla/>
2005-10-29 12:44 ` fxcoudert at gcc dot gnu dot org
2005-10-30 12:49 ` fxcoudert at gcc dot gnu dot org
2005-10-30 13:25 ` fxcoudert at gcc dot gnu dot org
2005-10-30 13:49 ` fxcoudert at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).