X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B50D385801C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1637577288; bh=HHDILiHzeff8K6iSvPidkmqgvr4gzRblSjpHWCPy9DQ=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=dJRTgOEF/VBfMKZcLhEebTw9K//ecAEPqGanty2RLgUtcTqtG2tDXhxxSBj+9PLBT e8CviNQy9WGxS3ZdbVizXYr1kbS9HKaodmlKPRlNDVXeDfCp0/Q7stAiNC/p+2HP2G CF2rsGF7rHyLbLniGt0+y2rVtpONGtWhVXyq7kwQ= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 662CF3858D35 Date: Mon, 22 Nov 2021 11:34:12 +0100 To: cygwin AT cygwin DOT com Subject: Re: possible snprintf() regression in 3.3.2 Message-ID: Mail-Followup-To: cygwin AT cygwin DOT com References: <20211117003718 DOT GF10332 AT venus DOT tony DOT develop-help DOT com> <20211117182108 DOT b38599f5e13071bf269a0d48 AT nifty DOT ne DOT jp> <20211118000649 DOT GG10332 AT venus DOT tony DOT develop-help DOT com> <20211118203538 DOT a049809d57731fe375801c15 AT nifty DOT ne DOT jp> <7545bb24-43de-cd7d-0764-55c85f1af957 AT gmx DOT com> <20211121001613 DOT GH10332 AT venus DOT tony DOT develop-help DOT com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211121001613.GH10332@venus.tony.develop-help.com> X-Provags-ID: V03:K1:t91i92fcLPptr+X5dS5NIV4wTN6a3DgS/OgIUa0PXmcJn2jP3qR /5t28vziox6lBmgp14r0xooxJMtzhxEoNFTYI/hnRt/Pan5Ftunk4B6dnddWjl0TkF0JYgu A7RNrIw4EpRY3k5WZv2L7gYTo5YqKj92cWW/wXJKtvxgV1syubmO0z+7rWgcx73rfY2wuOC 1XF7aDvOSmaXZaZQt+2Mg== X-UI-Out-Filterresults: notjunk:1;V03:K0:tWRpNTEuIH4=:9ycSiyR8fm4NQVqbWfguu3 Wp4LN5UKVFIvcdVziYapkeGsSVL3BF60fqfanqldb1o/TzFFE49WjymJW6feJR2WM0RV1c6yy SMqVMi5XL6G9F3E3OmhfN/JTj/1aPxPpM9f8g2sH91kMJ/N1qdnKxGFLE74hEAdcuD+YkNqBk uKvLiLO/NNcMk2XGB2+CYW/bNi11+lBAzaT8Crtz4f48AIS+9qkEL3AUdmZVYAeuImj8xWdRs LU+gpcj4o3P07BI+wMZkJ97x9JodFFJFf+Jhk4dlzJjA9TTy/FyRVrWl655JJRgHf1ZRo5xpV kLSnMqXjTD3zYVu22bemUDEnU2OoLzfGxHKPe8bNfnrt3Uzq3rLHJuk/D5x7WLV/xZkgqUDvO 97sphUd2SZt+yzPMveFU+Ozrnu1c1VxcZo76Q8eu+Z6t9MX1JqEUsS6Oi1eHKninEwQFlHXKx BUj32PoLbvCM4cbMubtBOsMbLkUXjYzeSHA17shN8Emg8E6lPRpqIaq+NfxMI6hDNXSpanEJO STr90MUNwiWuefKkVmYoyRkEfLMrHTg90iRGWDCJ31hP1/XiE2NZ9c/Cr7v0Rz29BKoG0DnlR 3wRiUiCzKtu4y/Sqnvx5P10dOLil+G8VAHjAhvpnMRE6KZ4NVv1J7oRc1beqc5ymvlUXpT3jx RtRjj7d4q5giKP1nRuoJ2lXx2v0OkuWQj+HC3pOBYAeunULL0inKlZqjgFWuYXc74SItbXYTZ QgzpRjG+nbYDoqw+ X-Spam-Status: No, score=-98.9 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, 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 AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Corinna Vinschen via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Corinna Vinschen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" On Nov 21 11:16, Tony Cook wrote: > On Thu, Nov 18, 2021 at 09:08:40PM +0000, Sam Edge via Cygwin wrote: > > I use newlib on embedded with threading libs that have predetermined > > fixed thread stack sizes. While we tend to have more RAM than in former > > times we also have multiple thread stacks. Use of alloca() or variable > > length automatic arrays makes me wince especially in code I might not be > > able to avoid calling which is often the case with XXXprintf() in > > third-party libraries' debug output. I'd usually rather take the > > performance hit from using heap instead of having to make all my stacks > > bigger. > > A simple option would be to use an small auto fixed buffer for most > conversions, but use malloc() for %f formats for numbers greater in > magnitude than some limit, though it would also need to be adjusted > for the precision (ndigits here), since they take extra space. > > This would avoid using the optional-to-implement VLA feature too. Good idea. I guess I create a simple fix doing just that. Thanks, Corinna -- 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