Makes sense.  I'd never heard of unnamed structs and unions before now --
must be a GCC-ism.  I think we want to stick with c99 in illumos (and I'm
sure FreeBSD also wants to avoid GCC-specific language extensions since
they compile the kernel with clang).  But we could accomplish the same
thing in c99 with a more verbose change.  Patches welcome :-)

--matt


On Sat, Jul 26, 2014 at 12:05 PM, Prakash Surya <[email protected]> wrote:

> On a similar note, you may want to take a look at this patch we landed
> on the Linux port. It also deals with compiler array optimizations:
>
>     https://github.com/zfsonlinux/zfs/commit/aca19e0
>
> --
> Cheers, Prakash
>
> On Sat, Jul 26, 2014 at 11:11:59AM -0700, Matthew Ahrens wrote:
> >    [1]https://reviews.csiden.org/r/63/
> >    In dnode\_children\_t, use C99's "\[\]" idiom for declaring the
> >    variable sized array dnc\_children at the end of the structure.
> >    This prevents the compiler from mistakenly optimizing away
> >    accesses beyond the array's defined size.
> >    --matt
> >
> > References
> >
> >    1. https://reviews.csiden.org/r/63/
>
> > _______________________________________________
> > developer mailing list
> > [email protected]
> > http://lists.open-zfs.org/mailman/listinfo/developer
>
>
_______________________________________________
developer mailing list
[email protected]
http://lists.open-zfs.org/mailman/listinfo/developer

Reply via email to