Commit aa5ecf65 authored by Andre Maroneze's avatar Andre Maroneze 💬
Browse files

[Kernel] improve error message for sizeof on incomplete types

parent 43e1bd74
......@@ -5995,7 +5995,8 @@ and doExp local_env
let res =
if Cil.isCompleteType typ then new_exp ~loc (SizeOf typ)
else begin
Kernel.error ~once:true ~current:true "sizeof on incomplete type";
Kernel.error ~once:true ~current:true
"sizeof on incomplete type '%a'" Cil_printer.pp_typ typ;
new_exp ~loc (Const (CStr ("booo sizeof(incomplete)")))
[kernel] Parsing tests/syntax/sizeof_incomplete_type.c (with preprocessing)
[kernel] tests/syntax/sizeof_incomplete_type.c:21: User Error:
sizeof on incomplete type
sizeof on incomplete type 'struct inexistent'
[kernel] User Error: stopping on file "tests/syntax/sizeof_incomplete_type.c" that has errors. Add
'-kernel-msg-key pp' for preprocessing command.
[kernel] Frama-C aborted: invalid user input.
Supports Markdown
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