Repository :
https://github.com/FarGroup/FarManager
On branch : master
Link :
https://github.com/FarGroup/FarManager/commit/457da91d334cf8d6118da9bcd7a67eeb8a2c8864
>---------------------------------------------------------------
commit 457da91d334cf8d6118da9bcd7a67eeb8a2c8864
Author: Alex Alabuzhev <
alab...@gmail.com>
Date: Sat Oct 25 10:52:48 2025 +0100
Warnings
>---------------------------------------------------------------
457da91d334cf8d6118da9bcd7a67eeb8a2c8864
far/exception_handler.cpp | 18 +++++++-----------
far/exception_handler_test.cpp | 2 +-
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/far/exception_handler.cpp b/far/exception_handler.cpp
index 7f86dd61a..24432ad93 100644
--- a/far/exception_handler.cpp
+++ b/far/exception_handler.cpp
@@ -2207,22 +2207,19 @@ signal_handler::~signal_handler()
std::signal(SIGABRT, m_PreviousHandler);
}
-#if IS_MICROSOFT_SDK()
-#ifndef _DEBUG // 🤦
+#if IS_MICROSOFT_SDK() && !defined _DEBUG // 🤦
extern "C" void _invalid_parameter(wchar_t const*, wchar_t const*, wchar_t const*, unsigned int, uintptr_t);
#endif
-#else
-WARNING_PUSH()
-WARNING_DISABLE_CLANG("-Wmissing-noreturn")
-void _invalid_parameter(wchar_t const*, wchar_t const*, wchar_t const*, unsigned int, uintptr_t)
+[[noreturn]]
+static void default_invalid_parameter_handler(const wchar_t* const Expression, const wchar_t* const Function, const wchar_t* const File, unsigned int const Line, uintptr_t const Reserved)
{
+#if IS_MICROSOFT_SDK()
+ _invalid_parameter(Expression, Function, File, Line, Reserved);
+#endif
os::process::terminate(STATUS_INVALID_CRUNTIME_PARAMETER);
}
-WARNING_POP()
-#endif
-
static void invalid_parameter_handler_impl(const wchar_t* const Expression, const wchar_t* const Function, const wchar_t* const File, unsigned int const Line, uintptr_t const Reserved)
{
if (!HandleCppExceptions)
@@ -2265,8 +2262,7 @@ static void invalid_parameter_handler_impl(const wchar_t* const Expression, cons
case handler_result::continue_search:
restore_system_exception_handler();
_set_invalid_parameter_handler({});
- _invalid_parameter(Expression, Function, File, Line, Reserved);
- break;
+ default_invalid_parameter_handler(Expression, Function, File, Line, Reserved);
}
}
diff --git a/far/exception_handler_test.cpp b/far/exception_handler_test.cpp
index 60856e2ad..790e1d8d0 100644
--- a/far/exception_handler_test.cpp
+++ b/far/exception_handler_test.cpp
@@ -587,7 +587,7 @@ namespace tests
static void asan_double_free()
{
- const auto Ptr = malloc(1);
+ volatile const auto Ptr = malloc(1);
free(Ptr);
free(Ptr);
}