From owner-freebsd-hackers Thu Mar 29 23:49:15 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from guild.plethora.net (guild.plethora.net [205.166.146.8]) by hub.freebsd.org (Postfix) with ESMTP id 60B9F37B719 for ; Thu, 29 Mar 2001 23:49:12 -0800 (PST) (envelope-from seebs@guild.plethora.net) Received: from guild.plethora.net (seebs@localhost.plethora.net [127.0.0.1]) by guild.plethora.net (8.10.1/8.10.1) with ESMTP id f2U7n8810171; Fri, 30 Mar 2001 01:49:08 -0600 (CST) Message-Id: <200103300749.f2U7n8810171@guild.plethora.net> From: seebs@plethora.net (Peter Seebach) Reply-To: seebs@plethora.net (Peter Seebach) To: Todd Whitesel Cc: tech-kern@netbsd.org, freebsd-hackers@freebsd.org Subject: Re: Question regarding the array of size 0. In-reply-to: Your message of "Thu, 29 Mar 2001 22:47:55 PST." <200103300647.WAA25263@shell17.ba.best.com> Date: Fri, 30 Mar 2001 01:49:07 -0600 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <200103300647.WAA25263@shell17.ba.best.com>, Todd Whitesel writes: >Just put a 1-element array at the end of your header struct, and account for >it when you work out how much extra space to allocate. C memory layout rules >guarantee that this usage will have the desired effect. Nope, not portable. The implementation is allowed to bust you for overstepping the bounds of the array. :) The only portable solution is the new feature in C99. -s To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message