tryocaml cannot build on a 32 bits OCaml #113

Closed
gasche opened this Issue Feb 16, 2013 · 1 comment

Projects

None yet

2 participants

@gasche
gasche commented Feb 16, 2013

The offending code is in ocaml-num/nat.ml:

let num_leading_zero_bits_in_digit nat int =
  let d = ref nat.(int) in
  let n = ref length_of_digit in
  if !d land 0xFFFF0000 <> 0 then (n := !n - 16; d := !d lsr 16);
  if !d land 0xFF00 <> 0 then (n := !n - 8; d := !d lsr 8);
  if !d land 0xF0 <> 0 then (n := !n - 4; d := !d lsr 4);
  if !d land 0xC <> 0 then (n := !n - 2; d := !d lsr 2);
  if !d land 0x2 <> 0 then (n := !n - 1; d := !d lsr 1);
  !n - !d

The first literal, 0xFFFF0000, provokes a compile-time failure on 32bits OCaml version.

@lefessan
Member
let oxFFFF0000 = 0xFFFF lsl 16
let num_leading_zero_bits_in_digit nat int =
... if !d land oxFFFF0000 <> 0 then ...

Should fix it... My master requires latest ocp-build, so I would prefer a pull-request than fixing it and merging it now.

@lefessan lefessan closed this in d993be1 Feb 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment