From df7f5e46608cf4f3aa9384ef81a6114c0d5aa9f2 Mon Sep 17 00:00:00 2001 From: Louis Rubet Date: Sat, 5 Feb 2022 14:01:20 +0100 Subject: [PATCH] #223 add missing return (detected by gcc 11) --- src/object.hpp | 6 +++--- src/program.cpp | 2 +- src/stack.hpp | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/object.hpp b/src/object.hpp index ec0d7d2..4c06fbf 100644 --- a/src/object.hpp +++ b/src/object.hpp @@ -44,11 +44,11 @@ struct floating_t { mpfr_custom_move(mpfr, significand); } - floating_t& operator=(const double val) { mpfr_set_d(mpfr, val, s_mpfr_rnd); } + floating_t& operator=(const double val) { mpfr_set_d(mpfr, val, s_mpfr_rnd); return *this; } - floating_t& operator=(const long int val) { mpfr_set_si(mpfr, val, s_mpfr_rnd); } + floating_t& operator=(const long int val) { mpfr_set_si(mpfr, val, s_mpfr_rnd); return *this; } - floating_t& operator=(const unsigned long val) { mpfr_set_ui(mpfr, val, s_mpfr_rnd); } + floating_t& operator=(const unsigned long val) { mpfr_set_ui(mpfr, val, s_mpfr_rnd); return *this; } operator double() { return mpfr_get_d(mpfr, s_mpfr_rnd); } diff --git a/src/program.cpp b/src/program.cpp index 5bb4729..22af5db 100644 --- a/src/program.cpp +++ b/src/program.cpp @@ -1,4 +1,4 @@ -#include "program.hpp" + #include "program.hpp" //< return type strings const char* program::s_ret_value_string[ret_max] = RET_VALUE_STRINGS; diff --git a/src/stack.hpp b/src/stack.hpp index bea54aa..4a81228 100644 --- a/src/stack.hpp +++ b/src/stack.hpp @@ -306,6 +306,8 @@ class heap : public stack { ret = true; } } + + return ret; } /// @brief whether a variable exists in heap or not