Blobmsg_for_each_attr from C++

Hello,

I am having an issue with using the macro blobmsg_for_each_attr from C++.
The issue is a cast from void* to strcut blob_attr*, the following patch solves the issue for C++.

Is this patch something that would be interesting for lede to be pushed upstream?

--- blobmsg.h.orig 2016-11-25 14:36:57.189940291 +0100
+++ blobmsg.h 2016-11-25 14:37:22.430500595 +0100
@@ -233,7 +233,7 @@

#define blobmsg_for_each_attr(pos, attr, rem)
for (rem = attr ? blobmsg_data_len(attr) : 0, \

  •  pos = attr ? blobmsg_data(attr) : 0; \
    
  •  pos = (struct blob_attr*) (attr ?  blobmsg_data(attr) : 0); \
     rem > 0 && (blob_pad_len(pos) <= rem) && \
     (blob_pad_len(pos) >= sizeof(struct blob_attr)); \
     rem -= blob_pad_len(pos), pos = blob_next(pos))

They might be interested if you post a proper patch to the developer mailing list.
http://lists.infradead.org/pipermail/lede-dev/2016-November/date.html
(or https://www.mail-archive.com/lede-dev@lists.infradead.org/maillist.html )

And this is related to the libubox package, right? Some googling revealed that blobmsg_for_each_attr is defined there. You forgot to mention the specific package that you want to patch...

There were more instances of such missing typecasts. I've pushed a fix to libubox.git, please test.

Reference: http://git.lede-project.org/77a6293

Much appreciated nbd, it works straight out of the box!