delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/11/13/15:19:51

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: pmunger DOT hmr AT ssss DOT gouv DOT qc DOT ca
Subject: REWIND on stdin in g77 3.3.1
To: cygwin AT cygwin DOT com
Date: Thu, 13 Nov 2003 15:15:18 -0500
Message-ID: <OF12FDE6F8.CCB2B0E7-ON85256DDD.006DCF45@ssss.gouv.qc.ca>
MIME-Version: 1.0

After upgrading to g77 3.3.1 from g77 3.2, some of the code I was running
sucessfully before was not running anymore on a windows 2000 workstation.
After investigation, I found that the problem seemed to be when performing
REWINDs on stdin (unit 5).

To illustrate this, I created a simple fortran program test.f:


      CHARACTER*1 LINE(80)

 10   FORMAT(80A1)

      READ(5,10)LINE
      WRITE(6,10)LINE

      READ(5,10)LINE
      WRITE(6,10)LINE

      REWIND(5)

      READ(5,10)LINE
      WRITE(6,10)LINE

      READ(5,10)LINE
      WRITE(6,10)LINE

      END


I also created an input file, test.inp:
line 1
line 2
line 3
line 4


When compiling with g77 3.3.1, and running with "test.exe < test.inp" from
a cmd window the output is:
line 1
line 2
line 3
line 4


With g77 3.2, the output is what one should expect:
line 1
line 2
line 1
line 2

It seems that the REWIND statement has no effect in the 3.3.1 version. I
tried the same with the two versions of g77 on linux and both give the
correct result.

I would appreciate if someone could give me some insight on what is going
on here ...

Regards,

Patrice






--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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