mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-13 03:36:59 +08:00
Introduce LWIP_PACKED_CAST to fix error issue with ARMCC
ARMCC when using __packed structures will not implicitly convert a pointer to a member of a packed structure to something which does not have __packed. This results in a compiler error and was found with calls to icmp6_param_problem While there is a #pragma pack mode in ARMCC that disables this error, it does require existing ports to switch over their packing mode and perform integration
This commit is contained in:
@@ -220,6 +220,11 @@ typedef int ssize_t;
|
||||
#define LWIP_PTR_NUMERIC_CAST(target_type, val) LWIP_CONST_CAST(target_type, val)
|
||||
#endif
|
||||
|
||||
/** Avoid warnings/errors related to implicitly casting away packed attributes by doing a explicit cast */
|
||||
#ifndef LWIP_PACKED_CAST
|
||||
#define LWIP_PACKED_CAST(target_type, val) LWIP_CONST_CAST(target_type, val)
|
||||
#endif
|
||||
|
||||
/** Allocates a memory buffer of specified size that is of sufficient size to align
|
||||
* its start address using LWIP_MEM_ALIGN.
|
||||
* You can declare your own version here e.g. to enforce alignment without adding
|
||||
|
||||
Reference in New Issue
Block a user