On Sonntag, 9. Oktober 2016 04:07:10 CEST Linus Lüssing wrote:
On Thu, Sep 15, 2016 at 03:52:49PM +0200, Sven Eckelmann wrote:
+sed -i \
- -e 's/^static const struct genl_multicast_group batadv_netlink_mcgrps/static struct genl_multicast_group batadv_netlink_mcgrps/' \
- -e 's/^static const struct nla_policy batadv_netlink_policy/static const struct nla_policy batadv_netlink_policy/' \
For the second thing: Replacing the string with itself?
Damn, you are right. This line can be removed anyway. So it is not "a big problem" but ugly as hell :)
Just wondering... I simply tried casting the const away and that seems to compile without a warning:
[...]
Or does this lead to some dangerous behaviour on the compiler side?
Yes, this will crash because it is const aka read-only and the compat code cannot write to the struct (actually, the read-only page).
Kind regards, Sven