# Translate-C convert bools to int in complex expressions · gitcafe/zig

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

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

Visibility: public

Requested revision: e6fa0beb335ad8ecff005fef924c2a39ed748c56

Requested commit: e6fa0beb335ad8ecff005fef924c2a39ed748c56

Commit: e6fa0beb335ad8ecff005fef924c2a39ed748c56

Tree: 51d8dbed193e84d0c0e5843be5acf35ce141b359

Author: Ian Simonson

Committer: Ian Simonson

## Message

```
Translate-C convert bools to int in complex expressions

Pre-requisite for having a test case for #5062
In complex C statements which are outside of macros,
it is valid C to perform e.g. a bitor between an
integer and a boolean `5 | (8 == 9)`

Currently this results in a zig error after translating
as `c_int | bool` is invalid Zig.

Detects if a sub-expression of a numeric operator is
boolean and if so converts it to int

```

## Parents

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

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