lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] a question about alignment


From: K.J. Mansley
Subject: Re: [lwip-users] a question about alignment
Date: 05 Nov 2004 10:40:42 +0000

On Fri, 2004-11-05 at 05:55, jack W wrote:
> hi everyone 
>       i have defined a non-alignment struct named ip_addr {.....}
> and i use the macro IP4_ADDR()  in the file  ip_addr.h to write the ip 
> address "192.168.0.3" into  a pointer variable my_addr.  in the netif_add 
> function , there is a macoro ip_add_set() . when the  my_addr is put into the 
> macro . the result is (192.168.0.1)0x0100A8C0    not (192.168.0.3)0x0300A8C0 
> . I do not know why ?
> 
> my struct is following : PACK_STRUCT_BEGIN
>                            struct ip_addr{
>                           PACK_STRUCT_FIELD(u32_t ip_addr);}
>    
> 
> and i defined the macro PACK_STRUC_BEGIN __packed 
>                  and the macro PACK_STRUCT_FIEL __packed x;

Do you get the same error if you don't pack the structure?  It's
possible that the packing directives have nothing to do with the
problem, so if you could try it and see that would help rule them out.

Thanks

Kieran





reply via email to

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