bug in f2c libraries

Greg Lindahl lindahl@cs.virginia.edu
Thu Jan 22 11:28:00 GMT 1998


Thu Oct 17 09:22:05 EDT 1991:
  libi77: README, fio.h, sue.c, uio.c changed so the length field
in unformatted sequential records has type long rather than int
(unless UIOLEN_int is #defined).  This is for systems where
sizeof(int)
can vary, depending on the compiler or compiler options.

----------------------------------------------------------------------

Whoever did this missed libI77/backspace.c at the very least:

        if(b->ufmt==0)
        {       (void) fseek(b->ufd,-(long)sizeof(int),SEEK_CUR);
                (void) fread((char *)&n,sizeof(int),1,b->ufd);
                (void) fseek(b->ufd,-(long)n-2*sizeof(int),SEEK_CUR);
                return(0);
        }

In addition, Digital Fortran on alphas uses 4 byte record lengths
rather than 8. I agree that 8 is better for the long term, but this
incompatibility is troubling in practice. Can we have an environment
variable to set this at run-time? I suppose I could write the code if
no one else has the enthusiasm. Most commercial compilers allow you to
set options for files for all units, or on a per-unit basis using
environment variables. It smacks of JCL, but it works...

-- g



More information about the Gcc-bugs mailing list