From 404ab5ebd11d354ad3584c20574b6d72219bdd77 Mon Sep 17 00:00:00 2001 From: Kannan Dorairaj Date: Tue, 6 Aug 2019 11:45:06 +0530 Subject: [PATCH] Resolves issue #16: Added return statements --- src/CMakeLists.txt | 2 +- src/ConsoleMetric.actor.cpp | 3 +++ src/QLPlan.actor.cpp | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c9d1b34..6c2d28a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -122,7 +122,7 @@ target_compile_options(fdbdoc -Werror -Wno-error=format -Wno-deprecated - # -Wreturn-type + -Wreturn-type -fvisibility=hidden -fno-omit-frame-pointer ) diff --git a/src/ConsoleMetric.actor.cpp b/src/ConsoleMetric.actor.cpp index a802705..0e39e43 100644 --- a/src/ConsoleMetric.actor.cpp +++ b/src/ConsoleMetric.actor.cpp @@ -141,6 +141,9 @@ MetricStat& MetricStat::captureNewValue(int64_t val) { sum += val; avg = (double)sum / (double)count; return *this; + default: + // Issue #16: Added default return statement to fix the warning during compilation + return *this; } } } diff --git a/src/QLPlan.actor.cpp b/src/QLPlan.actor.cpp index 43e530d..51e6218 100644 --- a/src/QLPlan.actor.cpp +++ b/src/QLPlan.actor.cpp @@ -247,9 +247,9 @@ Optional> IndexScanPlan::push_down(Reference>(); } - } else { - return Optional>(); } + // Issue #16: Added return statement in right place to fix the warning during compilation + return Optional>(); } ACTOR static Future doFilter(PlanCheckpoint* checkpoint,