diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-12-31 17:33:55 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-12-31 17:33:55 -0500 |
| commit | 5749f706ef866b3c77d6fb8fda9ed08e5c118f58 (patch) | |
| tree | 0f69b721e1728851a685b2596d98c63b88654488 /src/zig_clang.cpp | |
| parent | 39ee3bc0ecdfde43e6fa98ee454a0115b3cb7390 (diff) | |
| download | zig-5749f706ef866b3c77d6fb8fda9ed08e5c118f58.tar.gz zig-5749f706ef866b3c77d6fb8fda9ed08e5c118f58.zip | |
translate-c: non-wrapping operator for pointer arithmetic
According to C11 6.5.6.8, pointer arithmetic may not overflow. In fact,
it may not even go more than 1 past the end of an object, or UB occurs.
This is the same as Zig pointer arithmetic semantics, and so the
`+` and `+=` operators rather than `+%` and `+%=` are appropriate for
C-translated pointer arithmetic.
Diffstat (limited to 'src/zig_clang.cpp')
0 files changed, 0 insertions, 0 deletions
