Desire to allocate bit in DT_PARM bitmask for DEC FORMAT compatibility purposes
Jerry DeLisle
jvdelisle@charter.net
Fri Mar 23 14:46:00 GMT 2018
On 03/23/2018 01:38 AM, Jakub Jelinek wrote:
> On Fri, Mar 23, 2018 at 09:12:21AM +0100, Jakub Jelinek wrote:
>>> I have some philosophical questions.
>>>
>>> 1) Why do you want 15, 7, 2? Why is this so critical?
>>
>> Because that is what all those compilers document and agree on.
>> See e.g.
>> https://software.intel.com/en-us/node/678750#32937290-265D-4805-B2B7-4E78F6AAD0D8
>> for Intel documentation, I'm sure Jeff has links to other documentations.
>
> BTW, it seems libgfortran already has a similar extension, at least my
> reading of the standards (checked 97 and 2003) is that for Lw the standard
> doesn't allow omitting the width, but we allow that as extension:
> else
> {
> fmt->saved_token = t;
> notify_std (&dtp->common, GFC_STD_GNU,
> "Positive width required with L descriptor");
> }
> fmt->value = 1; /* Default width */
> (and sadly different from what Intel Fortran does, because it uses 2).
> Wonder about other compilers, if they all agree on 2, perhaps we should
> behave above differently based on the new bit?
>
> Jakub
>
Putting on my "practical" hat, if an application writes large volumes of
data to a formatted file as a means of intermediate storage and then
reads it back in for further processing and uses tab specifiers to
position the read to get at a certain field, they would be screwed with
gfortran.
I agree that with so many other compilers doing this, we should do so.
The warning we issue should state that there is a loss of precision in
formatted file I/O.
Also I wonder if we should test the bit in set_fnode_default and do the
changes there so they are all in one place and all the other default
formatting should just work. For example, write(6, *) would use the
smaller widths if the flag is set.
Also, could someone point me to a a real good example of this kind of
DEC Fortran code so I can get a better feel for this.
Regards,
Jerry
More information about the Fortran
mailing list