This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new 6b40986  porting: Allow to build with -Wcast-align
6b40986 is described below

commit 6b40986a1f508881aea3cbdd8c497627fd3180b3
Author: Szymon Janc <[email protected]>
AuthorDate: Tue Dec 7 12:15:16 2021 +0100

    porting: Allow to build with -Wcast-align
    
    It is expected that mbuf structures are properly aligned so we
    can just cast to void pointer here and silence warning.
---
 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 771ea76..bee47d0 100644
--- a/porting/nimble/include/os/os_mbuf.h
+++ b/porting/nimble/include/os/os_mbuf.h
@@ -133,11 +133,11 @@ struct os_mqueue {
 
 /** Get a packet header pointer given an mbuf pointer */
 #define OS_MBUF_PKTHDR(__om) ((struct os_mbuf_pkthdr *)     \
-    ((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
+    (void *)((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 *)(void *)((uint8_t *)(__hdr) - sizeof(struct os_mbuf))
 
 /**
  * Gets the length of an entire mbuf chain.  The specified mbuf must have a

Reply via email to