mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-10 01:09:26 +00:00
remove a warning building a test
With my compile switches (which are mostly derived from RedHat spec
file) I'm getting this warning:
stream-test.c: In function 'sock_fd_read':
stream-test.c:66:43: warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing]
*fd = *((int *) CMSG_DATA(cmsg));
^
memcpy could decrease performance but as this is a test it's not
an issue.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
fb10f5bf52
commit
fa0c32f120
@ -63,7 +63,7 @@ sock_fd_read(int sock, void *buf, ssize_t bufsize, int *fd)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
*fd = *((int *) CMSG_DATA(cmsg));
|
||||
memcpy(fd, CMSG_DATA(cmsg), sizeof(*fd));
|
||||
} else
|
||||
*fd = -1;
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user