X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A23C385AC32
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1637244755;
	bh=ahwjgM5/livFWk+1efAYDH+oGr2H2AOLtUZx1BT1kZQ=;
	h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=b9mTfp9o5kankqMNiXS222SQ2XXGUVI2z56aAefZbCVPTewWx8JtGejeV9rG2q5cn
	 vqg+xO9R9T8XMlwnG0A0cgxWkw8GSN8lJAqSUHIVDGINFhE7T6ALKdnvSRRtP6PjmP
	 ZK2Qtur2wmkoPqKLzLJS7DJsYyGXAz/EJ2jvNFw0=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D0F593857C6F
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:message-id:date:mime-version:user-agent:subject
 :content-language:to:references:from:in-reply-to
 :content-transfer-encoding;
 bh=ROk+PTACDdrxuqTSEEM7t1s3u91xbhMrwmRs/fY2XpY=;
 b=OKZ96OOA1m2i6PUt10Q5rdIOutnU1paoCJVaGZ/8PYd2iE2u8nODLiJHgjVUOQgJtB
 GmCsqI2+CPn2JrmSwfHQTwAyZGvnztkiGmKR/urqmuqmFRllmCQTuQDZtNLG9TdNtAp5
 YpwTOZBHzz6/uC/kalyu44gMPIdFk4mxxfxJ4j5V0IerrwmyFkXKoHMNhFtO7c3V3hzA
 RM467KDK7nz+SRkBMc1fHlqr4y2ZkWklLeEfR6nERRy30WIbkkX3lYkXsXfxNyWdCRk0
 lced4zfBOCiyuXAfmXi68GklAMT3+muRNHipLmp2o31JOblwfcN8QDv4wstoNMTO9pis
 aB7w==
X-Gm-Message-State: AOAM533R0EYFNGr6ET0jT4rMnLupc0b8rG9aQV2B33oEKuOrAz8HnTnP
 DSE3f4X2J/uk+i6sblk5ozhhvCdUrV8=
X-Google-Smtp-Source: ABdhPJy6rz1WNH4QcK28Sec9MUbkYwla+oKeJHAATJUGY7BT1pYl5YqnRl5hcu4SSyzHDKaVHIo7aw==
X-Received: by 2002:a17:906:9b8d:: with SMTP id
 dd13mr33840670ejc.531.1637244669562; 
 Thu, 18 Nov 2021 06:11:09 -0800 (PST)
Message-ID: <fa647f83-c5ed-6dea-fcba-c8b799abe12f@gmail.com>
Date: Thu, 18 Nov 2021 16:11:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
 Thunderbird/91.3.1
Subject: Re: possible snprintf() regression in 3.3.2
Content-Language: en-GB
To: cygwin@cygwin.com
References: <20211117003718.GF10332@venus.tony.develop-help.com>
 <20211117182108.b38599f5e13071bf269a0d48@nifty.ne.jp>
 <YZT1S8wDnaBuYf5u@calimero.vinschen.de>
 <20211118000649.GG10332@venus.tony.develop-help.com>
 <20211118203538.a049809d57731fe375801c15@nifty.ne.jp>
 <YZZSzPhbqF6cQAiu@calimero.vinschen.de>
In-Reply-To: <YZZSzPhbqF6cQAiu@calimero.vinschen.de>
X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT,
 NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
 TXREP autolearn=ham autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Noel Grandin via Cygwin <cygwin@cygwin.com>
Reply-To: Noel Grandin <noelgrandin@gmail.com>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>



On 2021/11/18 3:19 pm, Corinna Vinschen via Cygwin wrote:
> My patch raised NDEC from 43 to 1023 to allow aproximately the same
> number of digits as glibc.  Newlib strives to support embedded targets
> and bare metal.  Some of them are lucky if they have a stack size of 1K.
> The outbuf buffer is created on the stack, so I used ndigits to save
> stack space.
> 
> While that patch fixes the reported problem, it will make users of
> smaller-than-Cygwin targets pretty unhappy.
> 
> A workaround would be to malloc outbuf instead.  Given that printf

printf is often performance sensitive, and using malloc there would likely be significantly slower.

Possibly use alloca() to allocate only the necessary amount on stack?
Seems unlikely that embedded systems would be printing values that needed such large space anyway.

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
