From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dmta0008.nifty.com (mta-snd00003.nifty.com [106.153.226.35]) by sourceware.org (Postfix) with ESMTPS id 51F6E3858D20 for ; Thu, 28 Sep 2023 08:42:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 51F6E3858D20 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp Received: from HP-Z230 by dmta0008.nifty.com with ESMTP id <20230928084224035.ZFNS.17758.HP-Z230@nifty.com> for ; Thu, 28 Sep 2023 17:42:24 +0900 Date: Thu, 28 Sep 2023 17:42:23 +0900 From: Takashi Yano To: newlib@sourceware.org Subject: Re: fprintf() crashes on wide-oriented stream. Message-Id: <20230928174223.22fa3f5bc2ed7c92170a0db0@nifty.ne.jp> In-Reply-To: <20230928125827.b63798bf217baf45c6a5dd22@nifty.ne.jp> References: <20230926124147.a4dd18b495c6e0347a64fec0@nifty.ne.jp> <20230928125827.b63798bf217baf45c6a5dd22@nifty.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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. > > 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. 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? -- Takashi Yano