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: Jonathan Larmour
Subject: Re: [lwip-users] Misalignment problems on PowerPC (little endian mode)
Date: Tue, 27 May 2008 15:55:03 +0100
User-agent: Thunderbird 1.5.0.12 (X11/20070530)

Rishi Khan wrote:
> Mine are:
> #define PACK_STRUCT_FIELD(x) x __attribute__((packed))
> #define PACK_STRUCT_STRUCT __attribute__((packed))
> #define PACK_STRUCT_BEGIN
> #define PACK_STRUCT_END
> 
> 
> Maybe you don't see them because you don't have -Wall on?

I do.

A quick look at the GCC source code shows that this must be because we are
using different GCC versions. I'm using 3.4.4, but I see in 4.1.0 and later
it outputs this warning if a packed attribute is used to pack some type
already byte aligned. In this case presumably because struct ip_addr is
already packed.

I'm not sure if removing the PACK_STRUCT_FIELD in ip.h would be portable to
all other compilers. Hmm.

Jifl

> On May 25, 2008, at 9:18 PM, Jonathan Larmour wrote:
> 
>> Rishi Khan wrote:
>>> Simon,
>>> I don't know if this is an issue, but gcc spits out many warnings like:
>>> ../../../../../lwip/src/include/ipv4/lwip/ip.h:136: warning:
>>> 'packed'  attribute ignored for field of type 'struct ip_addr'
>>
>> I don't see that with GCC. What are your packing defines in cc.h ?
>> Mine are:
>>
>> #define PACK_STRUCT_FIELD(_x_) _x_ __attribute__((packed))
>> #define PACK_STRUCT_STRUCT __attribute__((packed))
>> #define PACK_STRUCT_BEGIN
>> #define PACK_STRUCT_END
>>
>> Jifl

-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine




reply via email to

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