More observations about structure packing: In gcc, it seems the __attribute__((packed)) is inherited by all sub-structures. But in armcc, the compiler disallows normal structures from being members of __packed structures. So simply making 'struct ipaddr' unpacked isn't going to work for all compilers. Maybe there should be a packed and unpacked version of struct ipaddr, so that the compiler doesn't have to generate unaligned support code everywhere struct ipaddr is used.
I think Pedro is right and just about any compiler that supports packed structures must support assigning, referencing or copying unaligned uint32 members. ip_addr2 first came into use in etharp.c:1.55 on 04/27/04 to fix bug #8708. Leon or Timmy, do you happen to remember which was the offending compiler that couldn't generate the right code for this case? Or was the code really doing something illegal like *(uint32 *)&ipaddr? Regards, Curt McDowell Broadcom Corp. _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
