[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Struct packing/alignment problems
From: |
Leon Woestenberg |
Subject: |
Re: [lwip-users] Struct packing/alignment problems |
Date: |
Wed, 05 May 2004 16:53:23 +0200 |
User-agent: |
Mozilla Thunderbird 0.5 (Windows/20040207) |
Hello Kieran, everyone,
On Wed, 2004-05-05 at 14:27, Timmy Brolin wrote:
To put and end to the gcc+arm debate, I fired up my gcc arm compiler and
ran the example below on my gameboy advance :-)
The offsets are as expected: 0, 1, 2.
- may not work on all compilers and platforms
No one has yet proved or disproved this con, but the possibility of it,
in my opinion, outweighs the minor issue of cleaner code. The C
worrying about. Leon: you seem to have been following this without
getting too involved, perhaps you could make a decision on this so e
can forget about it for the time being?
I think clean code is reasonably important in a multi-people project
like this. Together with the assumption that larger-than-natural
alignment never occurs (until proven otherwise),
here is an updated proposal (decision if you wish :-) :
1) remove the pack directives altogether in HEAD
2) add LWIP_ASSERT() macro's that test the sizeof(protocol_header) to be
correct (if compilers decide to pad, we will then notice this!)
3) wait for people to see stuff break (I do not expect this).
3a) if (3) see why it breaks.
3b) if (3a) breaks because of missing pack directives, revert to current
implementation.
I do not have time to implement (1) and (2) the next two weeks though.
Also, please let's post in lwip-devel the next time. Although I have
really started to like the "threaded" message discussion display
of the (Mozilla-fame) Thunderbird email browser :-), lwip-users was
flooded with this discussion.
Regards,
Leon.
- RE: [lwip-users] Struct packing/alignment problems, (continued)
- Re: [lwip-users] Struct packing/alignment problems, K.J. Mansley, 2004/05/05
- Re: [lwip-users] Struct packing/alignment problems, Jani Monoses, 2004/05/05
- Re: [lwip-users] Struct packing/alignment problems, Leon Woestenberg, 2004/05/05
- Re: [lwip-users] Struct packing/alignment problems, Jani Monoses, 2004/05/05
- Re: [lwip-users] Struct packing/alignment problems, Timmy Brolin, 2004/05/05
- Re: [lwip-users] Struct packing/alignment problems, Leon Woestenberg, 2004/05/05
- Re: [lwip-users] Struct packing/alignment problems, Timmy Brolin, 2004/05/05
- Re: [lwip-users] Struct packing/alignment problems, K.J. Mansley, 2004/05/05
- Re: [lwip-users] Struct packing/alignment problems,
Leon Woestenberg <=
- Re: [lwip-users] Struct packing/alignment problems, Timmy Brolin, 2004/05/05
- Re: [lwip-users] Struct packing/alignment problems, Leon Woestenberg, 2004/05/05
- Re: [lwip-users] Struct packing/alignment problems, K.J. Mansley, 2004/05/04
- Re: [lwip-users] Struct packing/alignment problems, Timmy Brolin, 2004/05/04
RE: [lwip-users] Struct packing/alignment problems, Mountifield, Tony, 2004/05/04
RE: [lwip-users] Struct packing/alignment problems, Mountifield, Tony, 2004/05/05