Mindaugas Rasiukevicius wrote:
> +     pcq = kmem_zalloc(offsetof(pcq_t, pcq_items[nitems]), kmflags);

I'm not sure that this is a valid use of offsetof. C99 (7.17/3) defines
it as

        offsetof(type, member-designator)

I don't see a definition of member-designator, but the designator is
defined as

        designator:
                [ constant-expression ]
                . identifier

nitems in pcq_items[nitems] is not a constant expression.

Alex

Reply via email to