lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #48308] Warnings in PPP Van Jacobson code when compili


From: Dirk Ziegelmeier
Subject: [lwip-devel] [bug #48308] Warnings in PPP Van Jacobson code when compiling with clang
Date: Tue, 28 Jun 2016 20:11:44 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0

Follow-up Comment #4, bug #48308 (project lwip):

Yes, clang does not warn about casting from u16_t* to struct xxx. It complains
about the first cast:

./../../../../lwip/src/netif/ppp/vj.c:165:28: error: cast from 'struct ip_hdr
' to 'u32_t ' (aka 'unsigned int *') increases required alignment from 1 to 4
[-Werror,-Wcast-align]
th = (struct tcp_hdr )&((u32_t)ip)[ilen]; 

in this case the variable ip is cast (a little bit indirectly) to an u32_t* by
&((u32_t)ip)

-> would be fixed by
th = (struct tcp_hdr )&((u8_t)ip)[ilen<<2]; 


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?48308>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

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