From 60ebafb4f8900eafdbca3c06d6a61a4ec034736f Mon Sep 17 00:00:00 2001 From: Louis Brandy Date: Thu, 3 Nov 2016 10:35:18 -0700 Subject: [PATCH] quiet -Wmaybe-uninitialized Summary: gcc-4.9 doesn't appreciate this clever loop and worries about `prev` being uninitialized on first use. Assuming the rest of the program behaves properly and preserves the invariant this code is expecting, this isn't bugged. But let's initialize it anyway. Reviewed By: meyering Differential Revision: D4120746 fbshipit-source-id: 1a7c323a4b6296a81768a62dd7d72337c5c35bf0 --- folly/stats/MultiLevelTimeSeries-defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/folly/stats/MultiLevelTimeSeries-defs.h b/folly/stats/MultiLevelTimeSeries-defs.h index f20305a7..3e8c853d 100644 --- a/folly/stats/MultiLevelTimeSeries-defs.h +++ b/folly/stats/MultiLevelTimeSeries-defs.h @@ -50,7 +50,7 @@ MultiLevelTimeSeries::MultiLevelTimeSeries( levels_.reserve(durations.size()); int i = 0; - Duration prev; + Duration prev{0}; for (auto dur : durations) { if (dur == Duration(0)) { CHECK_EQ(i, durations.size() - 1); -- 2.34.1