<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 25, 2017 at 7:59 PM, Joel Sherrill <span dir="ltr"><<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Apr 25, 2017 at 7:25 PM, Gedare Bloom <span dir="ltr"><<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Apr 25, 2017 at 7:14 PM, Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>> wrote:<br>
> Module:    rtems<br>
> Branch:    master<br>
> Commit:    6601684f74f0ea1ec44fb52ec75d52<wbr>215af11f5f<br>
> Changeset: <a href="http://git.rtems.org/rtems/commit/?id=6601684f74f0ea1ec44fb52ec75d52215af11f5f" rel="noreferrer" target="_blank">http://git.rtems.org/rtems/com<wbr>mit/?id=6601684f74f0ea1ec44fb5<wbr>2ec75d52215af11f5f</a><br>
><br>
> Author:    Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>><br>
> Date:      Tue Apr 25 13:57:03 2017 -0500<br>
><br>
> posix/src/mutexinit.c: Fix used before initialized warning<br>
><br>
> ---<br>
><br>
>  cpukit/posix/src/mutexinit.c | 3 +++<br>
>  1 file changed, 3 insertions(+)<br>
><br>
> diff --git a/cpukit/posix/src/mutexinit.c b/cpukit/posix/src/mutexinit.c<br>
> index 39139a4..47e0bcb 100644<br>
> --- a/cpukit/posix/src/mutexinit.c<br>
> +++ b/cpukit/posix/src/mutexinit.c<br>
> @@ -40,6 +40,9 @@ int pthread_mutex_init(<br>
>    const Scheduler_Control   *scheduler;<br>
>    Priority_Control           priority;<br>
><br>
> +  /* initialize to avoid warning for used uninitialized */<br>
> +  priority = 0;<br>
> +<br>
The warning is spurious. You could refactor the code so the compiler<br>
doesn't get confused.<br></blockquote><div><br></div></span><div>If you see how to do it, please go ahead. I have looked into this multiple</div><div>times over the years and not found the magic. </div><span class=""><div><br></div><div> </div></span></div></div></div></blockquote><div><br></div><div>I have a proposal for this. It does involve moving some of the error</div><div>checking inside the object allocator critical section. </div><div><br></div><div>Wait for a patch. I need to test it.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
>    if ( attr ) the_attr = attr;<br>
>    else        the_attr = &_POSIX_Mutex_Default_attribut<wbr>es;<br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> vc mailing list<br>
> <a href="mailto:vc@rtems.org" target="_blank">vc@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/vc" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman<wbr>/listinfo/vc</a><br>
______________________________<wbr>_________________<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<wbr>/listinfo/devel</a><br>
</blockquote></span></div><br></div></div>
</blockquote></div><br></div></div>