From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f48e5,ef053df45f297989,start X-Google-Attributes: gidf48e5,public X-Google-Thread: 1094ba,ef053df45f297989,start X-Google-Attributes: gid1094ba,public X-Google-Thread: 1164f8,ef053df45f297989,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1991-04-21 04:20:07 PST Path: gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!lll-winken!elroy.jpl.nasa.gov!usc!rpi!uupsi!phage!xray1.cshl.org!pflugrat From: pflugrat@cshl.org (Jim Pflugrath) Newsgroups: comp.lang.fortran,comp.sys.sgi,comp.sys.dec Subject: Bug in MIPS f77 internal READ Summary: internal READ is wrong when char is 10 Keywords: f77 bug MIPS Message-ID: Date: 21 Apr 91 02:36:45 GMT Sender: news@cshl.org (NO MAIL) Organization: Cold Spring Harbor Laboratory Xref: gmdzi comp.lang.fortran:4508 comp.sys.sgi:108451 comp.sys.dec:24182 C C In the MIPS f77 compiler when one attempts an internal READ on C a string containing a newline character, one gets bogus results. C The following code demonstrates this. C If there is a fix, can someone please post it? C C Jim Pflugrath C C C==================================================================== C Program to demonstrate bug in internal READ C when a character has numeric value 10 (aka linefeed, newline). C C This bug shows up with the MIPS f77 compiler. C INTEGER I, J, K INTEGER*2 II CHARACTER*2 CC C DO 100 I = 0, 127 DO 100 J = 0, 127 WRITE (CC, '(A1, A1)') CHAR(I), CHAR(J) READ (CC, '(A2)') II C C Evans & Sutherland, Silicon Graphics and Big Endian architectures: C K = J + 256 * I C C ULTRIX and Little Endian architectures: C K = I + 256 * J C IF (K .NE. II) WRITE (6, *) 'I, J, II, K: ', I, J, II, K 100 CONTINUE CONTINUE STOP END