Revision control

Copy as Markdown

From 410c69f94be247ab1baed42abad56920ef218846 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Fri, 20 Feb 2026 13:34:58 -0800
Subject: [PATCH] Fix build with pre-C23 compilers other than GCC, Clang, or
MSVC
We forgot to define `unreachable()` for them.
Found when trying to compile Qt for INTEGRITY:
```
"/home/qt/work/qt/qtbase/src/corelib/../3rdparty/tinycbor/src/cborparser.c", line 246: error #20:
identifier "unreachable" is undefined
cbor_assert(false); /* these conditions can't be reached */
^
```
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
---
src/compilersupport_p.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/compilersupport_p.h b/src/compilersupport_p.h
index 7f24773..7114e4d 100644
--- a/src/compilersupport_p.h
+++ b/src/compilersupport_p.h
@@ -225,6 +225,8 @@
# define unreachable() __builtin_unreachable()
#elif defined(_MSC_VER)
# define unreachable() __assume(0)
+#else
+# define unreachable()
#endif
static inline bool add_check_overflow(size_t v1, size_t v2, size_t *r)
--
2.53.0