c4-project / c4f

The C4 Concurrent C Fuzzer
MIT License
14 stars 1 forks source link

Use int32 for constant integers #228

Open MattWindsor91 opened 3 years ago

MattWindsor91 commented 3 years ago

We assume (implicitly!) that the environment for which we are generating C programs has 32-bit integers (eg 32-bit systems and LLP64/LP64 64-bit systems). This means that, for safety, every constant we generate is always 32-bit. However, we currently store constants as int, not int32; this is fine on 64-bit systems, but on 32-bit ones OCaml integers are 31-bit, and we lose the top end of the range.

Ideally, we should store integers as int32, and revisit this if and when we support other sizes of integer.