Commit 297d4391 authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

Merge branch 'fix/andre/sizeof-incomplete-type-msg' into 'master'

[Kernel] improve error message for sizeof on incomplete types

See merge request frama-c/frama-c!2806
parents 7da3ef67 aa5ecf65
......@@ -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)")))
end
in
......
[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