--- a/ocamlutil/pretty.ml +++ a/ocamlutil/pretty.ml @@ -640,7 +640,7 @@ external format_float: string -> float -> string = "caml_format_float" let gprintf (finish : doc -> 'b) (format : ('a, unit, doc, 'b) format4) : 'a = - let format = (Obj.magic format : string) in + let format = string_of_format format in (* Record the starting align depth *) let startAlignDepth = !alignDepth in