[clang] hurd: Fix build with -Werror,-Wswitch (PR #78520)

Florian Mayer via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 17:23:50 PST 2024


fmayer wrote:

Drive-by: is the `llvm_unreachable` actually unreachable? I.e. we never call this function with this case? Otherwise we are introducing UB in `NDEBUG` builds

```
/// In NDEBUG builds, if the platform does not support a builtin unreachable
/// then we call an internal LLVM runtime function. Otherwise the behavior is
/// controlled by the CMake flag
///   -DLLVM_UNREACHABLE_OPTIMIZE
/// * When "ON" (default) llvm_unreachable() becomes an optimizer hint
///   that the current location is not supposed to be reachable: the hint
///   turns such code path into undefined behavior.  On compilers that don't
///   support such hints, prints a reduced message instead and aborts the
///   program.
```

https://github.com/llvm/llvm-project/pull/78520


More information about the cfe-commits mailing list