public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Corinna Vinschen <vinschen@redhat.com>
To: newlib@sourceware.org
Subject: Re: [PATCH] newlib: libc: Fix bugs in the commit 3d94e07c49b5.
Date: Fri, 10 Nov 2023 17:08:40 +0100	[thread overview]
Message-ID: <ZU5ViCXafrBbt/Yj@calimero.vinschen.de> (raw)
In-Reply-To: <ZU5Jmdcz0YQ2L4Je@calimero.vinschen.de>

On Nov 10 16:17, Corinna Vinschen wrote:
> Didn't you forget ungetwc?
> 
> But then again, I checked GLibC, and there's something weird:
> 
> ungetc does not at all set or test the orientation.
> 
> ungetwc sets the orientation to 1, but doesn't check it.
> 
> Puzzeling.  I wonder about the reasoning behind this.

Apparently, ungetwc has been added only later.  ungetc, OTOH, was
defined in a way which allowed to use it on wide-char oriented streams
as well.

So the stance in GLibC is, for backward compatibility reasons, ungetc
can't and must not check or set the orientation at all.

The fact that ungetwc doesn't test the orientation might be a bug in
glibc.  We can follow suit (being "bug-compatible" :)), or we can test
the orientation.  Given that using the correctly oriented functions is
ultimately the responsibility of the application, both ways to handle
this should be fine.


Corinna


  parent reply	other threads:[~2023-11-10 16:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-10 11:34 Takashi Yano
2023-11-10 15:17 ` Corinna Vinschen
2023-11-10 16:05   ` Takashi Yano
2023-11-10 16:08   ` Corinna Vinschen [this message]
2023-11-10 16:33     ` Takashi Yano
2023-11-13 13:05       ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZU5ViCXafrBbt/Yj@calimero.vinschen.de \
    --to=vinschen@redhat.com \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).