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)


Tobias Schlüter wrote:
Daniel Franke wrote:
Please find a preliminary patch that implements FSEEK using a status flag attached. Of course, this implementation (still) has the same problems with casting/assigning of the status flag as the other intrinsics.

I don't like the idea of introducing new extensions. If we do this, we can't ever implement a g77 compatible solution without going to extra lengths, such as command line flags. I'd rather we keep waiting until someone needs this badly enough that they implement it in a way compatible with g77.

But this is false; Daniel's STATUS suggestion doesn't interfere with implementing a g77-compatible solution. An integer argument is sufficiently different from an alternate-return argument as to cause no possible ambiguity to the parser, and handling both would be barely more effort than handling both integer and real arguments to the same intrinsic.


Besides, nobody will ever implement it in a way compatible with g77. And even if they do, I would very strongly recommend that we should NOT approve it; the effort of _maintaining_ the extra machinery for the optional alternate return in an intrinsic is nowhere near worth the trouble.

Thus, if someone does need this feature enough to implement it, my recommendation to them would be implement the STATUS feature and switch their code to use that.

Also, in a different message, Tobias Schlüter wrote:
François-Xavier Coudert wrote:
And what about having a FSEEK with neither status flag nor optional
label. That way, it's still better than what we currently have, and
we're not introducing a new extension.

That sounds like the right way to proceed.

Why? If someone does have an FSEEK with an optional label, putting in the STATUS flag at least means they can easily switch to the new syntax. If we leave it out, the functionality of the function is entirely broken for them, as it doesn't have any way at all to signal an error, and they'll have to completely rewrite their code.


- Brooks


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