|
From: | address@hidden |
Subject: | Re: [lwip-users] Compiler warnings. Lack of include directives. |
Date: | Mon, 20 Jul 2009 17:46:49 +0200 |
User-agent: | Thunderbird 2.0.0.22 (Macintosh/20090605) |
gregoryhouse wrote:
Hi, According to a fact that you are attempting to release new version of lwip, I have some notices. In my compilation I don't include LWIP_NETIF_API module. Compiler says: lwip/tcpip.h 'struct netif' declared inside parameter list because the content of the netifapi.h file is excluded during compilation.
That has nothing to do with netifapi.h: the code that fails for you was in there since revision 1.1, way before netifapi was added. Nevertheless, it still exists, although it does not seem to be a problem in the stack itself: in every place where tcpip.h is included, another file seems to be included before the in turn includes netif.h, so the struct netif always seems to be defined already.
I added directive #include "lwip/netif.h" to tcpip.h to correct this.
That's a good solution for this porblem, we should check it in before releasing! Thanks for reporting.
Another thing, when I set optimization parameter to -s3, compiler shows warning: lwip/src/core/dhcp.c array subscript is above array bounds, line 1436
Can you explain yourself this warning? I can't: dhcp->msg_out->chaddr is an array of size DHCP_CHADDR_LEN, so that's OK. The other array in that line, netif->hwaddr, is checked for out-of-bounds-access by checking netif->hwaddr_len. I guess the compiler gets this wrong and thinks hwaddr[i] is always executed. In that case, it's a false positive (which I'm pretty sure of).
Simon
[Prev in Thread] | Current Thread | [Next in Thread] |