> On 15 Jan 2015, at 12:35, Joerg Sonnenberger <jo...@britannica.bec.de> wrote:
> 
> On Wed, Jan 14, 2015 at 11:44:00PM +0000, Robert Watson wrote:
>>  - As we anticipate embedding mbufs headers within variable-size regions of
>>    memory in the future, change the definitions of byte arrays embedded in
>>    mbufs to be of size [0] rather than [MLEN] and [MHLEN].
> 
> This is not valid C. You may be able to use flexible array members ([])
> instead.

Life is not that simple -- see the Phabricator review discussion which 
considers this point in detail. The short version is: using [] for the last 
entry in a union within a structure is explicitly disallowed in the C spec, 
actually works fine with [0] in gcc + extensions, which are a feature used in 
the kernel already. If in doubt, try replacing [0] with [] and recompiling, 
it's an instructive and morally improving process. We will want to feed this 
back to the C standardisation folk at some point.

Robert
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to