ocaml-attic / ocaml-cstruct

Map OCaml arrays onto C-like structs via a syntax extension, and generate functions to convert to-and-from native OCaml values.
http://www.openmirage.org/
10 stars 2 forks source link

fails on 32-bit #3

Closed avsm closed 11 years ago

avsm commented 11 years ago

@arjunguha reports by email that

cenum ofp_port_no {
  OFPP_ANY        = 0xffffffff
} as int32_t

fails with an error: Integer literal exceeds the range of representable integers of type int32

The fix is to stop treating the constr_fields parsing as an INT in syntax/pa_cstruct.ml, which is where the literal restriction comes from. This bug won't happen on 64-bit hosts.

avsm commented 11 years ago

This should be fixed in 0.7.2dev, @arjunguha