let offset_of_field f =
    let rec acc sz l f =
      match l with
        | [] -> assert false
        | fi::m ->
            if Cil_datatype.Fieldinfo.equal f fi
            then sz
            else  acc (add sz  (sizeof (object_of fi.ftype))) m f
    in
    acc zero f.fcomp.cfields f