blob: 97ddbce597c4f18e97738e662e8fd55dbde5b7df [file] [log] [blame]
Brad Bishope42b3e32020-01-15 22:08:42 -05001From 49dcd22dcf1aae5995c42eac0fda68516fc1cd43 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Wed, 19 Jun 2019 17:57:24 +0800
4Subject: [PATCH] db/write_thread.cc: Initialize state
5
6Fixed an error when compiled without -O2:
7db/write_thread.cc:183:14: error: 'state' may be used uninitialized in this function [-Werror=maybe-uninitialized]
8
9Upstream-Status: Pending
10
11Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
12---
13 db/write_thread.cc | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/db/write_thread.cc b/db/write_thread.cc
17index 835992c..6f99a11 100644
18--- a/db/write_thread.cc
19+++ b/db/write_thread.cc
20@@ -59,7 +59,7 @@ uint8_t WriteThread::BlockingAwaitState(Writer* w, uint8_t goal_mask) {
21
22 uint8_t WriteThread::AwaitState(Writer* w, uint8_t goal_mask,
23 AdaptationContext* ctx) {
24- uint8_t state;
25+ uint8_t state = 0;
26
27 // 1. Busy loop using "pause" for 1 micro sec
28 // 2. Else SOMETIMES busy loop using "yield" for 100 micro sec (default)
29--
302.7.4
31