Re: grlib changes Fwd: New Defects reported by Coverity Scan for RTEMS
On Mon, Jul 17, 2023 at 1:15 PM Gedare Bloom wrote: > Sebastian fixed it now. The local variable was shadowed. Another good > reason to keep local variables at the start of a function ;) > +1 The first time I saw GCC spit this warning out was for some particularly horrible code. It had shadowed global variables and parameters. And we should get a Coverity email which says it is fixed. :) --joel > > On Sat, Jul 15, 2023 at 9:38 AM Joel Sherrill wrote: > > > > > > The recent grlib changes introduced a Coverity issues. > > > > -- Forwarded message - > > From: > > Date: Sat, Jul 15, 2023 at 12:22 AM > > Subject: New Defects reported by Coverity Scan for RTEMS > > To: > > > > > > Hi, > > > > Please find the latest report on new defect(s) introduced to RTEMS found > with Coverity Scan. > > > > 1 new defect(s) introduced to RTEMS found with Coverity Scan. > > > > > > New defect(s) Reported-by: Coverity Scan > > Showing 1 of 1 defect(s) > > > > > > ** CID 1538314: Uninitialized variables (UNINIT) > > /bsps/shared/grlib/uart/apbuart_cons.c: 448 in first_open() > > > > > > > > > *** CID 1538314: Uninitialized variables (UNINIT) > > /bsps/shared/grlib/uart/apbuart_cons.c: 448 in first_open() > > 442 return false; > > 443 } > > 444 > > 445 uart->sending = 0; > > 446 > > 447 /* Turn on RX interrupts */ > > >>> CID 1538314: Uninitialized variables (UNINIT) > > >>> Using uninitialized value "ctrl". > > 448 ctrl |= APBUART_CTRL_RI; > > 449 if (uart->cap & CAP_DI) { > > 450 /* Use RX FIFO interrupt only if delayed > interrupt available. */ > > 451 ctrl |= (APBUART_CTRL_DI | > APBUART_CTRL_RF); > > 452 } > > 453 } > > > > > > > > > To view the defects in Coverity Scan visit, > https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypUUzi-2FdSNmuyRB7BEFT8xQ4-2B8hpujh0hTgQljRGId4Dg-3D-3DHAM__EU3W9teASMK00lBXX9WT4lsogDrkCcNZLvg-2FVxwAXMo-2BfWe9y-2FQVPI3NBuKOOB9pEF0PWPhWQO6FUVOcAwwdagvzNKH7AA8SymQIigXNwofEBIHyLL-2FrZJgQDgEg0O4g4HS-2FjBhvvcGAhWWb-2FxsDZrRDyXAMAUd-2BRwY7jJKszizp8zBz7IR2apEMP0z49hqJcf-2F9hLs1Dn-2B7C8NzR5v-2Bdg-3D-3D > > > > ___ > > build mailing list > > bu...@rtems.org > > http://lists.rtems.org/mailman/listinfo/build > > ___ > > devel mailing list > > devel@rtems.org > > http://lists.rtems.org/mailman/listinfo/devel > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: grlib changes Fwd: New Defects reported by Coverity Scan for RTEMS
Sebastian fixed it now. The local variable was shadowed. Another good reason to keep local variables at the start of a function ;) On Sat, Jul 15, 2023 at 9:38 AM Joel Sherrill wrote: > > > The recent grlib changes introduced a Coverity issues. > > -- Forwarded message - > From: > Date: Sat, Jul 15, 2023 at 12:22 AM > Subject: New Defects reported by Coverity Scan for RTEMS > To: > > > Hi, > > Please find the latest report on new defect(s) introduced to RTEMS found with > Coverity Scan. > > 1 new defect(s) introduced to RTEMS found with Coverity Scan. > > > New defect(s) Reported-by: Coverity Scan > Showing 1 of 1 defect(s) > > > ** CID 1538314: Uninitialized variables (UNINIT) > /bsps/shared/grlib/uart/apbuart_cons.c: 448 in first_open() > > > > *** CID 1538314: Uninitialized variables (UNINIT) > /bsps/shared/grlib/uart/apbuart_cons.c: 448 in first_open() > 442 return false; > 443 } > 444 > 445 uart->sending = 0; > 446 > 447 /* Turn on RX interrupts */ > >>> CID 1538314: Uninitialized variables (UNINIT) > >>> Using uninitialized value "ctrl". > 448 ctrl |= APBUART_CTRL_RI; > 449 if (uart->cap & CAP_DI) { > 450 /* Use RX FIFO interrupt only if delayed > interrupt available. */ > 451 ctrl |= (APBUART_CTRL_DI | APBUART_CTRL_RF); > 452 } > 453 } > > > > To view the defects in Coverity Scan visit, > https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypUUzi-2FdSNmuyRB7BEFT8xQ4-2B8hpujh0hTgQljRGId4Dg-3D-3DHAM__EU3W9teASMK00lBXX9WT4lsogDrkCcNZLvg-2FVxwAXMo-2BfWe9y-2FQVPI3NBuKOOB9pEF0PWPhWQO6FUVOcAwwdagvzNKH7AA8SymQIigXNwofEBIHyLL-2FrZJgQDgEg0O4g4HS-2FjBhvvcGAhWWb-2FxsDZrRDyXAMAUd-2BRwY7jJKszizp8zBz7IR2apEMP0z49hqJcf-2F9hLs1Dn-2B7C8NzR5v-2Bdg-3D-3D > > ___ > build mailing list > bu...@rtems.org > http://lists.rtems.org/mailman/listinfo/build > ___ > devel mailing list > devel@rtems.org > http://lists.rtems.org/mailman/listinfo/devel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
grlib changes Fwd: New Defects reported by Coverity Scan for RTEMS
The recent grlib changes introduced a Coverity issues. -- Forwarded message - From: Date: Sat, Jul 15, 2023 at 12:22 AM Subject: New Defects reported by Coverity Scan for RTEMS To: Hi, Please find the latest report on new defect(s) introduced to RTEMS found with Coverity Scan. 1 new defect(s) introduced to RTEMS found with Coverity Scan. New defect(s) Reported-by: Coverity Scan Showing 1 of 1 defect(s) ** CID 1538314: Uninitialized variables (UNINIT) /bsps/shared/grlib/uart/apbuart_cons.c: 448 in first_open() *** CID 1538314: Uninitialized variables (UNINIT) /bsps/shared/grlib/uart/apbuart_cons.c: 448 in first_open() 442 return false; 443 } 444 445 uart->sending = 0; 446 447 /* Turn on RX interrupts */ >>> CID 1538314: Uninitialized variables (UNINIT) >>> Using uninitialized value "ctrl". 448 ctrl |= APBUART_CTRL_RI; 449 if (uart->cap & CAP_DI) { 450 /* Use RX FIFO interrupt only if delayed interrupt available. */ 451 ctrl |= (APBUART_CTRL_DI | APBUART_CTRL_RF); 452 } 453 } To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypUUzi-2FdSNmuyRB7BEFT8xQ4-2B8hpujh0hTgQljRGId4Dg-3D-3DHAM__EU3W9teASMK00lBXX9WT4lsogDrkCcNZLvg-2FVxwAXMo-2BfWe9y-2FQVPI3NBuKOOB9pEF0PWPhWQO6FUVOcAwwdagvzNKH7AA8SymQIigXNwofEBIHyLL-2FrZJgQDgEg0O4g4HS-2FjBhvvcGAhWWb-2FxsDZrRDyXAMAUd-2BRwY7jJKszizp8zBz7IR2apEMP0z49hqJcf-2F9hLs1Dn-2B7C8NzR5v-2Bdg-3D-3D ___ build mailing list bu...@rtems.org http://lists.rtems.org/mailman/listinfo/build ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel