From 4e457278fa161b24c832c351cb5ade760fdca03a Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Fri, 7 Feb 2020 15:18:04 -0800 Subject: [PATCH] db/write_thread.cc: Initialize state (#6275) Summary: Fixed an error when compiled with -Og: db/write_thread.cc:183:14: error: 'state' may be used uninitialized in this function [-Werror=maybe-uninitialized] Signed-off-by: Robert Yang Pull Request resolved: https://github.com/facebook/rocksdb/pull/6275 Differential Revision: D19381755 fbshipit-source-id: a90bf3cd4a7248d9d71219e918fc6253deb97e3c --- db/write_thread.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/write_thread.cc b/db/write_thread.cc index 01342d124..98478e20d 100644 --- a/db/write_thread.cc +++ b/db/write_thread.cc @@ -61,7 +61,7 @@ uint8_t WriteThread::BlockingAwaitState(Writer* w, uint8_t goal_mask) { uint8_t WriteThread::AwaitState(Writer* w, uint8_t goal_mask, AdaptationContext* ctx) { - uint8_t state; + uint8_t state = 0; // 1. Busy loop using "pause" for 1 micro sec // 2. Else SOMETIMES busy loop using "yield" for 100 micro sec (default)