Commit f64db051 authored by Julien Signoles's avatar Julien Signoles
Browse files

[e-acsl:archi] better error message

parent e76a0b77
...@@ -181,7 +181,7 @@ module Libc = struct ...@@ -181,7 +181,7 @@ module Libc = struct
| FLongDouble -> "E" (* [long double] *) | FLongDouble -> "E" (* [long double] *)
in in
(* get a character representing a pointer type *) (* get a character representing a pointer type *)
let get_pkind_str ty = match ty with let get_pkind_str a ty = match ty with
| TInt(IChar,_) | TInt(ISChar,_) -> "s" (* [char*] *) | TInt(IChar,_) | TInt(ISChar,_) -> "s" (* [char*] *)
| TInt(IUChar,_) -> "S" (* [unsigned char*] *) | TInt(IUChar,_) -> "S" (* [unsigned char*] *)
| TInt(IShort,_) -> "q" (* [short*] *) | TInt(IShort,_) -> "q" (* [short*] *)
...@@ -194,8 +194,9 @@ module Libc = struct ...@@ -194,8 +194,9 @@ module Libc = struct
| TInt(IULongLong,_) -> "W" (* [unsigned long int*] *) | TInt(IULongLong,_) -> "W" (* [unsigned long int*] *)
| TVoid _ -> "p" (* [void*] *) | TVoid _ -> "p" (* [void*] *)
| _ -> | _ ->
Options.fatal "Unexpected argument type in printf: %a @." Options.fatal "unexpected argument type in printf: type %a of arg %a@."
Printer.pp_typ ty Printer.pp_typ ty
Printer.pp_exp a
in in
let exps = drop (printf_fmt_position fn) args in let exps = drop (printf_fmt_position fn) args in
let param_str = let param_str =
...@@ -203,7 +204,7 @@ module Libc = struct ...@@ -203,7 +204,7 @@ module Libc = struct
(fun exp acc -> match Cil.unrollType (Cil.typeOf exp) with (fun exp acc -> match Cil.unrollType (Cil.typeOf exp) with
| TInt(k, _) -> get_ikind_str k ^ acc | TInt(k, _) -> get_ikind_str k ^ acc
| TFloat(k, _) -> get_fkind_str k ^ acc | TFloat(k, _) -> get_fkind_str k ^ acc
| TPtr(ty, _) -> get_pkind_str (Cil.unrollType ty) ^ acc | TPtr(ty, _) -> get_pkind_str exp (Cil.unrollType ty) ^ acc
| TVoid _ | TArray _ | TFun _ | TNamed _ | TComp _ | TEnum _ | TVoid _ | TArray _ | TFun _ | TNamed _ | TComp _ | TEnum _
| TBuiltin_va_list _ -> assert false) | TBuiltin_va_list _ -> assert false)
exps exps
...@@ -244,3 +245,9 @@ let instrument kf = ...@@ -244,3 +245,9 @@ let instrument kf =
Options.Instrument.mem gen_kf Options.Instrument.mem gen_kf
with Not_found -> with Not_found ->
false)) false))
(*
Local Variables:
compile-command: "make -C ../../../../.."
End:
*)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment