diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2013-01-12 22:41:20 +0200 |
---|---|---|
committer | Fawzi Mohamed <fawzi.mohamed@digia.com> | 2013-01-14 11:50:38 +0100 |
commit | ab74bf651aea3bfedb64a32a967f3b01384ce20f (patch) | |
tree | 9feb6c84b64c2637e8f224c2dd4a4a348ac5c65a /src/libs/zeroconf | |
parent | cd28b2e638242621f4a91ded2bc0594537aad520 (diff) | |
download | qt-creator-ab74bf651aea3bfedb64a32a967f3b01384ce20f.tar.gz |
zeroconf: Fix compiler warning
dereferencing type-punned pointer will break strict-aliasing rules
Change-Id: Id2c66cfcd12dcecc678e6446e8500634cc5babf3
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Diffstat (limited to 'src/libs/zeroconf')
-rw-r--r-- | src/libs/zeroconf/embed/dnssd_clientstub.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libs/zeroconf/embed/dnssd_clientstub.c b/src/libs/zeroconf/embed/dnssd_clientstub.c index eabf084369..d4f75f95c8 100644 --- a/src/libs/zeroconf/embed/dnssd_clientstub.c +++ b/src/libs/zeroconf/embed/dnssd_clientstub.c @@ -757,6 +757,7 @@ static DNSServiceErrorType deliver_request(ipc_msg_hdr *hdr, DNSServiceOp *sdr) struct msghdr msg; struct cmsghdr *cmsg; char cbuf[CMSG_SPACE(sizeof(dnssd_sock_t))]; + dnssd_sock_t *sock; if (sdr->op == send_bpf) // Okay to use sdr->op when checking for op == send_bpf { @@ -784,7 +785,8 @@ static DNSServiceErrorType deliver_request(ipc_msg_hdr *hdr, DNSServiceOp *sdr) cmsg->cmsg_len = CMSG_LEN(sizeof(dnssd_sock_t)); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; - *((dnssd_sock_t *)CMSG_DATA(cmsg)) = listenfd; + sock = (dnssd_sock_t *)CMSG_DATA(cmsg); + *sock = listenfd; #if TEST_KQUEUE_CONTROL_MESSAGE_BUG sleep(1); |