This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: PR26890 SIZE parameter interacts with same variable in IO list.
- From: Paul Thomas <paulthomas2 at wanadoo dot fr>
- To: Jerry DeLisle <jvdelisle at verizon dot net>
- Cc: Fortran List <fortran at gcc dot gnu dot org>
- Date: Tue, 28 Mar 2006 06:39:58 +0200
- Subject: Re: PR26890 SIZE parameter interacts with same variable in IO list.
- References: <4428B538.3090500@verizon.net>
Jerry DeLisle wrote:
I need some input on this one.
The problem here is very easy to fix. The *dtp-size is set to point
to the SIZE parameter set in the READ or WRITE statement. It is then
used to accumulate the number of bytes transferred. So if that
variable also happens to be referenced in the the IO list, it gets
clobbered when the I/O is initialized.
This is, of course, why the construct is non-standard (incidentally,
have you checked my assertion of this?).
The easy fix is to use another integer variable to accumulate the size
and then assign it to the SIZE parameter as part of the finalize_transfer.
I just suggested that on Bugzilla.
The problem is, to do this I have to add a variable to the dtp
structure. This will effect compatibility with previous versions of
the library.
Does it have to be an extra field on the dtp structure? Surely, a static
variable would do the job, wouldn't it?
Also, I notice that at the end of the dtp structure there is the
following:
char pad[16 * sizeof (char *) + 34 * sizeof (int)];
What is this for? Can I add an integer and reduce the size of this
pad accordingly? This sure is not documented anywhere. And I do not
see it used anywhere.
If it is not used, it could be used for temporaries. It's name imples
that it is being used for alignment purposes but the space allocated
belies that.
Paul