Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: sysmark@helios.physics.utoronto.ca (Mark Bartelt)
Subject: Re: f77 -convert big_endian broken?
Date: Fri, 24 Sep 1993 18:40:51 GMT	[thread overview]
Message-ID: <CDvFw4.MrF@helios.physics.utoronto.ca> (raw)
In-Reply-To: janet.748878009@bilby

[ Fred Velijanian ]

| There were several big-endian related bugs with 3.3 and 3.3.1, but
| 3.3.2 seems to have fixed all of our problems. I don't know if this
| version is on the CDROM distribution, I got ours via a tape from the CSC.

[ Janet Jackson ]

| My Fortran users also report that 3.3.2, which I, too, got on a tape from
| DEC support, fixes it.  They were quite prompt with it.  Log a call.

Well, after installing the 3.3.2 update DEC sent us, things did seem
OK, but soon afterward I found that the "-convert big_endian" problem
is *almost* fixed, but not quite totally.  Specifically, it seems to
work OK for integers (both scalars and arrays), for real scalars, and
for real arrays with explicit subscript limits.  But it fails on real
arrays with implicit subscript limits.  Unlike the previous problems
(which affected output but not input, I believe), this one hits both
input and output.  Take a look at the following four short programs;
the first three work, the fourth doesn't.  A workaround for whatever
programs break because of this bug is obvious, but it could be a bit
a nuisance to implement it in a really gigantic program ...

moose> cat ww1.f
	program w1
	real x1,x2
	data x1,x2/1.0,2.0/
	open(unit=1,file='spam',status='new',form='unformatted')
	write (1) x1,x2
	close(unit=1)
	call exit
	end
moose> 
moose> cat ww2.f
	program w2
	real x(2)
	data x/1.0,2.0/
	open(unit=1,file='spam',status='new',form='unformatted')
	write (1) x(1),x(2)
	close(unit=1)
	call exit
	end
moose> 
moose> cat ww3.f
	program w3
	real x(2)
	data x/1.0,2.0/
	open(unit=1,file='spam',status='new',form='unformatted')
	write (1) (x(i),i=1,2)
	close(unit=1)
	call exit
	end
moose> 
moose> cat ww4.f
	program w4
	real x(2)
	data x/1.0,2.0/
	open(unit=1,file='spam',status='new',form='unformatted')
	write (1) x
	close(unit=1)
	call exit
	end
moose> 
moose> for x in 1 2 3 4; do
moose>> f77 -convert big_endian -o ww$x ww$x.f
moose>> rm -f spam
moose>> ww$x
moose>> od -x spam
moose>> done
0000000  0000 0800 803f 0000 0040 0000 0000 0800
0000020
0000000  0000 0800 803f 0000 0040 0000 0000 0800
0000020
0000000  0000 0800 803f 0000 0040 0000 0000 0800
0000020
0000000  0000 0800 0000 3f80 0000 4000 0000 0800
0000020

Mark Bartelt                                                416/978-5619
Canadian Institute for                             mark@cita.toronto.edu
Theoretical Astrophysics                           mark@cita.utoronto.ca

"Clothes not busy being worn are busy drying."  -  Dylan, on laundry day
          [ singing "It's all right, ma (I'm only bleaching)" ]


      reply	other threads:[~1993-09-24 18:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-09-09 14:27 f77 -convert big_endian broken? Keith Refson
1993-09-10 20:34 ` Jeff Donsbach
1993-09-12  3:06 ` Fred Velijanian
1993-09-24 13:40   ` Janet Jackson
1993-09-24 18:40     ` Mark Bartelt [this message]
read-only archive

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