<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 17, 2023 at 1:15 PM Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Sebastian fixed it now. The local variable was shadowed. Another good<br>
reason to keep local variables at the start of a function ;)<br></blockquote><div><br></div><div>+1 </div><div><br></div><div>The first time I saw GCC spit this warning out was for some particularly </div><div>horrible code. It had shadowed global variables and parameters.</div><div><br></div><div>And we should get a Coverity email which says it is fixed. :)</div><div><br></div><div>--joel</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
On Sat, Jul 15, 2023 at 9:38 AM Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>> wrote:<br>
><br>
><br>
> The recent grlib changes introduced a Coverity issues.<br>
><br>
> ---------- Forwarded message ---------<br>
> From: <<a href="mailto:scan-admin@coverity.com" target="_blank">scan-admin@coverity.com</a>><br>
> Date: Sat, Jul 15, 2023 at 12:22 AM<br>
> Subject: New Defects reported by Coverity Scan for RTEMS<br>
> To: <<a href="mailto:build@rtems.org" target="_blank">build@rtems.org</a>><br>
><br>
><br>
> Hi,<br>
><br>
> Please find the latest report on new defect(s) introduced to RTEMS found with Coverity Scan.<br>
><br>
> 1 new defect(s) introduced to RTEMS found with Coverity Scan.<br>
><br>
><br>
> New defect(s) Reported-by: Coverity Scan<br>
> Showing 1 of 1 defect(s)<br>
><br>
><br>
> ** CID 1538314:  Uninitialized variables  (UNINIT)<br>
> /bsps/shared/grlib/uart/apbuart_cons.c: 448 in first_open()<br>
><br>
><br>
> ________________________________________________________________________________________________________<br>
> *** CID 1538314:  Uninitialized variables  (UNINIT)<br>
> /bsps/shared/grlib/uart/apbuart_cons.c: 448 in first_open()<br>
> 442                             return false;<br>
> 443                     }<br>
> 444<br>
> 445                     uart->sending = 0;<br>
> 446<br>
> 447                     /* Turn on RX interrupts */<br>
> >>>     CID 1538314:  Uninitialized variables  (UNINIT)<br>
> >>>     Using uninitialized value "ctrl".<br>
> 448                     ctrl |= APBUART_CTRL_RI;<br>
> 449                     if (uart->cap & CAP_DI) {<br>
> 450                             /* Use RX FIFO interrupt only if delayed interrupt available. */<br>
> 451                             ctrl |= (APBUART_CTRL_DI | APBUART_CTRL_RF);<br>
> 452                     }<br>
> 453             }<br>
><br>
><br>
> ________________________________________________________________________________________________________<br>
> To view the defects in Coverity Scan visit, <a href="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" rel="noreferrer" target="_blank">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</a><br>
><br>
> _______________________________________________<br>
> build mailing list<br>
> <a href="mailto:build@rtems.org" target="_blank">build@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/build" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/build</a><br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div>