From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,9ca6827ef0a9bd43,start X-Google-Attributes: gid1164f8,public X-Google-Thread: fee84,9ca6827ef0a9bd43,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1993-05-04 09:45:23 PST Xref: gmd.de comp.sys.dec:7453 comp.unix.osf.osf1:344 Newsgroups: comp.sys.dec,comp.unix.osf.osf1 Path: gmd.de!ira.uka.de!howland.reston.ans.net!usc!cs.utexas.edu!utnut!helios.physics.utoronto.ca!sysmark From: sysmark@helios.physics.utoronto.ca (Mark Bartelt) Subject: DEC Fortran V3.3 for OSF/AXP botches "-convert big_endian" output Message-ID: Sender: news@helios.physics.utoronto.ca (News Administrator) Reply-To: mark@cita.toronto.edu Organization: University of Toronto Physics/Astronomy/CITA Date: Tue, 4 May 1993 16:32:45 GMT Consider the following two programs: program w real*8 x data x/123.456/ open(unit=1,file='x.x',type='new',form='unformatted') write (1) x close(1) end program r real*8 x open(unit=1,file='x.x',type='old',form='unformatted') read (1) x close(1) write (6,666) x 666 format (g20.8) end Running program "w" followed by program "r" produces the correct result under other versions of UNIX (e.g. SunOS, IRIX). Things also work as expected under DEC's OSF/1, unless one uses the "-convert big_endian" option. The problem is that "-convert big_endian" does the correct thing on input, but not on output. It did work correctly under the field test version of Fortran (DEC Fortran T3.3(eft1), DFABASE004), but doesn't work under the official release (DEC Fortran V3.3, DFABASE330). It's rather annoying that this bug got introduced so close to release, and didn't get caught. Anyway, the details: When viewed from a big-endian machine, here's what the contents of the output file look like when program "w" is run on a big-endian machine: (A) 00000008 405edd2f 1a9fbe77 00000008 Here's what gets produced by default under DEC OSF/1 (both T3.3(eft1) and V3.3), again as viewed from a big-endian machine: (B) 08000000 77be9f1a 2fdd5e40 08000000 This is exactly what you'd expect: The four-byte record-lengh info is byte-reversed (relative to a big-endian machine), and the real*8 data is byte-reversed in the correct way. Similarly, real*4 variables are byte-reversed in groups of four, and so on. But what happens when you compile with "-convert big_endian"? It ought to produce the same output as (A) above. In fact, it generates neither (A) nor (B), but a clearly incorrect hybrid hodgepodge: 00000008 77be9f1a 2fdd5e40 00000008 In other words, it produces record-lengh information in a big-endian way, but the other information is little-endian! On input, a program compiled with "-convert big_endian" treats both the record-length information and the data itself as big-endian, as it should. This means that one can move unformatted data files to AXP OSF/1 from a big-endian system, but not the reverse. Any idea how long it will take to DEC to provide a patch for this problem? This is a major disaster for many of the users in our group.