From nobody Fri Mar 13 13:58:00 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fXQzv6Vgwz6V9SX; Fri, 13 Mar 2026 13:58:03 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fXQzv46v9z3fBN; Fri, 13 Mar 2026 13:58:03 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001b.ext.cloudfilter.net ([10.228.9.171]) by cmsmtp with ESMTPS id 0x4cwEmVjPzKy131ew7F4T; Fri, 13 Mar 2026 13:58:02 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id 131dwAoBBX0jp131dwSasX; Fri, 13 Mar 2026 13:58:02 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=FMIWBuos c=1 sm=1 tr=0 ts=69b417ea a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=Yq5XynenixoA:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=YxBL1-UpAAAA:8 a=rxLMDWAdaBGlTZdBPdgA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy.cwsent.com [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id AF98C289; Fri, 13 Mar 2026 06:58:00 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 7355B1A5; Fri, 13 Mar 2026 06:58:00 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Robert Clausecker cc: Aymeric Wibo , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 4da237aee328 - main - alloca.3: Add entry about defining VLAs in same block as alloca() to BUGS In-reply-to: References: <69b40cd1.27eba.de1cc3f@gitrepo.freebsd.org> Comments: In-reply-to Robert Clausecker message dated "Fri, 13 Mar 2026 14:13:26 +0100." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 13 Mar 2026 06:58:00 -0700 Message-Id: <20260313135800.7355B1A5@slippy.cwsent.com> X-CMAE-Envelope: MS4xfPQ+XnEbppU9NTBMzEwoVAhL7QnCJA6y7+jPSTPo3RXC0HLV1dRevuLhHQWXWwL8io324Pq5dTPmQweOhAWrcV57AZkRDva+tqDkCZQQjA8R/a3VPonm PAhxraolIiJ0QIA4RsG5CIrbIsfpqSbKDVbKQE40wawEBjkArGBvE1owbHDaUfgT6Ep743KH2C7C2rsHtJlOpSknPCc5U3/Nyi7nqSYTbM+AeWGwn/Lm8fp5 rD2RR5zUXkqni2dLJn51TbTNT70+VPFGR2IxxyF98styGdXZ0N6xOphCIeN4ygFMB/PYuafSSVArcCX03MbXNpeX8wm2HXgoH7XEHs35XqweU34we1ZpzL9L X9DYggXA X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4fXQzv46v9z3fBN X-Spamd-Bar: ---- In message , Robert Clausecker writes: > Hi Aymeric, > > Am Fri, Mar 13, 2026 at 01:10:41PM +0000 schrieb Aymeric Wibo: > > Avoid > > .Fn alloca > > with large unbounded allocations. > > +.Pp > > +The use of C99 variable-length arrays and > > +.Fn alloca > > +in the same function will cause the lifetime of > > +.Fn alloca Ns 's > > +storage to be limited to the block containing the > > +.Fn alloca . > > +For example, in the following snippet, > > +.Va p Ns 's > > +lifetime does not extend outside of the block, whereas it would've if > > +.Va vla > > +hadn't been defined or had been defined as a fixed-length array: > > +.Bd -literal -offset indent > > +char *p; > > +{ > > + const int n = 100; > > + int vla[n]; > > + p = alloca(32); > > + strcpy(p, "Hello, world!"); > > + printf("Inside: %s\\n", p); /* Valid. */ > > +} > > +printf("Outside: %s\\n", p); /* Undefined. */ > > +.Ed > > I am unsure if we should document the behaviour of mixing VLAs and > alloca() in the same function as being defined, as that binds us to > support it in the future. I would be a lot more comfortable just > documenting that behaviour is undefined if the two are combined in > one function. Agreed. > > Yours, > Robert Clausecker > > -- > () ascii ribbon campaign - for an encoding-agnostic world > /\ - against html email - against proprietary attachments > -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0