[rtems commit] posix/src/mutexinit.c: Fix used before initialized warning

Joel Sherrill joel at rtems.org
Tue Apr 25 23:14:15 UTC 2017


Module:    rtems
Branch:    master
Commit:    6601684f74f0ea1ec44fb52ec75d52215af11f5f
Changeset: http://git.rtems.org/rtems/commit/?id=6601684f74f0ea1ec44fb52ec75d52215af11f5f

Author:    Joel Sherrill <joel at rtems.org>
Date:      Tue Apr 25 13:57:03 2017 -0500

posix/src/mutexinit.c: Fix used before initialized warning

---

 cpukit/posix/src/mutexinit.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cpukit/posix/src/mutexinit.c b/cpukit/posix/src/mutexinit.c
index 39139a4..47e0bcb 100644
--- a/cpukit/posix/src/mutexinit.c
+++ b/cpukit/posix/src/mutexinit.c
@@ -40,6 +40,9 @@ int pthread_mutex_init(
   const Scheduler_Control   *scheduler;
   Priority_Control           priority;
 
+  /* initialize to avoid warning for used uninitialized */
+  priority = 0;
+
   if ( attr ) the_attr = attr;
   else        the_attr = &_POSIX_Mutex_Default_attributes;
 




More information about the vc mailing list