This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: is g77 compatible with Fortran 77 ?
- To: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Subject: Re: is g77 compatible with Fortran 77 ?
- From: Ilia Chipitsine <ilia at cgilh dot chel dot su>
- Date: Mon, 26 Jul 1999 23:45:16 +0600 (ESS)
- cc: "Ilia E. Chipitsine" <ilia at cgu dot chel dot su>, gcc at gcc dot gnu dot org
On Sun, 25 Jul 1999, Toon Moene wrote:
>
> This gives (using gcc-2.95-prerelease), over here:
>
> [toon@moene g77-bugs]$ ./a.out
> open: illegal unit number
> apparent state: unit 99 (unnamed)
> lately writing sequential formatted external IO
> Aborted (core dumped)
>
> which is not great (INQUIRE should perhaps return an IOSTAT .NE. 0 for
> UNIT > 99), but documented. The run-time library (libf2c) doesn't allow
> higher unit numbers than 99.
>
> However, the documentation describes how to build g77 in a way to have
> higher unit numbers than 99 - see:
>
> http://egcs.cygnus.com/onlinedocs/g77_17.html#SEC541
>
> Hope this helps,
sure, it helps. but it had me curious, so i even made my first
patch :-) no, it doesn't work after applying the patch :-(
there must be two ways to fix the problem:
1. add some workaround to INQUIRE
(i do not like this way)
2. change MXUNIT macros definition
i attached my patch here, but patching only fio.h (where MXUNIT is
defined) is not enough, probably close_at_end stuff must be
rewritten in more sane way.
>
> --
> Toon Moene (toon@moene.indiv.nluug.nl)
> Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
> Phone: +31 346 214290; Fax: +31 346 214286
> GNU Fortran: http://world.std.com/~burley/g77.html
>
*** fio.h Mon Jul 26 23:02:32 1999
--- fio.h.new Mon Jul 26 23:24:06 1999
***************
*** 85,89 ****
/*Table sizes*/
! #define MXUNIT 100
extern int f__recpos; /*position in current record*/
--- 85,97 ----
/*Table sizes*/
! /* Ilia Chipitsine <ilia@cgu.chel.su>
! is responsible for the next few lines :-) */
! #ifndef MAX_INT
! #include <limits.h>
! #define MXUNIT MAX_INT
! #ifndef MAX_INT
! #define MXUNIT 2147483647
! #endif
! #endif
extern int f__recpos; /*position in current record*/