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, notint32; 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.
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
, notint32
; 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.