Avoid casts between unsigned char * and struct nlmsghdr
The virNetlinkCommand() method takes an 'unsigned char **'
parameter to be filled with the received netlink message.
The callers then immediately cast this to 'struct nlmsghdr',
triggering (bogus) warnings about increasing alignment
requirements
util/virnetdev.c: In function 'virNetDevLinkDump':
util/virnetdev.c:1300:12: warning: cast increases required alignment of target type [-Wcast-align]
resp = (struct nlmsghdr *)*recvbuf;
^
util/virnetdev.c: In function 'virNetDevSetVfConfig':
util/virnetdev.c:1429:12: warning: cast increases required alignment of target type [-Wcast-align]
resp = (struct nlmsghdr *)recvbuf;
Since all callers cast to 'struct nlmsghdr' we can avoid
the warning problem entirely by simply changing the
signature of virNetlinkCommand to return a 'struct nlmsghdr **'
instead of 'unsigned char **'. The way we do the cast inside
virNetlinkCommand does not have any alignment issues.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
Showing
-
mentioned in commit 0869cab5
-
mentioned in commit 56f11b41
-
mentioned in commit 3690a782
-
mentioned in commit cac0038a
-
mentioned in commit 717f5b94
-
mentioned in commit ee0349c3
-
mentioned in commit a5314b47
-
mentioned in commit fe4fc3fd
-
mentioned in commit 43502149
-
mentioned in commit 38dce339
-
mentioned in commit 096120f5
-
mentioned in commit 644eb23f
-
mentioned in commit 16d10743
-
mentioned in commit 94be529b
-
mentioned in commit 6842f148
-
mentioned in commit 7caed3d4
想要评论请 注册 或 登录