From cdf2d4baf376e4a3030a2c1169516358b4fba2e5 Mon Sep 17 00:00:00 2001 From: Przemyslaw Szczerbik Date: Thu, 25 Feb 2016 19:01:20 +0100 Subject: lib: add type casting for nla_for_each_nested macro g++ is unable to compile code with nla_for_each_nested macro due to implicit type conversion from void* to nlattr*. This patch adds type casting for nla_for_each_nested macro to address this issue. Signed-off-by: Przemyslaw Szczerbik Signed-off-by: Thomas Haller http://lists.infradead.org/pipermail/libnl/2016-February/002095.html --- include/netlink/attr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/netlink/attr.h b/include/netlink/attr.h index ee159aa..e941a1a 100644 --- a/include/netlink/attr.h +++ b/include/netlink/attr.h @@ -325,7 +325,7 @@ extern int nla_is_nested(const struct nlattr *); * @arg rem initialized to len, holds bytes currently remaining in stream */ #define nla_for_each_nested(pos, nla, rem) \ - for (pos = nla_data(nla), rem = nla_len(nla); \ + for (pos = (struct nlattr *) nla_data(nla), rem = nla_len(nla); \ nla_ok(pos, rem); \ pos = nla_next(pos, &(rem))) -- cgit v0.12