Skip to content

Conversation

@agx
Copy link
Contributor

@agx agx commented Sep 6, 2025

GCC throws an error when a bool type is defined:

./c-shared-util.h:17:15: error: 'bool' cannot be defined via 'typedef'
   17 |   typedef int bool;
      |               ^~~~
./c-shared-util.h:17:15: note: 'bool' is a keyword with '-std=c23' onwards

Since bool and int don't need to be the same types at the ABI boundary we must replace bool by int there. We can still use true and false internally due to implicit type conversion.

Something like this will be needed to prevent varnam from dropping out of Debian.

GCC throws an error when a bool type is defined:

```
./c-shared-util.h:17:15: error: 'bool' cannot be defined via 'typedef'
   17 |   typedef int bool;
      |               ^~~~
./c-shared-util.h:17:15: note: 'bool' is a keyword with '-std=c23' onwards
```

Since bool and int don't need to be the same types at the ABI boundary
we must replace `bool` by `int` there. We can still use `true` and
`false` internally due to implicit type conversion.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
@subins2000
Copy link
Member

Thank you for the patch!

@subins2000 subins2000 merged commit 598b332 into varnamproject:master Sep 7, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants