From owner-freebsd-hackers Wed Mar 6 19:13:47 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [212.22.195.2]) by hub.freebsd.org (Postfix) with ESMTP id 91FEA37B400 for ; Wed, 6 Mar 2002 19:13:42 -0800 (PST) Received: from fanf by chiark.greenend.org.uk with local (Exim 3.12 #1) id 16ioLd-0006fQ-00 (Debian); Thu, 07 Mar 2002 03:13:41 +0000 Date: Thu, 7 Mar 2002 03:13:41 +0000 From: Tony Finch To: freebsd-hackers@freebsd.org Subject: Re: A few questions about a few includes Message-ID: <20020307031341.C19669@chiark.greenend.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <44henw2hqp.fsf@lowellg.ne.mediaone.net> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Lowell Gilbert wrote: > >C-99 requires a fully specified type before the unspecified array (and >requires said array to be the last element in the structure). So this >example is *not* valid in C99, but the following would be: > >struct foo { > int bar; > char array[]; >}; > >[Which makes sense; it forces a structure to have a non-zero size.] Although there has been some discussion in the committee about allowing zero-sized objects in C, the standard doesn't allow them. This is perhaps why it doesn't follow gcc's [0] syntax for variable length arrays at the end of structures. Tony. -- f.a.n.finch THAMES DOVER WIGHT PORTLAND PLYMOUTH: WEST OR SOUTHWEST 5 TO 7 DECREASING 4. DRIZZLE DYING OUT. MODERATE, OCCASIONALLY POOR, BECOMING GOOD. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message