Skip to content
Snippets Groups Projects
Commit 632f1a5f authored by Andre Maroneze's avatar Andre Maroneze
Browse files

[kernel] fix printing of empty initializers for empty unions

parent 0f6b030b
No related branches found
No related tags found
No related merge requests found
...@@ -911,7 +911,7 @@ class cil_printer () = object (self) ...@@ -911,7 +911,7 @@ class cil_printer () = object (self)
| _ -> Kernel.fatal "Trying to print malformed initializer" | _ -> Kernel.fatal "Trying to print malformed initializer"
in in
if not (Cil.isArrayType t) then if not (Cil.isArrayType t) then
Pretty_utils.pp_list ~pre:"{@[<hv>" ~sep:",@ " ~suf:"@]}" Pretty_utils.pp_list ~pre:"{@[<hv>" ~sep:",@ " ~suf:"@]}" ~empty:"{}"
designated_init fmt initl designated_init fmt initl
else begin else begin
let print_index prev_index (designator,init as di) = let print_index prev_index (designator,init as di) =
......
/* run.config* /* run.config*
STDOPT: +"-machdep gcc_x86_32" STDOPT: +"-machdep gcc_x86_32 -print -ocode @PTEST_NAME@_reparse.c -then @PTEST_NAME@_reparse.c -ocode=''"
EXIT: 1 EXIT: 1
STDOPT: STDOPT:
*/ */
......
[kernel] Parsing empty_union.i (no preprocessing) [kernel] Parsing empty_union.i (no preprocessing)
[kernel] Parsing empty_union_reparse.c (with preprocessing)
/* Generated by Frama-C */ /* Generated by Frama-C */
union empty { union empty {
}; };
union empty eu = ; union empty eu = {};
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