[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw
From: |
Bill Auerbach |
Subject: |
[lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw |
Date: |
Wed, 22 Apr 2009 17:16:19 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8 |
Follow-up Comment #9, bug #26273 (project lwip):
> then either sipaddr or dipaddr is not four-byte aligned (MAC addresses are
6-byte long). The question appears, how the statement
>
>hdr->dipaddr = hdr->sipaddr;
>
>(struct to struct copy) is translated by a compiler.
Because there is no cast! The compiler has all the information it needs to
generate correct code. It knows the base of the struct is aligned and that a
sub-structure isn’t (because of packing).
A cast tells the compiler "I know what I’m doing". Therefore, the code
with the cast had better ensure alignment, because the compiler will not.
Bill
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?26273>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, (continued)
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, Simon Goldschmidt, 2009/04/22
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, Guillaume du PONTAVICE, 2009/04/22
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, Simon Goldschmidt, 2009/04/22
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, Bill Auerbach, 2009/04/22
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, Simon Goldschmidt, 2009/04/22
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, Bill Auerbach, 2009/04/22
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw,
Bill Auerbach <=
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, Simon Goldschmidt, 2009/04/22
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, Bill Auerbach, 2009/04/22
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, Robert Sprowson, 2009/04/22
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, Simon Goldschmidt, 2009/04/23
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, Guillaume du PONTAVICE, 2009/04/23
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, Bill Auerbach, 2009/04/23
- [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, Simon Goldschmidt, 2009/04/23
- RE: [lwip-devel] [bug #26273] etharp.c : fix alignment issue in etharp_raw, Bill Auerbach, 2009/04/22
- ODP: [lwip-devel] [bug #26273] etharp.c : fix alignment issuein etharp_raw, Małowidzki , Marek, 2009/04/22
- Re: ODP: [lwip-devel] [bug #26273] etharp.c : fix alignment issuein etharp_raw, address@hidden, 2009/04/22