3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-08-02 12:13:25 +00:00
z3/src
davedets c49eb07c3e
Fix remaining clang warnings for fallthrough switch cases (in debug build). (#10314)
https://github.com/Z3Prover/z3/pull/10284 changed the UNREACHABLE macro
in debug.h to use __builtin_unreachable() to indicate to the compiler
that the
code leading it should be considered unreachable.

In https://github.com/Z3Prover/z3/pull/10295 Copilot figured out that
this was wrong: the unreachable macro makes calls, which shouldn't be
elided, and whose arguments should be evaluated. It partially fixed the
problem by declaring invoke_exit_action to be `[[noreturn]]`. This
eliminated warnings in non-debug builds, but when Z3_DEBUG is enabled,
`UNREACHABLE` ends with an invocation of `INVOKE_DEBUGER()`. This can
call `invoke_debugger()`, which *can* actually return (so it can't be
given the `[[noreturn]]` attribute. So we still get warnings in debug
builds.

This PR fixes those, creating a Z3_unreachable_case macro, which is just
a combination of `UNREACHABLE()` and `Z3_fallthrough`. It uses that in
the places that give warnings.

It seemed better to me to still have these cases have a single macro,
rather than `UNREACHABLE` followed by an explicit `Z3_fallthrough`; this
seemed to me like it would confuse people -- "how can you fall through
if this code is unreachable?" But I'm open to alternative suggestions!
2026-07-30 19:24:46 -07:00
..
ackermannization block ackermann over nested selects 2026-06-19 10:41:56 -07:00
api Load versioned libz3 soname in Python bindings on Linux (#10290) 2026-07-29 14:01:55 -07:00
ast Fix remaining clang warnings for fallthrough switch cases (in debug build). (#10314) 2026-07-30 19:24:46 -07:00
cmd_context Remove new instances of unused local vars and functions (#10309) 2026-07-30 13:41:20 -07:00
math Imp fix (#10304) 2026-07-30 12:45:06 -07:00
model updates to tptp_frontend 2026-07-04 14:34:21 -07:00
muz Make implicit switch case fall-throughs explicit (#10284) 2026-07-29 09:05:42 -07:00
nlsat Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
opt Make implicit switch case fall-throughs explicit (#10284) 2026-07-29 09:05:42 -07:00
params Imp fix (#10304) 2026-07-30 12:45:06 -07:00
parsers scanner: emit ERROR_TOKEN on I/O failure instead of silent EOF (#10294) 2026-07-29 14:00:42 -07:00
qe [snapshot-regression-fix] Spacer: keep symbolic term_graph representatives to fix 'Stuck on a lemma' regression (#10237) 2026-07-29 14:19:25 -07:00
sat Make implicit switch case fall-throughs explicit (#10284) 2026-07-29 09:05:42 -07:00
shell Fixes necessary to compile z3 included in clang-tidy via FetchContents. (#9768) 2026-06-08 19:44:01 -07:00
smt Fix remaining clang warnings for fallthrough switch cases (in debug build). (#10314) 2026-07-30 19:24:46 -07:00
solver fix: parallel mode exits unknown immediately for QF_BV due to reason-string mismatch (#10183) 2026-07-21 19:48:55 -07:00
tactic Make implicit switch case fall-throughs explicit (#10284) 2026-07-29 09:05:42 -07:00
test Remove seq_split regex factorization module 2026-07-29 15:38:21 -07:00
util Fix remaining clang warnings for fallthrough switch cases (in debug build). (#10314) 2026-07-30 19:24:46 -07:00
CMakeLists.txt git bindings v1.0 2026-02-18 21:02:25 -08:00