diff options
author | João Valverde <j@v6e.pt> | 2023-01-13 19:57:35 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2023-01-13 22:41:04 +0000 |
commit | dfc992466efecc97a44bb0a8b97ce15cafc61d01 (patch) | |
tree | 0e7c776e9bc134570ee1f1d02310d30fc0ae82bd /capture | |
parent | b487b7fcfe4990f6f35cb9df93e960f081cedbb1 (diff) |
MinGW: Fix -Wstrict-aliasing
capture-pcap-util.c:561:23: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
561 | *((guint32 *)&(ai->sin_addr.s_addr));
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Diffstat (limited to 'capture')
-rw-r--r-- | capture/capture-pcap-util.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/capture/capture-pcap-util.c b/capture/capture-pcap-util.c index bf85173920..f3d2dadc95 100644 --- a/capture/capture-pcap-util.c +++ b/capture/capture-pcap-util.c @@ -557,8 +557,7 @@ if_info_add_address(if_info_t *if_info, struct sockaddr *addr) ai = (struct sockaddr_in *)(void *)addr; if_addr = (if_addr_t *)g_malloc(sizeof(*if_addr)); if_addr->ifat_type = IF_AT_IPv4; - if_addr->addr.ip4_addr = - *((guint32 *)&(ai->sin_addr.s_addr)); + if_addr->addr.ip4_addr = ai->sin_addr.s_addr; if_info->addrs = g_slist_prepend(if_info->addrs, if_addr); break; |