"scratch" file bug in g77/egcs1.1b
Dave Love
d.love@dl.ac.uk
Mon Sep 28 11:29:00 GMT 1998
[Sorry, I'm not sure to what combination of egcs-bugs and egcs-patches
I should be sending this...]
>>>>> "Toon" == Toon Moene <toon@moene.indiv.nluug.nl> writes:
Toon> I'm surprised you think it's a f90/95 vs f77 issue.
[...]
Toon> Note: No mention of REWIND or ENDFILE.
Well, the ENDFILE section of f95 specifies the behaviour and f77
doesn't AFAICT and AFAYCT, but that's beside the point here.
The problem is obviously a thinko from my merge of Netlib libf2c
updates. Here's a proposed (tested) patch for the release branch to
do the same as egcs 1.0.
Something else should probably be done on the trunk where it can get
tested properly. Note that favouring tempnam is intentional and I'd
have to have a good look at what dmg's change is about.
I'll make a regression test.
Craig?
1998-09-28 Dave Love <d.love@dl.ac.uk>
* libI77/open.c: Back out part of last Netlib update affecting
scratch files which clashed with the g77 variations and broke
implicit endfile on rewind.
Index: open.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libf2c/libI77/open.c,v
retrieving revision 1.3
diff -p -c -r1.3 open.c
*** open.c 1998/05/19 10:51:12 1.3
--- open.c 1998/09/28 17:15:25
*************** integer f_open(olist *a)
*** 205,211 ****
case 's':
case 'S':
b->uscrtch=1;
- #ifdef NON_ANSI_STDIO
#ifdef HAVE_TEMPNAM /* Allow use of TMPDIR preferentially. */
s = tempnam (0, buf);
if (strlen (s) >= sizeof (buf))
--- 205,210 ----
*************** integer f_open(olist *a)
*** 221,237 ****
#endif
#endif /* ! defined (HAVE_TEMPNAM) */
goto replace;
- #else
- if (!(b->ufd = tmpfile()))
- opnerr(a->oerr,errno,"open");
- b->ufnm = 0;
- #ifndef NON_UNIX_STDIO
- b->uinode = b->udev = -1;
- #endif
- b->useek = 1;
- return 0;
- #endif
-
case 'n':
case 'N':
#ifdef NON_POSIX_STDIO
--- 220,225 ----
*************** integer f_open(olist *a)
*** 246,254 ****
/* no break */
case 'r': /* Fortran 90 replace option */
case 'R':
- #ifdef NON_ANSI_STDIO
replace:
- #endif
if (tf = fopen(buf,f__w_mode[0]))
fclose(tf);
}
--- 234,240 ----
More information about the Gcc-bugs
mailing list