diff mbox series

[v1,1/9] bug: linux-generic: add syntax to allow newer clang to compile odp

Message ID 1500026405-14155-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v1,1/9] bug: linux-generic: add syntax to allow newer clang to compile odp | expand

Commit Message

Github ODP bot July 14, 2017, 9:59 a.m. UTC
From: Bill Fischofer <bill.fischofer@linaro.org>


Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2942 by adding
casts needed to avoid compilation failures when using clang 4.0.0
included in Ubuntu 17.04, which is stricter than clang 3.8.1 which
is in Ubuntu 16.10.

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
/** Email created from pull request 77 (muvarov:monarch_lts)
 ** https://github.com/Linaro/odp/pull/77
 ** Patch: https://github.com/Linaro/odp/pull/77.patch
 ** Base sha: 0c15c40db40834f1df217191c4b6a06303ab0872
 ** Merge commit sha: f06a7319a03ad565ced026ddc76a66164aa93782
 **/
 helper/chksum.c                           | 6 +++---
 platform/linux-generic/odp_packet_flags.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/helper/chksum.c b/helper/chksum.c
index 8f188814..772abcd2 100644
--- a/helper/chksum.c
+++ b/helper/chksum.c
@@ -122,7 +122,7 @@  static inline int odph_process_l4_hdr(odp_packet_t     odp_pkt,
 		 * should come from the udp header, unlike for TCP where is
 		 * derived. */
 		l4_len            = odp_be_to_cpu_16(udp_hdr_ptr->length);
-		pkt_chksum_ptr    = &udp_hdr_ptr->chksum;
+		pkt_chksum_ptr    = (uint16_t *)(void *)&udp_hdr_ptr->chksum;
 		pkt_chksum_offset = l4_offset + offsetof(odph_udphdr_t, chksum);
 	} else if (odp_packet_has_tcp(odp_pkt)) {
 		tcp_hdr_ptr  = (odph_tcphdr_t *)l4_ptr;
@@ -133,7 +133,7 @@  static inline int odph_process_l4_hdr(odp_packet_t     odp_pkt,
 			tcp_hdr_ptr = &tcp_hdr;
 		}
 
-		pkt_chksum_ptr    = &tcp_hdr_ptr->cksm;
+		pkt_chksum_ptr    = (uint16_t *)(void *)&tcp_hdr_ptr->cksm;
 		pkt_chksum_offset = l4_offset + offsetof(odph_tcphdr_t, cksm);
 		is_tcp            = true;
 	} else {
@@ -197,7 +197,7 @@  static inline int odph_process_l3_hdr(odp_packet_t odp_pkt,
 			ipv4_hdr_ptr = &ipv4_hdr;
 		}
 
-		addrs_ptr = (uint16_t *)&ipv4_hdr_ptr->src_addr;
+		addrs_ptr = (uint16_t *)(void *)&ipv4_hdr_ptr->src_addr;
 		addrs_len = 2 * ODPH_IPV4ADDR_LEN;
 		protocol  = ipv4_hdr_ptr->proto;
 		l3_len    = odp_be_to_cpu_16(ipv4_hdr_ptr->tot_len);
diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c
index b88324c1..fc0bc1d2 100644
--- a/platform/linux-generic/odp_packet_flags.c
+++ b/platform/linux-generic/odp_packet_flags.c
@@ -18,7 +18,7 @@ 
 	odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); \
 	if (packet_parse_not_complete(pkt_hdr))          \
 		packet_parse_full(pkt_hdr);              \
-	pkt_hdr->p.x = v & 1;                            \
+	pkt_hdr->p.x = (v) & 1;				 \
 	} while (0)
 
 int odp_packet_has_error(odp_packet_t pkt)