gfortran patch - g77 record markers

bud davis bdavis9659@comcast.net
Tue May 31 22:22:00 GMT 2005


Richard E Maine wrote:

> On May 31, 2005, at 9:42 AM, Steve Kargl wrote:
>
>> On Tue, May 31, 2005 at 07:02:11PM +0300, jblomqvi@cc.hut.fi wrote:
>>
>>> The choice of default record marker is made at link time by linking in
>>> different libraries...
>>
>
>> I was wondering about the need for 2 separate, complete, libraries...
>
>
> I wonder about the tradeoff of overhead vs functionality here. As 
> Steve notes, the overhead seems a bit high. Let me add that this 
> approach limits the functionality. High overhead plus limited 
> functionality seems like a combination to make one wonder.
>
> The limitation in functionality is that a link-time option is, unless 
> I'm quite confused about what you mean, inherently all-or-nothing. 
> There is presumably no way to specify one form for some files, but a 
> different form for others. It seems to me that it is pretty plausible 
> for someone to want to be able to read or write a file with a 
> different record-mark scheme without changing every other file used by 
> the program.
>
> In fact, one scenario occurs to me as extremely simple and likely to 
> occur. How does one write a program to copy a file to one with a 
> different record-mark scheme if the selection is made at link time?
>


in case some of the other replies haven't covered this, here is how I 
intend for it to work.

The default record mark is determined at link time, by inserting a 
routine that sets a global preference in the library.

This preference is used everytime a unit is opened; which could be 
changed by an environment variable or by an additional paramter to the 
OPEN statement, or a sense switch on the console.   { all of these 
options are not implemented, but the framework is in place }

All of the different kinds of record markers are implemented in one 
file, io/record_mark.c.  The additional libraries just have one routine, 
it sets the default when the main routine executes.  Using a library for 
this was the only way I could figure out how to do it with the gcc build 
process...Paul Brook has some ideas on making it cleaner.

Overall, I think the implementation is good, with the exception of using 
an entire library for the initialization routine.  It gives the most 
flexibility, and there is no performance penalty (de-referencing a 
function pointer...which is kinda in the noise).

You can't write a program which converts from one record mark to the 
other now; but I think adding an option to the open statement will be an 
easy patch to create...all the infrastructure is in place with this patch.

BTW, thanks for all the comments.


--bud



More information about the Fortran mailing list