yallop / ocaml-ctypes

Library for binding to C libraries using pure OCaml
MIT License
369 stars 95 forks source link

Warning 9 in ocaml code eventually produced by Cstubs_structs.write_c #636

Closed Armael closed 4 years ago

Armael commented 4 years ago

It seems that the ocaml code produced by the C code itself produced by Cstubs_structs.write_c can trigger warning 9.

For instance:

File "ffi/generated_types.ml", line 7, characters 12-34:
Error (warning 9): the following labels are not bound in this record pattern:
spec, fields
Either bind these labels explicitly or add '; _' to the pattern.

where the corresponding code in ffi/generated_types.ml is:

[...]

let rec field : type t a. t typ -> string -> a typ -> (a, t) field =
  fun s fname ftype -> match s, fname with
  | Struct ({ tag = "wlr_backend"} as s'), "events.new_output" ->
    let f = {ftype; fname; foffset = 40} in 
    (s'.fields <- BoxedField f :: s'.fields; f)
 [...]
Armael commented 4 years ago

Thanks!