From: Ivan Maidanski Date: Thu, 14 Feb 2019 20:17:36 +0000 (+0300) Subject: Workaround 'uninitialized variable: info' cppcheck false positive (OS X) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9aa26e0b55caf1035e362fb480b9d91265b1a5c5;p=gc Workaround 'uninitialized variable: info' cppcheck false positive (OS X) * darwin_stop_world.c [DEBUG_THREADS && CPPCHECK] (GC_thread_resume): Initialize info.run_state value (to 0) before thread_info() call. --- diff --git a/darwin_stop_world.c b/darwin_stop_world.c index 2872bc03..05463461 100644 --- a/darwin_stop_world.c +++ b/darwin_stop_world.c @@ -658,6 +658,9 @@ GC_INLINE void GC_thread_resume(thread_act_t thread) struct thread_basic_info info; mach_msg_type_number_t outCount = THREAD_BASIC_INFO_COUNT; +# if defined(CPPCHECK) && defined(DEBUG_THREADS) + info.run_state = 0; +# endif kern_result = thread_info(thread, THREAD_BASIC_INFO, (thread_info_t)&info, &outCount); if (kern_result != KERN_SUCCESS)