On 05/11/2012 01:21 PM, Juha Heinanen wrote:
gcc version 4.6.3 (Debian 4.6.3-1) gives the warning
below that i don't
remember seeing with earlier gcc versions.
-- juha
Hello Juha,
There are around 180~200 of these defects found when using a static
analysis tool like llvm's scan-build. I have patched some of them (which
were bugs), but most of these dead assignments are removed by the
compiler anyway on -O2 optimisation level. GCC it's just playing a
catch-a-mouse game with better static analysis tools. I can provide a
list of all these defects, if someone it the community wants to take the
time to fix them.
Cheers,
Marius
CC (cc) [sip-proxy] msg_translator.o
msg_translator.c: In function ‘check_via_address’:
msg_translator.c:198:6: warning: variable ‘len’ set but not used
[-Wunused-but-set-variable]
CC (cc) [M tls.so] tls_ct_wrq.o
In file included from tls_ct_q.h:35:0,
from tls_ct_wrq.h:35,
from tls_ct_wrq.c:32:
sbufq.h: In function ‘sbufq_add’:
sbufq.h:84:10: warning: variable ‘t’ set but not used [-Wunused-but-set-variable]
CC (cc) [M tls.so] tls_domain.o
In file included from tls_ct_q.h:35:0,
from tls_ct_wrq.h:35,
from tls_server.h:36,
from tls_domain.c:36:
sbufq.h: In function ‘sbufq_add’:
sbufq.h:84:10: warning: variable ‘t’ set but not used [-Wunused-but-set-variable]
tls_domain.c: In function ‘load_cert’:
tls_domain.c:418:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
tls_domain.c: In function ‘load_ca_list’:
tls_domain.c:448:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
tls_domain.c:455:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
tls_domain.c: In function ‘load_crl’:
tls_domain.c:487:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
tls_domain.c: In function ‘load_private_key’:
tls_domain.c:896:5: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
tls_domain.c:904:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
tls_domain.c:911:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
tls_domain.c:911:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
CC (cc) [M tls.so] tls_dump_vf.o
CC (cc) [M tls.so] tls_init.o
In file included from tls_ct_q.h:35:0,
from tls_ct_wrq.h:35,
from tls_init.c:74:
sbufq.h: In function ‘sbufq_add’:
sbufq.h:84:10: warning: variable ‘t’ set but not used [-Wunused-but-set-variable]
CC (cc) [M tls.so] tls_mod.o
In file included from tls_ct_q.h:35:0,
from tls_ct_wrq.h:35,
from tls_server.h:36,
from tls_mod.c:64:
sbufq.h: In function ‘sbufq_add’:
sbufq.h:84:10: warning: variable ‘t’ set but not used [-Wunused-but-set-variable]
CC (cc) [M tls.so] tls_rpc.o
In file included from tls_ct_q.h:35:0,
from tls_ct_wrq.h:35,
from tls_server.h:36,
from tls_rpc.c:40:
sbufq.h: In function ‘sbufq_add’:
sbufq.h:84:10: warning: variable ‘t’ set but not used [-Wunused-but-set-variable]
sbufq.h:84:10: warning: variable ‘t’ set but not used [-Wunused-but-set-variable]
CC (cc) [M tls.so] tls_server.o
In file included from tls_ct_q.h:35:0,
from tls_ct_wrq.h:35,
from tls_server.h:36,
from tls_server.c:56:
sbufq.h: In function ‘sbufq_add’:
sbufq.h:84:10: warning: variable ‘t’ set but not used [-Wunused-but-set-variable]
tls_server.c: In function ‘tls_complete_init’:
tls_server.c:196:3: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
tls_server.c: In function ‘tls_shutdown’:
tls_server.c:525:4: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
tls_server.c: In function ‘tls_encode_f’:
tls_server.c:802:5: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
tls_server.c:836:5: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
tls_server.c: In function ‘tls_read_f’:
tls_server.c:1190:4: warning: variable ‘ret’ set but not used
[-Wunused-but-set-variable]
tls_server.c:1224:4: warning: variable ‘ret’ set but not used
[-Wunused-but-set-variable]
CC (cc) [M xmlrpc.so] xmlrpc.o
xmlrpc.c: In function ‘rpc_scan’:
xmlrpc.c:1457:6: warning: variable ‘fmt_len’ set but not used
[-Wunused-but-set-variable]
CC (cc) [L libser_cds.so.0.1] rr_serialize.o
rr_serialize.c: In function ‘rr_dup’:
rr_serialize.c:10:6: warning: variable ‘res’ set but not used
[-Wunused-but-set-variable]
CC (cc) [L libser_cds.so.0.1] serialize.o
serialize.c: In function ‘sstream_get_str_ex’:
serialize.c:91:6: warning: variable ‘res’ set but not used [-Wunused-but-set-variable]
CC (cc) [M pdt.so] domains.o
domains.c: In function ‘pdt_check_pd’:
domains.c:406:15: warning: variable ‘dhash’ set but not used [-Wunused-but-set-variable]
CC (cc) [M registrar.so] lookup.o
lookup.c: In function ‘lookup2’:
lookup.c:250:12: warning: variable ‘fp’ set but not used [-Wunused-but-set-variable]
CC (cc) [M usrloc.so] urecord.o
urecord.c: In function ‘nodb_timer’:
urecord.c:211:6: warning: variable ‘not’ set but not used [-Wunused-but-set-variable]
urecord.c: In function ‘wt_timer’:
urecord.c:254:6: warning: variable ‘not’ set but not used [-Wunused-but-set-variable]
urecord.c: In function ‘wb_timer’:
urecord.c:307:6: warning: variable ‘not’ set but not used [-Wunused-but-set-variable]
_______________________________________________
sr-dev mailing list
sr-dev(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
--
Zbihlei Marius
Head of
Linux Development Services Romania
1&1 Internet Development srl Tel KA: 754-9152
Str Mircea Eliade 18 Tel RO: +40-31-223-9152
Sect 1, Bucuresti mailto: marius.zbihlei(a)1and1.ro
71295, Romania