Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Mar 2001 01:49:07 -0600
From:      seebs@plethora.net (Peter Seebach)
To:        Todd Whitesel <toddpw@best.com>
Cc:        tech-kern@netbsd.org, freebsd-hackers@freebsd.org
Subject:   Re: Question regarding the array of size 0. 
Message-ID:  <200103300749.f2U7n8810171@guild.plethora.net>
In-Reply-To: Your message of "Thu, 29 Mar 2001 22:47:55 PST." <200103300647.WAA25263@shell17.ba.best.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103300749.f2U7n8810171>