[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Struct packing/alignment problems
From: |
K.J. Mansley |
Subject: |
Re: [lwip-users] Struct packing/alignment problems |
Date: |
26 Apr 2004 15:49:47 +0100 |
On Mon, 2004-04-26 at 15:02, address@hidden wrote:
> Once the structs are nicely aligned I can see no reason to use struct packing
> compiler directives.
> But of course, we can't be 100% certain until it have been tested.
It's not just the initial alignment that is important, it's also the
layout within the structure. Without a packed struct (I think - could
be wrong on this!) you can't guarantee that the compiler won't insert
gaps (or reorder the elements) within the struct. Normally this isn't a
problem as the program is self-consistent, but when you try to access a
network packet using a struct you would clearly be in all sorts of
problems if there were gaps in the struct that aren't in the packet.
Kieran
- Re: [lwip-users] Struct packing/alignment problems, (continued)
- Re: [lwip-users] Struct packing/alignment problems, Timmy Brolin, 2004/04/26
- Re: [lwip-users] Struct packing/alignment problems, Jani Monoses, 2004/04/26
- Re: [lwip-users] Struct packing/alignment problems, K.J. Mansley, 2004/04/26
- Re: [lwip-users] Struct packing/alignment problems, d99tibr, 2004/04/26
- Re: [lwip-users] Struct packing/alignment problems, K.J. Mansley, 2004/04/26
- Re: [lwip-users] Struct packing/alignment problems, Timmy Brolin, 2004/04/26
- Re: [lwip-users] Struct packing/alignment problems, Timmy Brolin, 2004/04/26
- Re: [lwip-users] Struct packing/alignment problems, Atte Kojo, 2004/04/27
- Re: [lwip-users] Struct packing/alignment problems, Leon Woestenberg, 2004/04/26
- Re: [lwip-users] Struct packing/alignment problems, d99tibr, 2004/04/26
- Re: [lwip-users] Struct packing/alignment problems,
K.J. Mansley <=
- Re: [lwip-users] Struct packing/alignment problems, Leon Woestenberg, 2004/04/26
- RE: [lwip-users] Struct packing/alignment problems, Chris Jones, 2004/04/26
- Re: [lwip-users] Struct packing/alignment problems, Timmy Brolin, 2004/04/26
- RE: [lwip-users] Struct packing/alignment problems, Chris Jones, 2004/04/26
- Re: [lwip-users] Struct packing/alignment problems, Timmy Brolin, 2004/04/26
- RE: [lwip-users] Struct packing/alignment problems, Chris Jones, 2004/04/26
- Re: [lwip-users] Struct packing/alignment problems, Timmy Brolin, 2004/04/26
- Re: [lwip-users] Struct packing/alignment problems, K.J. Mansley, 2004/04/27
RE: [lwip-users] Struct packing/alignment problems, Mountifield, Tony, 2004/04/26
RE: [lwip-users] Struct packing/alignment problems, Mountifield, Tony, 2004/04/27