mirror of https://github.com/YosysHQ/abc.git
Make `lbool` explicitly signed
This avoids issues due to some platforms making `char` signed and others
unsigned. For example, currently the result of promoting `(lbool)-1` to `int`
can differ on different platforms. See
50ffa10848/lib/bill/bill/sat/interface/abc_bsat2.hpp (L156)
for an example of that.
This commit is contained in:
parent
2d70debd07
commit
6c6260465e
|
|
@ -130,7 +130,9 @@ static inline void vecp_remove(vecp* v, void* e)
|
|||
typedef int lit;
|
||||
typedef int cla;
|
||||
|
||||
typedef char lbool;
|
||||
// Explicitly make it signed so promotion-to-int behavior doesn't vary
|
||||
// across platforms that define signedness of char differently.
|
||||
typedef signed char lbool;
|
||||
|
||||
static const int var_Undef = -1;
|
||||
static const lit lit_Undef = -2;
|
||||
|
|
|
|||
Loading…
Reference in New Issue