From 70f35fe332261673129069bb6d9239c0a5e2e0cc Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 4 Jul 2017 23:56:54 -0700 Subject: [PATCH] folly/futures/detail/Core.h: avoid FP from clang's -Wconditional-uninitialized Summary: Avoid this false positive from clang: folly/futures/detail/Core.h:369:15: error: variable 'priority' may be uninitialized when used here [-Werror,-Wconditional-uninitialized] Reviewed By: yfeldblum Differential Revision: D5369916 fbshipit-source-id: 49649417d1b799cc3945cba456b42ab438ad2ddc --- folly/futures/detail/Core.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/folly/futures/detail/Core.h b/folly/futures/detail/Core.h index fd73e276..30d421c0 100644 --- a/folly/futures/detail/Core.h +++ b/folly/futures/detail/Core.h @@ -325,7 +325,8 @@ class Core final { void doCallback() { Executor* x = executor_; - int8_t priority; + // initialize, solely to appease clang's -Wconditional-uninitialized + int8_t priority = 0; if (x) { if (!executorLock_.try_lock()) { executorLock_.lock(); -- 2.34.1