lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] wrong statement in lwip wiki page about structure packing


From: jblackarty
Subject: [lwip-users] wrong statement in lwip wiki page about structure packing
Date: Wed, 29 Aug 2012 11:58:22 +0700

Hi all,

Current verson of http://lwip.wikia.com/wiki/Porting_for_an_OS#cc.h page
containts a statement regarding structure packing:
"The common case is using Ethernet interfaces and MEM_ALIGNMENT=4. Ethernet 
header without VLAN is 14 bytes, so if you can/must have ETH_PAD_SIZE=2, then 
IP headers and higher layers are 4 bytes aligned and you may not need packing !"
It's wrong ! You need structure fields to be packed at least ! Of
course, there are may be exceptions like in my case, where my
processor is arm cortex-m3 and compiler is gcc. It didn't align
structure fields, so packing isn't required. But this is not general case.
Correct me if I'm wrong. Otherwise wiki must be corrected.

Regards,
Artem Pisarenko




reply via email to

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