From: Jia Tan Date: Wed, 28 Jun 2023 12:31:11 +0000 (+0800) Subject: liblzma: Prevent uninitialzed warning in mt stream encoder. X-Git-Tag: v5.2.13~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f9bf810441d37a1ab3626a67c9369ea27243915;p=thirdparty%2Fxz.git liblzma: Prevent uninitialzed warning in mt stream encoder. This change only impacts the compiler warning since it was impossible for the wait_abs struct in stream_encode_mt() to be used before it was initialized since mythread_condtime_set() will always be called before mythread_cond_timedwait(). Since the mythread.h code is different between the POSIX and Windows versions, this warning was only present on Windows builds. Thanks to Arthur S for reporting the warning and providing an initial patch. (cherry picked from commit 1155471651ad456c5f90aee6435931fae65682bf) --- diff --git a/src/liblzma/common/stream_encoder_mt.c b/src/liblzma/common/stream_encoder_mt.c index 573a13b5..3a4c345c 100644 --- a/src/liblzma/common/stream_encoder_mt.c +++ b/src/liblzma/common/stream_encoder_mt.c @@ -692,7 +692,7 @@ stream_encode_mt(void *coder_ptr, const lzma_allocator *allocator, // These are for wait_for_work(). bool has_blocked = false; - mythread_condtime wait_abs; + mythread_condtime wait_abs = { 0 }; while (true) { mythread_sync(coder->mutex) {