From owner-freebsd-chat Sun Aug 10 11:32:45 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA05010 for chat-outgoing; Sun, 10 Aug 1997 11:32:45 -0700 (PDT) Received: from ethanol.gnu.ai.mit.edu (joelh@ethanol.gnu.ai.mit.edu [128.52.46.64]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id LAA05005 for ; Sun, 10 Aug 1997 11:32:42 -0700 (PDT) Received: by ethanol.gnu.ai.mit.edu (8.8.5/8.6.12GNU) id OAA09511; Sun, 10 Aug 1997 14:32:17 -0400 Date: Sun, 10 Aug 1997 14:32:17 -0400 Message-Id: <199708101832.OAA09511@ethanol.gnu.ai.mit.edu> To: wpaul@skynet.ctr.columbia.edu CC: chat@FreeBSD.ORG In-reply-to: <199708100722.DAA03236@skynet.ctr.columbia.edu> (message from Bill Paul on Sun, 10 Aug 1997 03:22:28 -0400 (EDT)) Subject: Re: variable sized arrays and gcc From: Joel Ray Holveck Reply-to: joelh@gnu.ai.mit.edu Sender: owner-freebsd-chat@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Okay, maybe I haven't been paying attention, but this is the first > time I've ever noticed that gcc would let you do this. Personally, > I think it's damn strange, especially since _no_ other C compiler I > can find behaves the same way. gcc has been doing variable sized arrays for some time. RTFM; it has a section on this and many other non-ANSI GCC features which can make life *much* easier (including things such as a no-side-effect, any-type-argument version of MIN and MAX, printf-style argument checking, etc, etc). > If it's a feature, I don't think it's a particularly good one since > it encourages the use of non-ANSI (and apparently non-portable) > code. Well, in most situations it can be handled portably nearly as easily. But not always. The real question is, what are your priorities? If you are writing an internal program, that is never going to leave your company's walls, use every compiler trick and OS trick you know. If you are writing for FreeBSD, I see no problem using extentions common to both gcc and pcc. (inline, for instance.) But if you are writing a new version of empire, then it's time to use malloc. Happy hacking, joelh -- Second law of programming: Anything that can go wrong wi sendmail: segmentation violation -- core dumped