For the record, below DEADCODE warnings are "false" positives -- technically correct, but due to the VTY_NEWLINE macro:
#define VTY_NEWLINE ((vty->type == VTY_TERM) ? "\r\n" : "\n")
906 if (vty->type == VTY_TERM)
CID 368762: Control flow issues (DEADCODE) Execution cannot reach the expression ""\n"" inside this statement: "vty_out(vty, "%% WARNING: n...".907 vty_out(vty, "%% WARNING: nft configuration changes need a restart of osmo-hnbgw%s", VTY_NEWLINE);
On Tue, May 28, 2024 at 11:00:54PM +0000, scan-admin@coverity.com wrote:
Hi,
Please find the latest report on new defect(s) introduced to Osmocom found with Coverity Scan.
2 new defect(s) introduced to Osmocom found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan Showing 2 of 2 defect(s)
** CID 368762: Control flow issues (DEADCODE) /source-Osmocom/osmo-hnbgw/src/osmo-hnbgw/hnbgw_vty.c: 907 in cfg_hnbgw_no_nft_kpi()
*** CID 368762: Control flow issues (DEADCODE) /source-Osmocom/osmo-hnbgw/src/osmo-hnbgw/hnbgw_vty.c: 907 in cfg_hnbgw_no_nft_kpi() 901 902 DEFUN(cfg_hnbgw_no_nft_kpi, cfg_hnbgw_no_nft_kpi_cmd, 903 "no nft-kpi", 904 NO_STR NFT_KPI_STR) 905 { 906 if (vty->type == VTY_TERM)
CID 368762: Control flow issues (DEADCODE) Execution cannot reach the expression ""\n"" inside this statement: "vty_out(vty, "%% WARNING: n...".907 vty_out(vty, "%% WARNING: nft configuration changes need a restart of osmo-hnbgw%s", VTY_NEWLINE); 908 g_hnbgw->config.nft_kpi.enable = false; 909 return CMD_SUCCESS; 910 } 911 912 #if ENABLE_PFCP
** CID 368761: Control flow issues (DEADCODE) /source-Osmocom/osmo-hnbgw/src/osmo-hnbgw/hnbgw_vty.c: 894 in cfg_hnbgw_nft_kpi()
*** CID 368761: Control flow issues (DEADCODE) /source-Osmocom/osmo-hnbgw/src/osmo-hnbgw/hnbgw_vty.c: 894 in cfg_hnbgw_nft_kpi() 888 { 889 const char *set_table_name = NULL; 890 if (argc > 0) 891 set_table_name = argv[0]; 892 893 if (vty->type == VTY_TERM)
CID 368761: Control flow issues (DEADCODE) Execution cannot reach the expression ""\n"" inside this statement: "vty_out(vty, "%% WARNING: n...".894 vty_out(vty, "%% WARNING: nft configuration changes need a restart of osmo-hnbgw%s", VTY_NEWLINE); 895 896 g_hnbgw->config.nft_kpi.enable = true; 897 osmo_talloc_replace_string(g_hnbgw, &g_hnbgw->config.nft_kpi.table_name, set_table_name); 898 899 return CMD_SUCCESS;
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=u001.AxU2LYlgjL6eX23u9ErQy-2B...
To manage Coverity Scan email notifications for "nhofmeyr@sysmocom.de", click https://u15810271.ct.sendgrid.net/ls/click?upn=u001.AxU2LYlgjL6eX23u9ErQy-2B...