This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: sungetc
- From: Joe Buck <Joe dot Buck at synopsys dot com>
- To: jason at redhat dot com (Jason Merrill)
- Cc: Joe dot Buck at synopsys dot COM (Joe Buck), libstdc++ at gcc dot gnu dot org
- Date: Wed, 17 Apr 2002 17:11:51 -0700 (PDT)
- Subject: Re: sungetc
> >> So if there's already a putback position, sungetc returns the character
> >> ungotten. If there isn't one, but we can create one, sungetc returns some
> >> random non-EOF value. ...
I wrote:
> > You can usefully use sungetc if you know that there is never more than
> > one pushback character...
Jason wrote:
> I think you misunderstood my point. I was complaining about the
> specification of the return value, not the size of the putback buffer.
> IMO, if we can put back a character, we should return that character.
Yes, you're right, I was confused by the language about putback positions,
I thought it meant that the putback buffer was already full.
> Currently, if we do a putback when we are at the beginning of the read
> buffer, we return 0, whereas if we are in the middle of the read buffer we
> return the character.
I agree that this seems odd and useless.