libnl3. Please make read-only arguments as "const"
Марк Коренберг
socketpair at gmail.com
Fri Jan 27 01:11:42 EST 2012
2012/1/27 Марк Коренберг <socketpair at gmail.com>
> For example, in nla_parse_nested(), last argument (struct nla_policy
> *policy) may be decalred as "const struct nla_policy * policy".
> It will allow me to write
>
> static const struct nla_policy my policy {
>> ...
>> }
>
>
> and gcc will place this memory in read-only memory segment instead of
> writable one. Also, const items are subjects for optimisations in gcc.
>
>
> --
> Segmentation fault
>
>
--
Segmentation fault
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20120127/9ad598a6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-make-_policy-static.patch
Type: text/x-patch
Size: 23964 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20120127/9ad598a6/attachment-0001.bin>
More information about the libnl
mailing list