|
From: | Stephane Lesage |
Subject: | [lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t) |
Date: | Fri, 05 Feb 2010 03:41:04 +0000 |
User-agent: | Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) |
Follow-up Comment #28, bug #27352 (project lwip): Hi, I tried typedef u32_t ip_addr_t; and redefined the macros of ip_addr.h like #define ip_addr_set(dest, src) (*(dest) = ((src) == NULL ? 0: *(src))) I get the folowing warning about everywhere: "taking the address of a misaligned field is not recommended" just because we use the & operator... and despite an expression like ip_addr_set(&iphdr->src, &iphdr->dest); should perfectly work even when mixing mis/aligned data maybe other compilers will issue an warning/error only when assigning a misaligned pointer to an aligned pointer... anyway we can track the places where we need to copy. Also why not define the macros to work on values instead of pointers ??? _______________________________________________________ Reply to this item at: <http://savannah.nongnu.org/bugs/?27352> _______________________________________________ Message posté via/par Savannah http://savannah.nongnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |