From ba2cc578d7b9dfb618b757cc8abf0feb451ad9e8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 18 Apr 2022 20:10:54 +0200 Subject: [PATCH] helpers: fix warning in neutrinoMode_to_string(); cc1plus: warning: function may return address of local variable [-Wreturn-local-addr] ../src/system/helpers.cpp:114:16: note: declared here std::string res = s.str(); ^~~ Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/86e0ee951d0965904f3ee299dcb6f57cc304ec50 Author: vanhofen Date: 2022-04-18 (Mon, 18 Apr 2022) Origin message was: ------------------ - helpers: fix warning in neutrinoMode_to_string(); cc1plus: warning: function may return address of local variable [-Wreturn-local-addr] ../src/system/helpers.cpp:114:16: note: declared here std::string res = s.str(); ^~~ --- src/system/helpers.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index d05ea34a1..f198df497 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -111,8 +111,7 @@ const char* neutrinoMode_to_string(int mode) return "NO_REZAP"; default: s << std::hex << mode; - std::string res = s.str(); - return res.c_str(); + return s.str().c_str(); } }