Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make lbool explicitly signed #650

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Conversation

rocallahan
Copy link
Contributor

@rocallahan rocallahan commented Jun 28, 2024

This avoids issues due to some platforms making char signed and others unsigned. In particular, on platforms where char is unsigned,

promotes an lbool to int and compares to -1 ... but promoting (unsigned char)-1 to int produces 255.

This avoids issues due to some platforms making `char` signed and others
unsigned. In particular, on platforms where `char` is unsigned,
https://github.com/lsils/mockturtle/blob/50ffa108484ba65b44eee4a713832b7ee821d6d8/lib/bill/bill/sat/interface/abc_bsat2.hpp#L156
promotes an `lbool` to `int` and compares to -1 ... but promoting
`(unsigned char)-1` to `int` produces 255.`
@costamag costamag self-assigned this Jul 11, 2024
@costamag
Copy link
Contributor

Verified correct behavior on experiments Thanks for catching the issue

@costamag costamag merged commit 91e15a9 into lsils:master Jul 11, 2024
16 checks passed
@rocallahan rocallahan deleted the signed-lbool branch July 14, 2024 21:28
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