lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned acce


From: Timmy Brolin
Subject: Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access
Date: Tue, 25 Apr 2006 21:13:45 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

Personally I had problems with Texas Instruments compiler and DSPs.
Unfortunately I worked with the Texas compiler at the local university, and I do not have access to the university any more.

There was a big discussion in the mailing list about alignment issues back then. I was not the only one who had alignment problems.
I suggest taking a look in the mailing list archive..

Regards,
Timmy Brolin

Curt McDowell wrote:

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
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users







reply via email to

[Prev in Thread] Current Thread [Next in Thread]