1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/nimble/patches/0001-porting-nimble-silence-Wcast-align.patch
Marian Buschsieweke 79103d3156
pkg/nimble: add -Wno-cast-align
Also brutally silence -Wcast-align warnings in OS_MBUF_PKTHDR()
and OS_MBUF_PKTHDR_TO_MBUF(), as those are used by nimble users.

It might make sense to check if the silenced / disabled warnings do
indeed point out unaligned memory accesses.
2021-12-03 10:12:33 +01:00

32 lines
1.2 KiB
Diff

From ba0f5ceb2aeaa6c2aab5c20c79597d306d360900 Mon Sep 17 00:00:00 2001
From: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Date: Thu, 4 Nov 2021 15:38:38 +0100
Subject: [PATCH] porting/nimble: silence -Wcast-align
---
porting/nimble/include/os/os_mbuf.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/porting/nimble/include/os/os_mbuf.h b/porting/nimble/include/os/os_mbuf.h
index 771ea761..e5ca0617 100644
--- a/porting/nimble/include/os/os_mbuf.h
+++ b/porting/nimble/include/os/os_mbuf.h
@@ -132,12 +132,12 @@ struct os_mqueue {
((__om)->om_pkthdr_len >= sizeof (struct os_mbuf_pkthdr))
/** Get a packet header pointer given an mbuf pointer */
-#define OS_MBUF_PKTHDR(__om) ((struct os_mbuf_pkthdr *) \
+#define OS_MBUF_PKTHDR(__om) ((struct os_mbuf_pkthdr *)(uintptr_t) \
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
/** Given a mbuf packet header pointer, return a pointer to the mbuf */
#define OS_MBUF_PKTHDR_TO_MBUF(__hdr) \
- (struct os_mbuf *)((uint8_t *)(__hdr) - sizeof(struct os_mbuf))
+ (struct os_mbuf *)(uintptr_t)((uint8_t *)(__hdr) - sizeof(struct os_mbuf))
/**
* Gets the length of an entire mbuf chain. The specified mbuf must have a
--
2.33.1