Skip to content

transpile: Do not consider Bool an integral type - #2005

Merged
ahomescu merged 2 commits into
immunant:masterfrom
Rua:bool-not-integral
Sep 24, 2026
Merged

ahomescu merged 2 commits into
immunant:masterfrom
Rua:bool-not-integral

Conversation

@Rua

@Rua Rua commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

CTypeKind::is_unsigned_integral_type returns true for Bool, which is a bit of a footgun and probably not what most code (or coders) expect. So this removes it. I made sure to check that no code elsewhere relies on this including Bool and adjusted it where necessary. Most of the time, it was being used for wrapping arithmetic, which isn't possible on booleans anyway.

Comment thread c2rust-transpile/src/c_ast/mod.rs Resolved
Comment thread c2rust-transpile/src/c_ast/mod.rs Resolved
@Rua
Rua force-pushed the bool-not-integral branch 2 times, most recently from c7bae39 to 283df6d Compare September 10, 2026 09:05
@Rua
Rua force-pushed the bool-not-integral branch from 283df6d to fcd96e4 Compare September 22, 2026 09:33
@Rua
Rua force-pushed the bool-not-integral branch from fcd96e4 to 75ceb4e Compare September 22, 2026 09:39
@ahomescu
ahomescu merged commit 44454b8 into immunant:master Sep 24, 2026
11 checks passed
@Rua
Rua deleted the bool-not-integral branch September 24, 2026 08:41
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