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, [email protected] 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-2BKADyCpvUKOL6EWmZljiu7uzej-2F0F0MUA6-2FvWsJKEBpq8z5FXGY-2FGgxctuTDMCUncPa27o0hG0ln3IqwTMkZjs-3D7Zcl_HeJmfRUiS8FsJ6jlGYJADGMcjt7b7KJAJHdWXjKZP-2BX1ozOL3XL-2Fq5vXKyB9dOKVc-2FFyBDh7zbAyBsCMwCUBtKgrUoIryvvmKJlZUWQHV0UCp44bPZNFAJKhY-2BZXQVR9rxRZ5WiUFAFlFGuHlr6clb05yKADgB5UW1klMNDyZ50j5Uzm2Y-2BejZRwJ6mdt1NrZpKFJkj20mbBnfTZnk3AVw-3D-3D
> 
>   To manage Coverity Scan email notifications for "[email protected]", 
> click 
> https://u15810271.ct.sendgrid.net/ls/click?upn=u001.AxU2LYlgjL6eX23u9ErQy-2BKADyCpvUKOL6EWmZljiu7pjbMDOYlReyk8b5yS9SDrmKQM-2BB1kXERYCY1FGEZxGXFffnkDH0Avrc2pNx1ysF6SxAKurn2it-2FSNxgDqEOiDLdZLThk7knSk0c1wcrnyvHii3cL7JJ8tl0QjRRfLg44-3DouQV_HeJmfRUiS8FsJ6jlGYJADGMcjt7b7KJAJHdWXjKZP-2BX1ozOL3XL-2Fq5vXKyB9dOKVrXClbGWmIgAx6940KqxU7vm91v7h0AODb1Sfsgf6p79QoU7WldfWF7P-2FGAQf29jw9n4iU-2Bghnt3yIkMqXnG3Q0R3OjKaKLHb-2B6G3M9smYRdBmo-2FjkfIOeORGU1OQGhJ-2BQeZ1THdEEtOxYqLMVKSdOQ-3D-3D
> 

-- 
- Neels Hofmeyr <[email protected]>         https://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Siemensstr. 26a
* 10551 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte

Reply via email to