[Top][All Lists]
[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: |
Curt McDowell |
Subject: |
RE: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access |
Date: |
Tue, 25 Apr 2006 12:33:18 -0700 |
Timmy Brolin wrote:
> There is a very good reason why ip_addr2 was introduced.
> ip_addr2 is in fact a decent solution. It is generates close
> optimal machine code, it is not compiler dependent, and it
> makes the code nice and easy to read.
> I would suggest that it remains unless someone comes up with
> a better solution which does not break compatibility with any
> compilers.
I disagree that ip_addr2 is in any way elegant, self-explanatory, easy to read
(being defined elsewhere but not used elsewhere), or that it necessarily
compiles to two half-word transfers, or that performance is remotely critical
here. Worse, it's not acceptable code in C99. People are changing it to
trivial memcpy because:
etharp.c:493: warning: dereferencing type-punned pointer will break
strict-aliasing rules
*(struct ip_addr2 *)&sipaddr = hdr->sipaddr;
Regards,
Curt McDowell
Broadcom Corp.
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, (continued)
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Timmy Brolin, 2006/04/22
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Pedro Alves, 2006/04/22
- [lwip-users] Re: unix simhost, YH, 2006/04/22
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Timmy Brolin, 2006/04/24
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, pedro alves, 2006/04/25
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Timmy Brolin, 2006/04/25
- RE: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Curt McDowell, 2006/04/25
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Timmy Brolin, 2006/04/25
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Pedro Alves, 2006/04/25
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Timmy Brolin, 2006/04/25
- RE: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access,
Curt McDowell <=
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Timmy Brolin, 2006/04/25
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Pedro Alves, 2006/04/25
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Timmy Brolin, 2006/04/26
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Derek Guerdon, 2006/04/27
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Leon Woestenberg, 2006/04/30
- RE: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Curt McDowell, 2006/04/25
- RE: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Leon Woestenberg, 2006/04/30
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Curt McDowell, 2006/04/23
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Leon Woestenberg, 2006/04/23
- Re: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access, Timmy Brolin, 2006/04/24