https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59513
Manfred Schwarb <manfred99 at gmx dot ch> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manfred99 at gmx dot ch
--- Comment #22 from Manfred Schwarb <manfred99 at gmx dot ch> ---
I just encountered the same issue, with some convoluted legacy code.
The scheme seems to be the same:
READ(lun,END=100) buffer
100 WRITE(lun,*) "whatever"
As the used code definitely was used in practice, mainly before the year
2000, I guess that older compiler supported this.
And yes, the BACKSPACE() trick works. However, common sense suggest
that with END= we are at the end of the file. This sounds a bit like the
old joke, where you have a room with 5 people, you are taking 6 out, so
someone has to go in for the room to be empty. Beyond EOF simply does
not exist.
Jerry, concerning your cited standard:
"If the file contains an endfile record" suggests that there is some
special marker in the file to be read/written.
In this example, we are doing some formatted IO to a plain text file,
there are no special markers.
Do I miss something?
What does/should ftell() report in such a case? That we are one
character beyond EOF?