0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00

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.
This commit is contained in:
mlugg 2024-08-26 21:50:14 +01:00 • committed by Matthew Lugg
commit 93cb44c805
2 changed files with 33 additions and 11 deletions