From owner-freebsd-chat Sun Aug 10 10:42:41 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id KAA02173 for chat-outgoing; Sun, 10 Aug 1997 10:42:41 -0700 (PDT) Received: from kithrup.com (kithrup.com [205.179.156.40]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id KAA02168 for ; Sun, 10 Aug 1997 10:42:39 -0700 (PDT) Received: (from sef@localhost) by kithrup.com (8.6.8/8.6.6) id KAA17395; Sun, 10 Aug 1997 10:42:38 -0700 Date: Sun, 10 Aug 1997 10:42:38 -0700 From: Sean Eric Fagan Message-Id: <199708101742.KAA17395@kithrup.com> To: chat@freebsd.org Subject: Re: variable sized arrays and gcc In-Reply-To: <11989.871200795.kithrup.freebsd.chat@time.cdrom.com> References: Your message of "Sun, 10 Aug 1997 03:22:28 EDT." <199708100722.DAA03236@skynet.ctr.columbia.edu> Organization: Kithrup Enterprises, Ltd. Sender: owner-freebsd-chat@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In article <11989.871200795.kithrup.freebsd.chat@time.cdrom.com> you write: >This has been a gcc feature for ages (and I mean years) but I've >always avoided it in favor of an explicit alloca() call for the same >reason - I don't want code which walks that far outside ANSI's painted >lines. alloca is not ANSI either, Jordan :). Not all systems provide it; not all compilers really have support for it. (You can use Doug Gwyn's "portable" one, but that's iffy.) alloca() was the reason gcc added VLA's in the first place, actually. And the code is the same. The scary part about VLA's is that they mean sizeof() is no longer a evaluated-only-at-compile-time operator.