Bug (or mis-feature) in g77 sequential file format
Mako Sasaki
sasaki@tyo.sci.jri.co.jp
Wed Sep 23 19:23:00 GMT 1998
From: Alberto Garcia <wdpgaara@lcpxbi.wm.lc.ehu.es>
Subject: Bug (or mis-feature) in g77 sequential file format
Date: Fri, 18 Sep 1998 12:54:23 +0200 (MET DST)
> I have come accross a problem with the way g77 treats sequential binary
> files on the alpha. My version is:
>
> It turns out that this version of g77 for the alpha uses 8 bytes for the
> record's header and trailer (which hold the record length), while the very
> same g77 version on my PC running FreeBSD uses 4 bytes. The standard DEC
> Fortran compiler also uses 4-byte headers and trailers. This means that I
> cannot share binary files.
>
> I believe this is a bug (or at least a mis-feature). All the workstation
> fortran compilers I am aware of use 4-byte headers, and only cf77 on the
> Cray uses 8 bytes (with a different floating-point format, so sharing
> files with a Cray is out of the question).
This behavior is caused by type definition of "uiolen" in fio.h in libI77.
#ifdef UIOLEN_int
typedef int uiolen;
#else
typedef long uiolen;
#endif
You get 4-byte record header by putting definition of the macro "UIOLEN_int" before definition of "uiolen" in fio.h.
#define UIOLEN_int 1
etc.
===================================================================
Makoto Sasaki : The Japan Research Institute Ltd.
sasaki@tyo.sci.jri.co.jp
More information about the Gcc-bugs
mailing list