Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Bug in MIPS f77 internal READ
@ 1991-04-21  2:36 Jim Pflugrath
  0 siblings, 0 replies; only message in thread
From: Jim Pflugrath @ 1991-04-21  2:36 UTC (permalink / raw)


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  <pflugrat@cshl.org>
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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1991-04-21  2:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1991-04-21  2:36 Bug in MIPS f77 internal READ Jim Pflugrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox