let rec format_of_object = function
    | C_int _ -> int_format
    | C_float _ -> real_format
    | C_pointer _ -> pointer_format
    | C_comp c ->
        if c.cstruct
        then record_format
        else urecord_format
    | C_array arr ->
        array_format
          (format_of_object (Ctypes.object_of arr.arr_element))