From 939c0323363a3b83f9d3e02c57c66b298ceb6e4e Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 27 May 2019 13:03:43 +0800 Subject: [PATCH] mon/OSDMonitor: always initialize local variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit this change helps to silence warning like: OSDMonitor.cc:13391:15: warning: ‘prio’ may be used uninitialized in this function [-Wmaybe-uninitialized] 13391 | int64_t prio; | ^~~~ Signed-off-by: Kefu Chai --- src/mon/OSDMonitor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 0e8efd44a69..8db5cdfeb9c 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -13388,7 +13388,7 @@ void OSDMonitor::convert_pool_priorities(void) const auto &pool = i.second; if (pool.opts.is_set(key)) { - int64_t prio; + int64_t prio = 0; pool.opts.get(key, &prio); if (prio > max_prio) max_prio = prio; -- 2.39.5