Question with binary IO with g77 on windows and Bug with fputc

Martin Kahlert martin.kahlert@mchp.siemens.de
Mon Jan 17 07:04:00 GMT 2000


Hi!
I have a problem with g77 on WinNT (mingw) regarding binary output.
The program:

      OPEN(77,FILE='TEST',ACCESS='SEQUENTIAL',FORM='FORMATTED') 
      WRITE(77,'(A1,$)') CHAR(10)
      CLOSE(77)
      END

If i compile it on Linux, i get a file 'TEST' with length 1,
on WinNT i get length 2 (containing CR+LF=char(13), char(10) )

How can i obtain a file with exactly the Byte 0x0A in it?

Here is a bug for you, i got by reading the g77 info pages:

      OPEN(77,FILE='TEST',ACCESS='SEQUENTIAL',FORM='FORMATTED')
      CALL FPUTC(77,CHAR(10))
      CLOSE(77)
      END

g77 -o q ~/q.f
../../../gcc-2.95.2/gcc/f/com.c:11439: failed assertion `expr != NULL'
g77: Internal compiler error: program f771 got fatal signal 6

This is 2.95.2 on Linux, but it's the same with the newest snapshot.

Thanks for every help,
Martin.



More information about the Gcc-bugs mailing list