recently there has been commits that cause compiler warnings shown below.
please fix or revert the commits.
-- juha
action.c: In function ‘run_actions’: action.c:1583: warning: ‘ms’ may be used uninitialized in this function CC (cc) [sip-proxy] msg_translator.o msg_translator.c: In function ‘lumps_len’: msg_translator.c:582: warning: ‘recv_address_str’ may be used uninitialized in this function msg_translator.c:583: warning: ‘recv_port_str’ may be used uninitialized in this function msg_translator.c:584: warning: ‘recv_port_no’ may be used uninitialized in this function msg_translator.c: In function ‘process_lumps’: msg_translator.c:921: warning: ‘recv_address_str’ may be used uninitialized in this function msg_translator.c:922: warning: ‘recv_port_str’ may be used uninitialized in this function msg_translator.c:923: warning: ‘recv_port_no’ may be used uninitialized in this function CC (cc) [L libsrdb1.so.1.0] db_query.o db_query.c: In function ‘db_do_submit_query’: db_query.c:50: warning: ‘ms’ may be used uninitialized in this function CC (cc) [M textops.so] textops.o textops.c: In function ‘subst_hf_f’: textops.c:2242: warning: ‘hfl’ may be used uninitialized in this function textops.c: In function ‘search_hf_f’: textops.c:2161: warning: ‘hfl’ may be used uninitialized in this function
Hello,
I fixed the ones not in msg_translator.c, they were valid.
For msg_translator.c, I am not yet sure why they are thrown, recv_* vars are set for condition 'if (msg->rcv.bind_address)' and used only within that condition. What is your gcc version? I have 4.2 here and no warning there.
I can init them always, but it is better to understand first why the warning is given, not to fall in a trap with a default value.
Cheers, Daniel
On 4/3/12 4:07 PM, Juha Heinanen wrote:
recently there has been commits that cause compiler warnings shown below.
please fix or revert the commits.
-- juha
action.c: In function ‘run_actions’: action.c:1583: warning: ‘ms’ may be used uninitialized in this function CC (cc) [sip-proxy] msg_translator.o msg_translator.c: In function ‘lumps_len’: msg_translator.c:582: warning: ‘recv_address_str’ may be used uninitialized in this function msg_translator.c:583: warning: ‘recv_port_str’ may be used uninitialized in this function msg_translator.c:584: warning: ‘recv_port_no’ may be used uninitialized in this function msg_translator.c: In function ‘process_lumps’: msg_translator.c:921: warning: ‘recv_address_str’ may be used uninitialized in this function msg_translator.c:922: warning: ‘recv_port_str’ may be used uninitialized in this function msg_translator.c:923: warning: ‘recv_port_no’ may be used uninitialized in this function CC (cc) [L libsrdb1.so.1.0] db_query.o db_query.c: In function ‘db_do_submit_query’: db_query.c:50: warning: ‘ms’ may be used uninitialized in this function CC (cc) [M textops.so] textops.o textops.c: In function ‘subst_hf_f’: textops.c:2242: warning: ‘hfl’ may be used uninitialized in this function textops.c: In function ‘search_hf_f’: textops.c:2161: warning: ‘hfl’ may be used uninitialized in this function
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Daniel-Constantin Mierla writes:
I fixed the ones not in msg_translator.c, they were valid.
this still remains:
action.c: In function ‘run_actions’: action.c:1583: warning: ‘ms’ may be used uninitialized in this function
about msg_translator.c, i get the warnings with debian stable (squeeze) gcc:
gcc version 4.4.5 (Debian 4.4.5-8)
-- juha
On 04/04/2012 12:16 PM, Daniel-Constantin Mierla wrote:
Hello,
I fixed the ones not in msg_translator.c, they were valid.
For msg_translator.c, I am not yet sure why they are thrown, recv_* vars are set for condition 'if (msg->rcv.bind_address)' and used only within that condition. What is your gcc version? I have 4.2 here and no warning there.
Hello Daniel,
I get the same warnings on actions.c and msg_translator.c.
mzbihlei@lxbu-czc111663q:~$ gcc --version gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions.
msg_translator.c: In function ‘lumps_len’: msg_translator.c:582:7: warning: ‘recv_address_str’ may be used uninitialized in this function msg_translator.c:583:7: warning: ‘recv_port_str’ may be used uninitialized in this function msg_translator.c:584:7: warning: ‘recv_port_no’ may be used uninitialized in this function msg_translator.c: In function ‘process_lumps’: msg_translator.c:921:7: warning: ‘recv_address_str’ may be used uninitialized in this function msg_translator.c:922:7: warning: ‘recv_port_str’ may be used uninitialized in this function msg_translator.c:923:7: warning: ‘recv_port_no’ may be used uninitialized in this function
I have pushed a fix for the actions.c (the problem is that on line 1617 ) . I will have a look at msg_translator as well .
Marius
I can init them always, but it is better to understand first why the warning is given, not to fall in a trap with a default value.
Cheers, Daniel
On 4/3/12 4:07 PM, Juha Heinanen wrote:
recently there has been commits that cause compiler warnings shown below.
please fix or revert the commits.
-- juha
action.c: In function ‘run_actions’: action.c:1583: warning: ‘ms’ may be used uninitialized in this function CC (cc) [sip-proxy] msg_translator.o msg_translator.c: In function ‘lumps_len’: msg_translator.c:582: warning: ‘recv_address_str’ may be used uninitialized in this function msg_translator.c:583: warning: ‘recv_port_str’ may be used uninitialized in this function msg_translator.c:584: warning: ‘recv_port_no’ may be used uninitialized in this function msg_translator.c: In function ‘process_lumps’: msg_translator.c:921: warning: ‘recv_address_str’ may be used uninitialized in this function msg_translator.c:922: warning: ‘recv_port_str’ may be used uninitialized in this function msg_translator.c:923: warning: ‘recv_port_no’ may be used uninitialized in this function CC (cc) [L libsrdb1.so.1.0] db_query.o db_query.c: In function ‘db_do_submit_query’: db_query.c:50: warning: ‘ms’ may be used uninitialized in this function CC (cc) [M textops.so] textops.o textops.c: In function ‘subst_hf_f’: textops.c:2242: warning: ‘hfl’ may be used uninitialized in this function textops.c: In function ‘search_hf_f’: textops.c:2161: warning: ‘hfl’ may be used uninitialized in this function
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Hello,
On 4/4/12 12:03 PM, Marius Zbihlei wrote:
On 04/04/2012 12:16 PM, Daniel-Constantin Mierla wrote:
Hello,
I fixed the ones not in msg_translator.c, they were valid.
For msg_translator.c, I am not yet sure why they are thrown, recv_* vars are set for condition 'if (msg->rcv.bind_address)' and used only within that condition. What is your gcc version? I have 4.2 here and no warning there.
Hello Daniel,
I get the same warnings on actions.c and msg_translator.c.
mzbihlei@lxbu-czc111663q:~$ gcc --version gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions.
msg_translator.c: In function ‘lumps_len’: msg_translator.c:582:7: warning: ‘recv_address_str’ may be used uninitialized in this function msg_translator.c:583:7: warning: ‘recv_port_str’ may be used uninitialized in this function msg_translator.c:584:7: warning: ‘recv_port_no’ may be used uninitialized in this function msg_translator.c: In function ‘process_lumps’: msg_translator.c:921:7: warning: ‘recv_address_str’ may be used uninitialized in this function msg_translator.c:922:7: warning: ‘recv_port_str’ may be used uninitialized in this function msg_translator.c:923:7: warning: ‘recv_port_no’ may be used uninitialized in this function
I have pushed a fix for the actions.c (the problem is that on line 1617 ) . I will have a look at msg_translator as well .
thanks, I completely missed the warning message for action.c.
Perhaps the gcc version is able to decided that the condition for setting ms can be changed, which indeed can be done via RPC, but for msg_translator.c cannot happen -- or maybe gcc thinks of eventual multi-threading approach to access the msg structure and change it (which is not the case ) ... that's why I wanted to be able to get more clarifications.
Anyhow, if you look over it and initialize vars, go ahead an commit.
Cheers, Daniel
Marius
I can init them always, but it is better to understand first why the warning is given, not to fall in a trap with a default value.
Cheers, Daniel
On 4/3/12 4:07 PM, Juha Heinanen wrote:
recently there has been commits that cause compiler warnings shown below.
please fix or revert the commits.
-- juha
action.c: In function ‘run_actions’: action.c:1583: warning: ‘ms’ may be used uninitialized in this function CC (cc) [sip-proxy] msg_translator.o msg_translator.c: In function ‘lumps_len’: msg_translator.c:582: warning: ‘recv_address_str’ may be used uninitialized in this function msg_translator.c:583: warning: ‘recv_port_str’ may be used uninitialized in this function msg_translator.c:584: warning: ‘recv_port_no’ may be used uninitialized in this function msg_translator.c: In function ‘process_lumps’: msg_translator.c:921: warning: ‘recv_address_str’ may be used uninitialized in this function msg_translator.c:922: warning: ‘recv_port_str’ may be used uninitialized in this function msg_translator.c:923: warning: ‘recv_port_no’ may be used uninitialized in this function CC (cc) [L libsrdb1.so.1.0] db_query.o db_query.c: In function ‘db_do_submit_query’: db_query.c:50: warning: ‘ms’ may be used uninitialized in this function CC (cc) [M textops.so] textops.o textops.c: In function ‘subst_hf_f’: textops.c:2242: warning: ‘hfl’ may be used uninitialized in this function textops.c: In function ‘search_hf_f’: textops.c:2161: warning: ‘hfl’ may be used uninitialized in this function
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev