net/net_cmsg.c: Fix warning about using void* arithmetics
utils/net_cmsg.c: In function 'cmsg_append': utils/net_cmsg.c:82:23: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith] 82 | msg->msg_control += cmsgspace; | ^~ cc1: all warnings being treated as errors Using void pointers in arithmetic operations is a GCC extension, it is not supported by the standard. Because what is the size of a void ?
This commit is contained in:
parent
3161005c40
commit
1e9560e1e5
|
@ -79,7 +79,7 @@ FAR void *cmsg_append(FAR struct msghdr *msg, int level, int type,
|
|||
memcpy(cmsgdata, value, value_len);
|
||||
}
|
||||
|
||||
msg->msg_control += cmsgspace;
|
||||
msg->msg_control = (char *)msg->msg_control + cmsgspace;
|
||||
msg->msg_controllen -= cmsgspace;
|
||||
|
||||
return cmsgdata;
|
||||
|
|
Loading…
Reference in New Issue