This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Buglet in fseek?
On Feb 20 18:27, Jeff Johnston wrote:
> Corinna Vinschen wrote:
> >On Feb 20 11:44, Jeff Johnston wrote:
> >
> >>Regarding your other note, we could make my initial solution simpler.
> >>fflush() on a read-only stream sets the _SNPT flag on and fseek() clears
> >>it appropriately after doing the lseek. This solves the problem and
> >>doesn't care about what is done in-between. If you fflush() a read-only
> >>stream, then the next fseek()/rewind() you do will be unoptimized. I
> >>think that is fair.
> >
> >Yep, that sounds good to me.
>
> Alright, I have checked in the attached patch. I debugged the two
> scenarios to verify it was optimizing without the flush and not
> optimizing with the flush.
Cool, that works nicely.
Thank you,
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat