From 47fb5d2b13c5ca8e1a3b05ed223d62ea4b43b3e8 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Sat, 20 Jul 2024 00:24:35 +0100 Subject: [PATCH] kyua: fix gcc builds For some reason execenv::exec() isn't successfully marked noreturn (rlibby reports that virtual functions can't be noreturn), but calling methods are so gcc rightly complains. Work around this by adding explicit __builtin_unreachable() calls. Reviewed by: imp, markj Fixes: 257e70f1d5ee kyua: Add FreeBSD Jail execution environment support Differential Revision: https://reviews.freebsd.org/D46041 --- contrib/kyua/engine/atf.cpp | 2 ++ contrib/kyua/engine/plain.cpp | 1 + contrib/kyua/engine/tap.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/contrib/kyua/engine/atf.cpp b/contrib/kyua/engine/atf.cpp index f6746dd2f29f..47f3bd2a1903 100644 --- a/contrib/kyua/engine/atf.cpp +++ b/contrib/kyua/engine/atf.cpp @@ -196,6 +196,7 @@ engine::atf_interface::exec_test(const model::test_program& test_program, auto e = execenv::get(test_program, test_case_name); e->init(); e->exec(args); + __builtin_unreachable(); } @@ -227,6 +228,7 @@ engine::atf_interface::exec_cleanup( auto e = execenv::get(test_program, test_case_name); e->exec(args); + __builtin_unreachable(); } diff --git a/contrib/kyua/engine/plain.cpp b/contrib/kyua/engine/plain.cpp index 9a2c63f8b663..0aba9b3fb6fa 100644 --- a/contrib/kyua/engine/plain.cpp +++ b/contrib/kyua/engine/plain.cpp @@ -110,6 +110,7 @@ engine::plain_interface::exec_test( auto e = execenv::get(test_program, test_case_name); e->init(); e->exec(args); + __builtin_unreachable(); } diff --git a/contrib/kyua/engine/tap.cpp b/contrib/kyua/engine/tap.cpp index ed35ba40433f..716212d18d02 100644 --- a/contrib/kyua/engine/tap.cpp +++ b/contrib/kyua/engine/tap.cpp @@ -157,6 +157,7 @@ engine::tap_interface::exec_test( auto e = execenv::get(test_program, test_case_name); e->init(); e->exec(args); + __builtin_unreachable(); }