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: -frecord-marker


On Tue, Jul 25, 2006 at 09:33:10AM +0100, Keith Bennett wrote:
> On Mon, Jul 24, 2006, Jerry DeLisle wrote:
> > We could put the various record-marker flags into the build_dt so that 
> > every unit will have its own settings depending on options at compile time. 
> > Then this would not depend on the settings for the main program.  To mix 
> > methods within a program, you would have to have separate object files for 
> > each, compiled with different compile time options.
> > 
> > We have 17 unused bits left in the dt structure without increasing the size 
> > any. We could set endian-ness, record-marker size, and I suppose record 
> >  marker scheme
> > at compile time and test bits at run time. That would take 3 bits, 0 for 
> > default, 1 for special.
> > 
> > We could do this without touching OPEN syntax.  It would be left to the 
> > user to sort out the options when compiling.  And then I suppose some 
> > non-standard intrinsics could show up later to set bits on the fly, but 
> > thats another story, and would be very gnuish. (It  could also be 
> > troublesome if not thought through carefully.  You wouldn't want a file 
> > half 32 bit markers, half 64, and part intel)
> > 
> > I think there may be a middle ground approach on this. (or am I being to 
> > easy?)
> 
> That sounds like an excellent suggestion.
> 

No, it is a horrible suggestion.  Perhaps, you missed "It  could also be
troublesome if not thought through carefully.  You wouldn't want a file
half 32 bit markers, half 64, and part intel"  You've just made writing
and maintaining the runtime library more complicated.

Put these 2 subroutines into separate files.

   subroutine foo1  ! Compile with 32-bit marker
     open(unit=1, file='messy', status='append', ....)
     ! Write a bunch of stuff
     close(1)
   end subroutine foo1

   subroutine foo2  ! Compile with 64-bit marker
     open(unit=1, file='messy', status='append', ....)
     ! Write a bunch of stuff
     close(1)
   end subroutine foo2

What happens when foo2 tries to write to 'messy' after foo1
has already done so?  Do we reread the entire file and convert
to 64-bit markers?  Do we issue a runtime error and abort?
Do we mingle the 32-bit and 64-bit markers in the same file?

Is it too difficult to compile the short Fortran program 
that Bud Davis posted to convert 64-bit recorder markers
to 32-bit markers?

We'll have STREAM IO in gfortran shortly.  Is it too difficult
to write your own F2003 compliant conversion tool?

We'll also have the ISO_C_BINDING feature at some point in
the near future.  You guessed it.  You can use this feature to
write a conversion utility.

-- 
Steve


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