lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Misalignment problems on PowerPC (little endian mode)


From: Alain M.
Subject: Re: [lwip-users] Misalignment problems on PowerPC (little endian mode)
Date: Fri, 30 May 2008 14:44:29 -0300
User-agent: Thunderbird 2.0.0.6 (X11/20070728)


#define FIELD1(A) (*((short int*)&A[0]))
#define FIELD2(A) (*((long*)&A[2]))
x=FIELD1(data); /* using field1 */
I don't know how this should help: say A starts at 0x03, then accessing
FIELD2 would still result in a long-pointer being accessed at 0x03+2 = 0x05.
This is what will not work on most platforms.

It would not work on platforms like ARM, BUT all ip protocols are 32bit oriented, so that is a case that does not exist AFAIK on any protocol on a tcp and related pack

Alain





reply via email to

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