[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] Warning when using lwIP in C++
From: |
Freddie Chopin |
Subject: |
[lwip-devel] Warning when using lwIP in C++ |
Date: |
Thu, 31 Mar 2016 12:12:00 +0200 |
Hello!
If the file src/include/lwip/priv/tcpip_priv.h is included in C++
source file - for example indirectly via src/include/lwip/netifapi.h -
the compiler gives a following warning (when using -Wall -Wextra):
In file included from ../external/lwIP/src/include/lwip/netifapi.h:38:0,
from modbusTcpPollingThread.cpp:16:
../external/lwIP/src/include/lwip/priv/tcpip_priv.h:116:71: warning: 'err_t
tcpip_api_call(tcpip_api_call_fn, tcpip_api_call*)' hides constructor for
'struct tcpip_api_call' [-Wshadow]
err_t tcpip_api_call(tcpip_api_call_fn fn, struct tcpip_api_call *call);
^
There are many possible approaches to solving this:
1. Rename the function or struct to not have the same name
2. Add suffix to the struct name "tcpip_api_call_s"
3. Use anonymous struct via typedef "tcpip_api_call_t"
4. ...
Is any of these solutions preferable? Should I send a patch, or maybe
you prefer to do the change yourself?
Regards,
FCh
- [lwip-devel] Warning when using lwIP in C++,
Freddie Chopin <=