public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@Shaw.ca>
To: newlib@sourceware.org
Subject: Re: fprintf() crashes on wide-oriented stream.
Date: Thu, 28 Sep 2023 14:06:59 -0600	[thread overview]
Message-ID: <f3ff129f-87da-b159-ce1e-3de46a2137dc@Shaw.ca> (raw)
In-Reply-To: <20230928174223.22fa3f5bc2ed7c92170a0db0@nifty.ne.jp>

On 2023-09-28 02:42, Takashi Yano wrote:
> On Thu, 28 Sep 2023 12:58:27 +0900
> Takashi Yano wrote:
>> On Tue, 26 Sep 2023 12:41:47 +0900
>> Takashi Yano wrote:
>>> With this patch, __sfputs_r/__sprint_r is split into two versions, one
>>> is for vfprintf which does not handle wide string, and the other (newly
>>> introduced __sfputws_r/__swprin_r) is for vfwprintf which handles wide
>>> string. Please note that fprintf gets working for wide orient stream
>>> just like BSD libc, which behaves differently from GNU libc.

Note that glibc handles %c/%s in wchar_t functions and %C/%lc/%S/%ls in char 
functions: see `man -m linux 3 fwide` NOTES.

>> I confirmed musl libc also behaves as BSD libc.
>>
>> In the GNU libc (glibc), fprintf() returns -1 with no errno set if the
>> stream is wide-oriented.

That is not documented in released man-pages-linux.
What is documented is that the width setting persists once set, and can not be 
changed until the stream is closed.

> I also confirmed that Solaris libc behaves as same as BSD libc.
> 
> I wonder what are the advantages of the glibc implementation?
> Any historical reason?

What are the behavioural differences you perceive?

There is a public inbox you can search at

	https://inbox.sourceware.org/libc-help/

and you can ask mailto:libc-help@sourceware.org about anything.

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

  reply	other threads:[~2023-09-28 20:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26  3:41 Takashi Yano
2023-09-26  8:30 ` Takashi Yano
2023-10-03  8:30   ` Takashi Yano
2023-10-03 17:31     ` Jeff Johnston
2023-10-03 20:12       ` Takashi Yano
2023-10-03 18:07     ` Brian Inglis
2023-09-28  3:58 ` Takashi Yano
2023-09-28  8:42   ` Takashi Yano
2023-09-28 20:06     ` Brian Inglis [this message]
2023-10-04 20:16   ` Jeff Johnston
2023-10-05 10:18     ` Takashi Yano
2023-10-05 15:18       ` Takashi Yano
2023-10-05 18:20         ` Torbjorn SVENSSON
2023-11-07 13:24         ` Corinna Vinschen
2023-11-07 16:50           ` Brian Inglis
2023-11-07 19:12             ` Corinna Vinschen
2023-11-08 12:05           ` Takashi Yano
2023-11-02 18:53     ` Corinna Vinschen
2023-11-06 18:26       ` Brian Inglis

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=f3ff129f-87da-b159-ce1e-3de46a2137dc@Shaw.ca \
    --to=brian.inglis@shaw.ca \
    --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).