From 9522188def733d2433b7b2dae0a3f3fda0895f1c Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Wed, 18 Mar 2026 08:59:29 +0000 Subject: [PATCH 1/2] gapbind14: unconditionally call __builtin_unreachable --- gapbind14/include/gapbind14/cpp_fn.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gapbind14/include/gapbind14/cpp_fn.hpp b/gapbind14/include/gapbind14/cpp_fn.hpp index a4e05f4ed..6123170a7 100644 --- a/gapbind14/include/gapbind14/cpp_fn.hpp +++ b/gapbind14/include/gapbind14/cpp_fn.hpp @@ -24,8 +24,7 @@ #include // for tuple, tuple_element_t #include // for true_type -#include "../../../src/semigroups-config.hpp" // for SEMIGRUOPS_HAVE___BUILTIN_UNREACHABLE -#include "gap_include.hpp" // for UInt +#include "gap_include.hpp" // for UInt namespace gapbind14::detail { // Inspired by the possible implementation of std::unreachable (C++23) @@ -36,7 +35,7 @@ namespace gapbind14::detail { // an empty function body and the noreturn attribute. #if defined(_MSC_VER) && !defined(__clang__) // MSVC __assume(false); -#elif defined(SEMIGROUPS_HAVE___BUILTIN_UNREACHABLE) +#else __builtin_unreachable(); #endif } From 67cb51b06df0b0f917a4e2bdf13ac4f677120c7a Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Wed, 18 Mar 2026 11:55:57 +0000 Subject: [PATCH 2/2] configure.ac: error if __builtin_unreachable is not present --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 54f9f71bd..8d764d3a0 100644 --- a/configure.ac +++ b/configure.ac @@ -43,12 +43,12 @@ AC_DEFUN([CHECK_COMPILER_BUILTIN], AC_MSG_RESULT(AS_VAR_GET([[have_]$1])) AS_IF([test yes = AS_VAR_GET([[have_]$1])], [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]$1), 1, - [Define to 1 if the system has the `]$1[' built-in function])], [] + [Define to 1 if the system has the `]$1[' built-in function])], + [AC_MSG_ERROR([`]$1[' is required, giving up.])] )]) CHECK_COMPILER_BUILTIN([__builtin_unreachable],[]); - dnl ## dnl ## Locate the GAP root dir dnl ##