[fortran] patch for PR 12921 - Direct Access I/O doesn't work

Steven Bosscher stevenb@suse.de
Wed Mar 3 07:18:00 GMT 2004


On Saturday 28 February 2004 13:55, bud davis wrote:
>  2004-02-28  Bud Davis  <bdavis9659@comcast.net>
>
>         * trans-io.c (gfc_trans_open): Change RECL= to a value parameter.
>         * io.h, transfer.c, open.c : recl_in changed from ptr to variable.
>         * open.c (new_unit): Moved test for positioned direct access error.
>         * open.c (init_units): Corrected calculation of max records.


> --- 306,336 ----
>         }
>       }
>
> !   if (flags->position != POSITION_ASIS && flags->access == ACCESS_DIRECT)
> !   {
> !          generate_error (ERROR_OPTION_CONFLICT,
> !                          "ACCESS parameter conflicts with SEQUENTIAL access in "
> !                          "OPEN statement");
> !          goto cleanup;
> !   }
> !   else
> !     if (flags->position == POSITION_UNSPECIFIED)
> !       flags->position = POSITION_ASIS;
> !

Please also fix the indenting here...


> --- 338,349 ----
>     /* Calculate the maximum file offset in a portable manner.  It is
>      * assumed to be a power of two minus 1. */
>
> !   /* this works when max_offset is 32 bits. */
> !
> !   g.max_offset = 0;
> !   for (i=0; i < sizeof(g.max_offset) * 8 - 1; i++)
> !        g.max_offset = g.max_offset + ((offset_t) 1 << i);
>
>   }

...and here.

It's not obvious where this computation comes from.  I have to
admit I'm not exactly sure what's going on here.  For example,
what about 64 bits?  Perhaps you can add a comment?

Otherwise OK.

Gr.
Steven




More information about the Fortran mailing list