Skip to content
Snippets Groups Projects
Commit f64db051 authored by Julien Signoles's avatar Julien Signoles
Browse files

[e-acsl:archi] better error message

parent e76a0b77
No related branches found
No related tags found
No related merge requests found
......@@ -181,7 +181,7 @@ module Libc = struct
| FLongDouble -> "E" (* [long double] *)
in
(* 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(IUChar,_) -> "S" (* [unsigned char*] *)
| TInt(IShort,_) -> "q" (* [short*] *)
......@@ -194,8 +194,9 @@ module Libc = struct
| TInt(IULongLong,_) -> "W" (* [unsigned long int*] *)
| 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_exp a
in
let exps = drop (printf_fmt_position fn) args in
let param_str =
......@@ -203,7 +204,7 @@ module Libc = struct
(fun exp acc -> match Cil.unrollType (Cil.typeOf exp) with
| TInt(k, _) -> get_ikind_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 _
| TBuiltin_va_list _ -> assert false)
exps
......@@ -244,3 +245,9 @@ let instrument kf =
Options.Instrument.mem gen_kf
with Not_found ->
false))
(*
Local Variables:
compile-command: "make -C ../../../../.."
End:
*)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment