This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR26890 SIZE parameter interacts with same variable in IO list.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]