[Top][All Lists]

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

RE: [lwip-users] [PATCH] fix warning for gcc and possible unaligned acce

From: Curt McDowell
Subject: RE: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access
Date: Tue, 25 Apr 2006 16:00:36 -0700

Timmy Brolin wrote:
> But replacing ip_addr2 with ip_addr will break things on all 
> compilers that do not support packed structs. Possibly others as well.

Ah; if lwip was meant to compile without packed structs, that explains a lot.
It would have saved a lot of hassle if ip_addr2 had a comment next to it, and
was not itself packed, or if the comments in etharp.c mentioned that...

> If your compiler generates special code to handle potential 
> alignment problems whenever packed structs are used even if 
> there are no alignment issues, then I suggest you try 
> disabling packed structs.

Sounds good.  I'll try that because of code bloat.  For packed ip_addr, ARM gcc
generates a sequence of 11 (7) instructions to store (load) it one byte at a
time, and armcc generates calls to library functions __rt_uwrite4

Curt McDowell
Broadcom Corp.

reply via email to

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