When building lwIP-1.4.1 on Linaro GCC v4.9.3 with -Wall, GCC issues warnings in two places where the macro ip_addr_isany(addr1) is used, saying the comparison against NULL will always evaluate to false. This warning is correct in both cases because the macro is given the address of a local stack variable, which can never be NULL.
It is clear that the macro must test for NULL. We need to build with zero compiler warnings. I examined the lwIP-2.0.2 code, since the changelog mentioned fixes to a number of compiler warnings, but I didn't see a change in this macro.
I am tempted to use a trick like the one mentioned here:
Namely to modify the macro, casting to (void *) to trick the compiler into not issuing the warning. However I wonder if there is a "better" fix. Has anyone encountered these warnings before?