lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] wrong statement in lwip wiki page about structure packi


From: jblackarty
Subject: Re: [lwip-users] wrong statement in lwip wiki page about structure packing
Date: Wed, 29 Aug 2012 16:24:43 +0700

> Whoever wrote that (I'm too lazy to check the wiki history right
> now) thought (or maybe even checked) that inside protocol headers,
> all members are aligned, so when the start of a protocol header is
> aligned, you wouldn't need packing.

Structure alignment and packing of internal members are different
things. Author of those phrase was wrong in last words about packing.
Structure members may be padded relatively to each other in general case.
This is what I talking about. I don't know what means "packing" with
respect to whole structure but I'm sure each member must be packed
separately. I even agree to believe author to not define
PACK_STRUCT_STRUCT in conditions provided but this is not related to 
PACK_STRUCT_FIELD.

> However, this is *not* guaranteed to work by lwIP, and we do not
> check for this to work when making changes to the sources. Being
> like that, it *might* work (maybe depending on which protocols are
> used), but I would suggest to test the stack very thoroughly when used like 
> that!

All the more reason to remove that phrase completely.




reply via email to

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