From 92ef79ed54e50a4db8594649ff0afc308401da95 Mon Sep 17 00:00:00 2001 From: clemahieu Date: Wed, 24 Jan 2024 15:12:25 +0000 Subject: [PATCH] Applying [[noreturn]] attribute to asset_internal (#4392) This will silence warnings/errors in functions that don't return values in control flow paths that end with release_assert. "warning: non-void function does not return a value in all control paths [-Wreturn-type]" --- nano/lib/utility.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nano/lib/utility.hpp b/nano/lib/utility.hpp index 331c0534..72ea310d 100644 --- a/nano/lib/utility.hpp +++ b/nano/lib/utility.hpp @@ -29,7 +29,7 @@ namespace program_options } } -void assert_internal (char const * check_expr, char const * func, char const * file, unsigned int line, bool is_release_assert, std::string_view error = ""); +[[noreturn]] void assert_internal (char const * check_expr, char const * func, char const * file, unsigned int line, bool is_release_assert, std::string_view error = ""); #define release_assert_1(check) check ? (void)0 : assert_internal (#check, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__, true) #define release_assert_2(check, error_msg) check ? (void)0 : assert_internal (#check, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__, true, error_msg)