From: Jim Meyering Date: Wed, 5 Jul 2017 06:56:54 +0000 (-0700) Subject: folly/futures/detail/Core.h: avoid FP from clang's -Wconditional-uninitialized X-Git-Tag: v2017.07.10.00~10 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=70f35fe332261673129069bb6d9239c0a5e2e0cc;p=folly.git 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 --- 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();