[Top][All Lists]

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

RE: [lwip-users] Re: IP Address Display Functions

From: Bill Auerbach
Subject: RE: [lwip-users] Re: IP Address Display Functions
Date: Tue, 25 Aug 2009 14:11:36 -0400

>There was definitely an issue with an unaligned ip_addr in the
>etharp_hdr struct. However, that struct now uses an ip_addr2. If there
>are other places containing an unaligned ip_addr, they should do the

Why not:

typedef u32_t ip_addr;

What is the point of a single member struct?  It forces more typing as well.

We shouldn't be putting the packing requirement on the type but on the
variable definition of the type.

There was talk in the ANSI C world if e.g. const struct { ... }; was valid,
because you don't have a const struct or a const type, but a const variable
of a struct type.  In my opinion with no basis, I think this packing was
perhaps a bug-fix to force 2004 GCC to pack the member when it was in
another struct. Was this a change that worked without looking for another
change which would also fix the use of ip_addr in something else without
doing it at this lower level?  I'm being pushy because for me this packing
was one of 3 performance killers.  I know, only on one platform, but from a
C standpoint, a single member struct makes no sense to me either.


reply via email to

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