[RFC] _gfortran_{ioparm,filename,line} vs. thread-safety

Steve Kargl sgk@troutmask.apl.washington.edu
Mon Oct 3 18:15:00 GMT 2005


On Mon, Oct 03, 2005 at 05:53:20AM -0400, Jakub Jelinek wrote:
> ATM I'm thinking of something like the following patch (just the io.h
> bits, will need to change libfortran/{io/*,runtime/error.c} as well to
> prove that it could work, plus then modify trans-io.c to match it.

I like this approach.  Note, I haven't gone through all
the details; however, I do have one comment.

>  
>  typedef struct
>  {
> +  GFC_INTEGER_4 flags;

Is this large enough for future flags?  Fortran 2003 has
added at least STREAM IO.  I don't know how many, if any,
flags will be needed.

>    GFC_INTEGER_4 unit;
> -  GFC_INTEGER_4 err, end, eor, list_format; /* These are flags, not values.  */
> +  const char *filename;
> +  GFC_INTEGER_4 line;
> +  CHARACTER2 (iomsg);
> +  GFC_INTEGER_4 *iostat;
> +}
> +st_parameter_common;

(snip)

> +#define IOPARM_INQUIRE_HAS_READWRITE	(1 << 26)
  
You've used 26 of the 32 available bits.  Perhaps,
we need "GFC_INTEGER_8 flags".

-- 
Steve



More information about the Fortran mailing list