lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] cast increases required alignment of target type


From: Jeff Barber
Subject: Re: [lwip-users] cast increases required alignment of target type
Date: Tue, 9 Mar 2010 21:15:58 -0500

I'm guessing that the "packed" attributes on tcp_hdr are making the
compiler believe that (seg->tcphdr + 1) *might* fall on a non-u32_t
boundary (which is quite likely a realistic possibility).  Not sure
why you're seeing this and no one else with gcc is.  Maybe it has to
do with the particular version of gcc?  Or perhaps with your
definition of the PACKED_xxx macros?

Jeff

On Tue, Mar 9, 2010 at 6:14 PM, Joe Dupre <address@hidden> wrote:
> I've had this warning since v1.3.1.  How can I make it go away?
>
>
> static void
> tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb)
> {
>  u16_t len;
>  struct netif *netif;
>  u32_t *opts;
>
>  /* <snip> */
>
>  opts = (u32_t *)(seg->tcphdr + 1);    <----WARNING: cast increases required 
> alignment of target type
>  if (seg->flags & TF_SEG_OPTS_MSS) {
>    TCP_BUILD_MSS_OPTION( *opts);
>    opts += 1;
>  }
>
>
> This is with arm-elf-gcc (yagarto build 20091018).
> If I understand it correctly, the warning is because seg->tcp_hdr is not 
> falling on a 32 bit boundary.
> But I don't know how to correct this.
>
> - Joe
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>




reply via email to

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