[grsec] Q. 'const'antify the members of a structure

pageexec at freemail.hu pageexec at freemail.hu
Fri May 28 08:21:12 EDT 2010


On 28 May 2010 at 20:45, J. R. Okajima wrote:

> 
> pageexec at freemail.hu:
> > so in this case what you can do is similar to what PaX does in drivers/ata/libata-core.c:
> >
> > -       ops->inherits = NULL;
> > +       ((struct ata_port_operations *)ops)->inherits = NULL;
> 
> It is a 'const struct foo_ops *ops' case
> instead of 'struct foo_ops { void (* const f)() }' case, isn't it?

yes, it was just an example for how you use the explicit cast as a form
of documentation in such cases.



More information about the grsecurity mailing list