YosysHQ / imctk

Incremental Model Checking Toolkit
Other
5 stars 2 forks source link

Make generated abc bindings portable across different char signedness #4

Open jix opened 2 months ago

jix commented 2 months ago

Whether char is signed or unsigned depends on the target platform, and the generated bindings at abc-sys/src/generated/bindings.rs contain an instance of a char constant l_False set to -1 which means the bindings generated on a platform with a signed char fail to build on a platform with an unsigned char as rust doesn't allow implicit casts between signed and unsigned types.

The easiest fix would be to change the l_False definition in abc (abc-sys/abc/src/sat/bsat/satVec.h) to explicitly use a signed char since that seems appropriate given it the range of values it holds, but I still need to double check that this has no negative consequences. Alternatively l_False could be excluded in the bindgen generation, as we're not actually calling directly into that part of abc.