[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/sys/kern
On Tue, Jan 31, 2012 at 09:51:17PM +0000, Alexander Nasonov wrote:
> Joerg Sonnenberger wrote:
> > That's still not necessarily optimal, depending on the padding rules of
> > the platform. You want to do offsetof(s, m) + n * sizeof((s*)NULL->m).
> Using m inside offsetof is non-standard but I think this will work:
> offsetof(s, m) + n * sizeof((s*)NULL->m).
I don't believe there is a problem using m, just m[non-constant-expr].
OTOH 'sizeof (s *)0->m' might be deemed invalid (because it has
an inferred dereference of NULL.
David Laight: david%l8s.co.uk@localhost
Main Index |
Thread Index |