``` CC (gcc) [M db_redis.so] redis_table.o CC (gcc) [M db_redis.so] db_redis_mod.o CC (gcc) [M db_redis.so] redis_connection.o In file included from ../../lib/srdb1/../../core/ut.h:42, from ../../lib/srdb1/db_key.h:31, from ../../lib/srdb1/db.h:43, from db_redis_mod.h:26, from redis_table.c:25: redis_table.c: In function 'db_redis_parse_keys': ../../lib/srdb1/../../core/dprint.h:303:8: warning: 'table_name.len' may be used uninitialized in this function [-Wmaybe-uninitialized] 303 | fprintf(stderr, "%2d(%d) %s: %.*s%s" fmt, \ | ^~~~~~~ redis_table.c:494:9: note: 'table_name.len' was declared here 494 | str table_name; | ^~~~~~~~~~ In file included from ../../lib/srdb1/../../core/ut.h:42, from ../../lib/srdb1/db_key.h:31, from ../../lib/srdb1/db.h:43, from db_redis_mod.h:26, from redis_table.c:25: ../../lib/srdb1/../../core/dprint.h:303:8: warning: 'table_name.s' may be used uninitialized in this function [-Wmaybe-uninitialized] 303 | fprintf(stderr, "%2d(%d) %s: %.*s%s" fmt, \ | ^~~~~~~ redis_table.c:494:9: note: 'table_name.s' was declared here 494 | str table_name; | ^~~~~~~~~~ redis_table.c:581:38: warning: 'table' may be used uninitialized in this function [-Wmaybe-uninitialized] 581 | table->types = type_target = type; | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ CC (gcc) [M db_redis.so] redis_dbase.o make[3]: 'libsrdb2.so.1.0' is up to date. make[3]: 'libsrdb1.so.1.0' is up to date. ```
**ims_registrar_scscf** ``` make[3]: 'libkamailio_ims.so.0.1' is up to date. LD (gcc) [M ims_registrar_scscf.so] ims_registrar_scscf.so CC (gcc) [M ims_usrloc_pcscf.so] hslot.o CC (gcc) [M ims_usrloc_pcscf.so] ul_callback.o CC (gcc) [M ims_usrloc_pcscf.so] reginfo.o CC (gcc) [M ims_usrloc_pcscf.so] usrloc_db.o CC (gcc) [M ims_usrloc_pcscf.so] ul_rpc.o CC (gcc) [M ims_usrloc_pcscf.so] utime.o CC (gcc) [M ims_usrloc_pcscf.so] ims_usrloc_pcscf_mod.o In file included from ../../lib/srdb1/db.h:45, from usrloc_db.c:10: usrloc_db.c: In function 'db_delete_pcontact': ../../lib/srdb1/db_val.h:106:29: warning: array subscript 1 is above array bounds of 'db_val_t[1]' {aka 'struct <anonymous>[1]'} [-Warray-bounds] 106 | #define VAL_TYPE(dv) ((dv)->type) | ~~~~~^~~~~~~ usrloc_db.c:223:2: note: in expansion of macro 'VAL_TYPE' 223 | VAL_TYPE(values + 1) = DB1_INT; | ^~~~~~~~ usrloc_db.c:216:11: note: while referencing 'values' 216 | db_val_t values[1]; | ^~~~~~ In file included from ../../lib/srdb1/db.h:45, from usrloc_db.c:10: ../../lib/srdb1/db_val.h:114:29: warning: array subscript 1 is above array bounds of 'db_val_t[1]' {aka 'struct <anonymous>[1]'} [-Warray-bounds] 114 | #define VAL_NULL(dv) ((dv)->nul) | ~~~~~^~~~~~ usrloc_db.c:224:2: note: in expansion of macro 'VAL_NULL' 224 | VAL_NULL(values + 1) = 0; | ^~~~~~~~ usrloc_db.c:216:11: note: while referencing 'values' 216 | db_val_t values[1]; | ^~~~~~ In file included from ../../lib/srdb1/db.h:45, from usrloc_db.c:10: ../../lib/srdb1/db_val.h:128:34: warning: array subscript 1 is above array bounds of 'db_val_t[1]' {aka 'struct <anonymous>[1]'} [-Warray-bounds] 128 | #define VAL_INT(dv) ((dv)->val.int_val) | ~~~~~~~~~~^~~~~~~~~ usrloc_db.c:225:2: note: in expansion of macro 'VAL_INT' 225 | VAL_INT(values + 1) = _c->received_port; | ^~~~~~~ usrloc_db.c:216:11: note: while referencing 'values' 216 | db_val_t values[1]; | ^~~~~~ CC (gcc) [M ims_usrloc_pcscf.so] dlist.o CC (gcc) [M ims_usrloc_pcscf.so] pcontact.o CC (gcc) [M ims_usrloc_pcscf.so] usrloc.o pcontact.c: In function 'free_security': pcontact.c:122:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation] 122 | if (!_p) | ^~ pcontact.c:125:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' 125 | if(_p->sec_header.s) | ^~ CC (gcc) [M ims_usrloc_pcscf.so] udomain.o make[3]: 'libsrdb1.so.1.0' is up to date. LD (gcc) [M ims_usrloc_pcscf.so] ims_usrloc_pcscf.so CC (gcc) [M ims_usrloc_scscf.so] contact_hslot.o CC (gcc) [M ims_usrloc_scscf.so] ul_callback.o CC (gcc) [M ims_usrloc_scscf.so] ims_usrloc_scscf_mod.o CC (gcc) [M ims_usrloc_scscf.so] ul_scscf_stats.o CC (gcc) [M ims_usrloc_scscf.so] contact_dlg_handlers.o CC (gcc) [M ims_usrloc_scscf.so] usrloc_db.o CC (gcc) [M ims_usrloc_scscf.so] subscribe.o ```
**tls_map.h** ``` CC (gcc) [M tls.so] tls_server.o CC (gcc) [M tls.so] tls_locking.o CC (gcc) [M tls.so] tls_domain.o In file included from tls_domain.c:33: tls_domain.c: In function 'load_engine_private_key': tls_map.h:46:14: warning: 'pkey' may be used uninitialized in this function [-Wmaybe-uninitialized] 46 | ( (m)->tmp = (value),\ | ^ tls_domain.c:1187:12: note: 'pkey' was declared here 1187 | EVP_PKEY *pkey; | ^~~~ CC (gcc) [M tls.so] tls_util.o LD (gcc) [M tls.so] tls.so CC (gcc) [M presence.so] notify.o CC (gcc) [M presence.so] subscribe.o ```
**tcpops.c** ``` LD (gcc) [M pv.so] pv.so CC (gcc) [M tcpops.so] tcpops_mod.o CC (gcc) [M tcpops.so] tcpops.o tcpops.c: In function 'tcpops_handle_tcp_closed': tcpops.c:264:31: warning: 'rt' may be used uninitialized in this function [-Wmaybe-uninitialized] 264 | run_top_route(event_rt.rlist[rt], fmsg, 0); | ^ tcpops.c:235:6: note: 'rt' was declared here 235 | int rt, backup_rt; | ^~ LD (gcc) [M tcpops.so] tcpops.so CC (gcc) [M db_cluster.so] dbcl_api.o CC (gcc) [M db_cluster.so] dbcl_data.o ```
**t_suspend.c & sip_msg.h** ``` CC (gcc) [M tm.so] t_fwd.o CC (gcc) [M tm.so] timer.o CC (gcc) [M tm.so] select.o CC (gcc) [M tm.so] t_suspend.o t_suspend.c: In function 't_continue_helper': t_suspend.c:526:16: warning: 'erpl' may be used uninitialized in this function [-Wmaybe-uninitialized] 526 | (void*)hdr>=(void*)erpl)) { | ~~~~~~~~~~^~~~~~~~~~~~~ In file included from t_suspend.c:29: sip_msg.h:69:15: warning: 'brpl' may be used uninitialized in this function [-Wmaybe-uninitialized] 69 | if((_p_msg)->add_rm) \ | ^~ t_suspend.c:168:13: note: 'brpl' was declared here 168 | sip_msg_t *brpl; | ^~~~ CC (gcc) [M tm.so] t_serial.o CC (gcc) [M tm.so] t_stats.o CC (gcc) [M tm.so] rpc_uac.o ```
**tm.c* ``` CC (gcc) [M tm.so] t_cancel.o CC (gcc) [M tm.so] tm.o CC (gcc) [M tm.so] t_msgbuilder.o In file included from ../../core/parser/../ut.h:42, from ../../core/parser/../ip_addr.h:39, from ../../core/parser/msg_parser.h:37, from ../../core/sr_module.h:34, from tm.c:54: In function 'ki_t_check_status', inlined from 'ki_t_check_status' at tm.c:1053:12: ../../core/parser/../dprint.h:309:8: warning: '%s' directive argument is null [-Wformat-overflow=] 309 | fprintf(stderr, "%2d(%d) %s: %s" fmt, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 310 | process_no, my_pid(), \ | ~~~~~~~~~~~~~~~~~~~~~~~ 311 | (lname)?(lname):LOG_LEVEL2NAME(__llevel), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 312 | (prefix) , ## args);\ | ~~~~~~~~~~~~~~~~~~~ ../../core/parser/../dprint.h:340:2: note: in expansion of macro 'LOG__' 340 | LOG__(facility, level, NULL, prefix, fmt, ## args) | ^~~~~ ../../core/parser/../dprint.h:344:2: note: in expansion of macro 'LOG_' 344 | LOG_(DEFAULT_FACILITY, (level), LOC_INFO, "%s(): " fmt ,\ | ^~~~ ../../core/parser/../dprint.h:395:31: note: in expansion of macro 'LOG' 395 | # define ERR(fmt, args...) LOG(L_ERR, fmt , ## args) | ^~~ ../../core/parser/../dprint.h:421:16: note: in expansion of macro 'ERR' 421 | #define LM_ERR ERR | ^~~ tm.c:1074:3: note: in expansion of macro 'LM_ERR' 1074 | LM_ERR("Bad regular expression '%s'\n", s); | ^~~~~~ tm.c: In function 'ki_t_check_status': tm.c:2862:36: note: format string is defined here 2862 | LM_ERR("failed to build proxy structure for <%.*s>\n", | ^~ In file included from ../../core/parser/../ut.h:42, from ../../core/parser/../ip_addr.h:39, from ../../core/parser/msg_parser.h:37, from ../../core/sr_module.h:34, from tm.c:54: In function 'ki_t_check_status', inlined from 'ki_t_check_status' at tm.c:1053:12: ../../core/parser/../dprint.h:303:8: warning: '%s' directive argument is null [-Wformat-overflow=] 303 | fprintf(stderr, "%2d(%d) %s: %.*s%s" fmt, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 304 | process_no, my_pid(), \ | ~~~~~~~~~~~~~~~~~~~~~~~ 305 | (lname)?(lname):LOG_LEVEL2NAME(__llevel), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 306 | log_prefix_val->len, log_prefix_val->s, \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 307 | (prefix) , ## args);\ | ~~~~~~~~~~~~~~~~~~~ ../../core/parser/../dprint.h:340:2: note: in expansion of macro 'LOG__' 340 | LOG__(facility, level, NULL, prefix, fmt, ## args) | ^~~~~ ../../core/parser/../dprint.h:344:2: note: in expansion of macro 'LOG_' 344 | LOG_(DEFAULT_FACILITY, (level), LOC_INFO, "%s(): " fmt ,\ | ^~~~ ../../core/parser/../dprint.h:395:31: note: in expansion of macro 'LOG' 395 | # define ERR(fmt, args...) LOG(L_ERR, fmt , ## args) | ^~~ ../../core/parser/../dprint.h:421:16: note: in expansion of macro 'ERR' 421 | #define LM_ERR ERR | ^~~ tm.c:1074:3: note: in expansion of macro 'LM_ERR' 1074 | LM_ERR("Bad regular expression '%s'\n", s); | ^~~~~~ tm.c: In function 'ki_t_check_status': tm.c:2862:36: note: format string is defined here 2862 | LM_ERR("failed to build proxy structure for <%.*s>\n", | ^~ CC (gcc) [M tm.so] lock.o CC (gcc) [M tm.so] config.o CC (gcc) [M tm.so] t_reply.o LD (gcc) [M tm.so] tm.so CC (gcc) [M counters.so] counters.o ```
Fixes to tm via 263b8ce5360716e44c6a7bcdbc65a76dfad67575 .
Commit for tcpops 46436cf8ef7d337c255b2fd9115544a6971f9741 .
Fixed in tm, tcpops and tls, probably still to do for db_redis and ims_registrar_scscf.
I checked build logs for 754d57f9, looks resolved all except `db_redis` and `ims_registrar_scscf`. Comments about resolved warning is hided as outdated.
I don't see those warnings in master right now: https://travis-ci.org/github/kamailio/kamailio/jobs/671234864
I pushed earlier today some patches for db_redis and ims_registrar_scscf. As the code evolved, if there are similar cases, probably is better to open a new issue.
Closed #2169.