# zig.h: add casts for overflow arithmetic operations · gitcafe/zig

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

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

Visibility: public

Requested revision: f33b3fc3eae54b9d1159fc5a7a69a4b0e4aceca6

Requested commit: f33b3fc3eae54b9d1159fc5a7a69a4b0e4aceca6

Commit: f33b3fc3eae54b9d1159fc5a7a69a4b0e4aceca6

Tree: 30541782615edb604ecdbc1c5205b7e9caf54131

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

````
zig.h: add casts for overflow arithmetic operations

This avoids the following error:

```
error: incompatible pointer types passing 'int64_t *' (aka 'long long *') to parameter of type 'long *'
    overflow = __builtin_saddl_overflow(lhs, rhs, res);
                                                  ^~~
```

My previous understanding was that this error would not occur because
prior to this line we check that int64_t is equivalent to long, like
this:

```c
```

However, it appears that this is still a warning in C if int64_t is
primarily aliased to `long long`, even though `long` and `long long` are
the same thing.

````

## Parents

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

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