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: [RFC] fseek, an alternative implementation (PR22359)


Daniel Franke wrote:
While working on the docs last week, I learned, that the FSEEK intrinsic is not implemented yet.

The FSEEK implementation of g77 takes a statement label to jump to, if an error occurs. Since there is no other intrinsic that takes a statement label, considerable effort would be necessary to implement the framework needed. As demand is low (one PR, no dupes, no usage of FSEEK shown by google-code search), it might be worthwile to implement the FSEEK intrinsic for completeness and replace the statement label by a status flag:

  g77:        CALL FSEEK(unit, offset, whence, *100)
  gfortran:   CALL FSEEK(unit, offset, whence, status)
              IF (status /= 0) goto 100

This is not 100% compability, but reasonable close.

I agree that this is the right way to do this. (I think there was actually a fair bit of discussion on the mailing list about this, some months ago, and I'm pretty sure this was the conclusion we reached then as well.)


The infrastructure to put an alternate return -- and an optional one, no less! -- in an intrinsic function is very definitely not worth it just for this one function.

- Brooks


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