From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) by sourceware.org (Postfix) with ESMTPS id 333A63857C66 for ; Thu, 28 Sep 2023 20:07:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 333A63857C66 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=Shaw.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=shaw.ca Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTPS id luFxqXRUzmfeslxHoq3zWq; Thu, 28 Sep 2023 20:07:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=shaw.ca; s=s20180605; t=1695931620; bh=UJqICenzHsmjU/xKugELms/vjox6xANfSkdFWlVSyd4=; h=Date:Reply-To:Subject:To:References:From:In-Reply-To; b=RHKvaxAnxjLPukN/+bkBtexljlq64/ZtlRctoZdJRQi7GMpZXEh3wIgzoSMjsin6/ FUufHw3ottUcxp4m4VhhM8jd7SmIrb1U/+lUnt1udAoer7N+XX/cQk5crEBjQUbTHA rJCnaSeZcp9TcAS+1kvgVONea+I2gHOujgigI1PhcbpctSyhxL5kwd8p00lBqPvOaW UaRx/1pGAYpBiCbTwa2GNbr2nYyCAYN0BfPDsH2QIZ6wm7OS/xFQQyrDpvxuqiJwRb gfonutI8vlzwSiWN+KltikWI1aJ3Zy+V3d3Yg/QW/BotG8AnUL71NHSu9NW2YEN9bh myVTTtv4f2mfw== Received: from [10.0.0.5] ([184.64.102.149]) by cmsmtp with ESMTP id lxHnqqDgbdoEzlxHoqcgT1; Thu, 28 Sep 2023 20:07:00 +0000 X-Authority-Analysis: v=2.4 cv=JeivEGGV c=1 sm=1 tr=0 ts=6515dce4 a=DxHlV3/gbUaP7LOF0QAmaA==:117 a=DxHlV3/gbUaP7LOF0QAmaA==:17 a=IkcTkHD0fZMA:10 a=CCpqsmhAAAAA:8 a=8jU-LGdaNc4hOH3aSbgA:9 a=QEXdDO2ut3YA:10 a=ul9cdbp4aOFLsgKbc677:22 Message-ID: Date: Thu, 28 Sep 2023 14:06:59 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Reply-To: newlib@sourceware.org Subject: Re: fprintf() crashes on wide-oriented stream. Content-Language: en-CA To: newlib@sourceware.org References: <20230926124147.a4dd18b495c6e0347a64fec0@nifty.ne.jp> <20230928125827.b63798bf217baf45c6a5dd22@nifty.ne.jp> <20230928174223.22fa3f5bc2ed7c92170a0db0@nifty.ne.jp> From: Brian Inglis Organization: Inglis In-Reply-To: <20230928174223.22fa3f5bc2ed7c92170a0db0@nifty.ne.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfBHE74OOcF1slpUMQ8X4HM+PRCt8+pqQCfCNsoLM3Fpw8oMjnd+I9G6rseq4drOG9Mo3Esku4T//Bh5MAVNh5IbN2trvSOJRnn0ROi5KDSyWIq9ES6Y9 ZkL3FSA/GSuTnB7HrtqI1Rzl9+iRKer8BIoVDp0QYUMCNTbgOnyw5Yvem7pBk2xuXuEZaVMm0wjxQA== X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,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 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