LibJS: Mark test262's __assert_fail as extern "C" and use

...`__attribute__((__noreturn__))`

This is more inline with the definition in glibc's version of the file,
and stops clang from complaining about it originally not being declared
as `[[no_return]]`.
This commit is contained in:
Hendiadyoin1 2022-09-13 16:02:55 +02:00 committed by Andreas Kling
parent 5bd34f115e
commit e68a35611b

View file

@ -550,7 +550,7 @@ void __assertion_failed(char const* assertion)
handle_failed_assert(assertion);
}
#else
[[noreturn]] void __assert_fail(char const* assertion, char const* file, unsigned int line, char const* function)
extern "C" __attribute__((__noreturn__)) void __assert_fail(char const* assertion, char const* file, unsigned int line, char const* function)
{
auto full_message = String::formatted("{}:{}: {}: Assertion `{}' failed.", file, line, function, assertion);
handle_failed_assert(full_message.characters());