gfortran patch for PR 18778 Abort on endfile on unopened unit

Paul Brook paul@codesourcery.com
Sun Jan 16 14:36:00 GMT 2005


On Saturday 01 January 2005 01:50, Bud Davis wrote:
> RCS file: /cvs/gcc/gcc/libgfortran/io/transfer.c,v
> retrieving revision 1.23
> diff -c -3 -p -r1.23 transfer.c
> *** gcc/libgfortran/io/transfer.c 24 Dec 2004 00:29:07 -0000 1.23
> --- gcc/libgfortran/io/transfer.c 24 Dec 2004 03:23:05 -0000
> *************** us_read (void)
> *** 834,839 ****
> --- 834,842 ----
>     n = sizeof (gfc_offset);
>     p = salloc_r (current_unit->s, &n);
>
> +   if (n == 0)
> +     return;  /* end of file */
> +
>     if (p == NULL || n != sizeof (gfc_offset))
>       {
>         generate_error (ERROR_BAD_US, NULL);

Ok.

Paul



More information about the Fortran mailing list