X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT 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: 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 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> In-Reply-To: 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 AT cygwin DOT com X-Mailman-Version: 2.1.29 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Noel Grandin via Cygwin Reply-To: Noel Grandin Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Cygwin" 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