]> granicus.if.org Git - gc/commitdiff
Workaround false 'uninitialized var use' code defect (initsecondarythread)
authorIvan Maidanski <ivmai@mail.ru>
Fri, 21 Jul 2017 16:34:10 +0000 (19:34 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 21 Jul 2017 16:34:10 +0000 (19:34 +0300)
* tests/initsecondarythread.c [GC_PTHREADS && LINT2] (main): Initialize
"t" local variable to some value (e.g. result of pthread_create()).

tests/initsecondarythread.c

index 73cc298d323e35b429bf845ec364c21f093462bd..3b2040db2023d972964df4027350d7ec09b1b4dc 100644 (file)
@@ -60,6 +60,10 @@ int main(void)
 # ifdef GC_PTHREADS
     int code;
     pthread_t t;
+
+#   ifdef LINT2
+      t = pthread_self(); /* explicitly initialize to some value */
+#   endif
 # else
     HANDLE t;
     DWORD thread_id;