www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/10/05/00:22:24

Date: Fri, 30 Sep 1994 18:19:35 -0700 (PDT)
From: "Frederick W. Reimer" <fwreimer AT crl DOT com>
Subject: Re: your mail
To: TAUPIN AT rsovax DOT lps DOT u-psud DOT fr
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

On 30 Sep 1994 TAUPIN AT rsovax DOT lps DOT u-psud DOT fr wrote:
> I have a Fortran program which makes UNFORMARTED io's (several records
> of 1500 integers) in a scratch file. When I re_read that file with
> tjhe same mulriple vqlues (an rayarray with 2 dimentiossions) the program
> crashed with a message "end of recod found".
> 
> The same Fortran programs works fine on VQXAX, SUN, HP_UX. 
> And it works fine on DOS (i.e; f2c+gcc) when I replace the UNFORMATTED
> outputs with a formatted one (hexadecimal).
> 
> Question: is the bug in f2c or in gcc?
> 
> D. Taupin

Just a guess, but is it possible that the file is opened in DOS 'text' 
mode?  DJGPP defaults to this mode, which converts CR/LF into LF on input 
and LF to CR/LF on output.  If the raw numbers happen to be expressed 
with one of these codes (a CR/LF 0x0d 0x0a) in the file, then the io 
routines would convert this to one character (LF 0x0a) and would make the 
file seem shorter than normal.  On the other hand, if it converts writing 
out, it should convert coming in, and the net effect would be NIL 
(correct?).  Maybe the file is opened in binary mode, but read back in 
text mode?  Don't think this is too likely though.


Fred Reimer

+-------------------------------------------------------------+
| The views expressed in the above are solely my own, and are |
| not necessarily the views of my employer.  Have a nice day! |
| PGP2.6 public key available via `finger fwreimer AT crl DOT com`   |
+-------------------------------------------------------------+



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019