Commit 70f35fe3 authored by Jim Meyering's avatar Jim Meyering Committed by Facebook Github Bot

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
parent 344f49c4
...@@ -325,7 +325,8 @@ class Core final { ...@@ -325,7 +325,8 @@ class Core final {
void doCallback() { void doCallback() {
Executor* x = executor_; Executor* x = executor_;
int8_t priority; // initialize, solely to appease clang's -Wconditional-uninitialized
int8_t priority = 0;
if (x) { if (x) {
if (!executorLock_.try_lock()) { if (!executorLock_.try_lock()) {
executorLock_.lock(); executorLock_.lock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment