I have this function that prints a value in an offset map:
let pretty_offsetmap_original lv fmt offsetmap = begin match offsetmap with | None -> Format.fprintf fmt "<BOTTOM>" | Some off -> let typ = Some (typeOfLval lv) in Format.fprintf fmt "%a%a" pretty_lval_or_absolute lv (Cvalue.V_Offsetmap.pretty_typ typ) off end
Now I would like to get the value in a string variable in order to convert it for my purpose. I replaced Format.fprintf fmt with Printf.sprintf , but it does not work. Compilation Error:
Error: This expression has type Format.formatter -> Cvalue.V_Offsetmap.t -> unit but an expression was expected of type unit -> 'a -> string
source share