Skip to content

Commit

Permalink
Applying [[noreturn]] attribute to asset_internal
Browse files Browse the repository at this point in the history
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]"
  • Loading branch information
clemahieu committed Jan 24, 2024
1 parent b225de0 commit a805a62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nano/lib/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a805a62

Please sign in to comment.