# translate-c: support GCC/Clang pointer subtraction extension · gitcafe/zig

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

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

Visibility: public

Requested revision: 93cb44c80582dd02b63b02e7bb7e54d7ad8a4ebc

Requested commit: 93cb44c80582dd02b63b02e7bb7e54d7ad8a4ebc

Commit: 93cb44c80582dd02b63b02e7bb7e54d7ad8a4ebc

Tree: ae7e7763301389f86890d011c2818000125ed1ac

Author: mlugg

Committer: Matthew Lugg

## Message

```
translate-c: support GCC/Clang pointer subtraction extension

Pointer subtraction on `void *` or function pointers is UB by the C
spec, but is permitted by GCC and Clang as an extension. So, avoid
crashing translate-c in such cases, and follow the extension behavior --
there's nothing else that could really be intended.

```

## Parents

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

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