# Replace \`unreachable\` with error return for non-standard Windows targets · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/d3363b7a61cc0833d6eb60077b90cf12b95155f0)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: d3363b7a61cc0833d6eb60077b90cf12b95155f0

Requested commit: d3363b7a61cc0833d6eb60077b90cf12b95155f0

Commit: d3363b7a61cc0833d6eb60077b90cf12b95155f0

Tree: bfaa01885576ed88f140a2a7b354e07fc8b62fcd

Author: Ryan Liptak

Committer: Alex Rønne Petersen

## Message

````
Replace `unreachable` with error return for non-standard Windows targets

This new error mirrors the error returned from the Elf struct (error.UnsupportedElfArchitecture):

https://github.com/ziglang/zig/blob/0adcfd60f4fcfd01c74a6477cbcef187ce06f533/src/link/Lld.zig#L112

Before:

```
$ zig build-exe -target riscv64-windows-gnu main.zig
thread 543087 panic: reached unreachable code
```

After:

```
$ zig build-exe -target riscv64-windows-gnu main.zig
error: unable to create compilation: UnsupportedCoffArchitecture
```

Closes #24287

````

## Parents

- [6322dbd5bf112356efdf2ec64c5471d6e8586a74](https://git.cafe/gitcafe/zig/commit/6322dbd5bf112356efdf2ec64c5471d6e8586a74?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/d3363b7a61cc0833d6eb60077b90cf12b95155f0?format=markdown)
