Compiling the new `lrkproxy` module with clang throws the following warning:
``` CC (gcc) [M lrkproxy.so] lrkproxy.o lrkproxy.c:1228:28: warning: address of array 'e->node->lrkp_n_c->internal_ip' will always evaluate to 'true' [-Wpointer-bool-conversion] if (e->node->lrkp_n_c->internal_ip && flags) { ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ ~~ 1 warning generated. ```
Looks like something that needs to be sorted out, comparison with an array address.
@miconda Does you use make command for compiling? I have tried to compile it couple of times and no seen any warning! Actually this section of work is related for doing direction of relaying rtp between NIC. In upcoming updates, it might completely change.
Yes, it is via de make command, but using clang not gcc (it is a compile on macos/bsd).
Practically at that line you check if the address of a char[20] buffer inside a structure is null:
``` struct lrkp_node_conf { int start_port; int end_port; int current_port; char internal_ip[20]; char external_ip[20]; }; ```
It cannot be null, meaning that condition on `e->node->lrkp_n_c->internal_ip` is always true:
``` if (e->node->lrkp_n_c->internal_ip && flags) { ```
Maybe you wanted to test if its content is 0 (all chars internal_ip[i] with i=0..19 are 0). Or just remove `e->node->lrkp_n_c->internal_ip` from condition.
the code is updated. Please chack it again.
@mojtabaesfandiari - the module is merged in master branch of Kamailio, do not push commits to the branch that was used for pull request. Clone kamailio source code from master branch and do changes there, then you can make pull requests or push the commits to your module.
As I saw your push to the pull request, the new codition is also exposed to same warning:
``` (e->node->lrkp_n_c->external_ip != NULL) ```
The field `external_ip` is also a char[20] buffer and therefore it is never NULL.
@miconda ,The changes are done right now. Would you please check again with clang and update me. Thanks
Where did you push the fixes? I do not see any new commit in lrkproxy module on the github.com/kamailio/kamailio repo.
check it again
I think this warning issue is solved. Is it right? then we could close it.
OK.
Closed #2663.