Skip to content

Commit 7606d26

Browse files
committed
Fix Cprint print_generic_list only printing first association
1 parent 544dbfc commit 7606d26

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/frontc/cprint.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,16 +540,16 @@ and print_expression_level (lvl: int) (exp : expression) =
540540
printl ["__alignof__";"("];
541541
print_onlytype (bt, dt);
542542
print ")"
543-
| GENERIC (exp, lst) ->
544-
(* TODO: is this right? *)
545-
let print_generic_list l =
543+
| GENERIC (exp, lst) ->
544+
let rec print_generic_list l =
546545
match l with
547546
[] -> ()
548547
| (t, e) :: tl ->
549548
print ", ";
550549
print_onlytype t;
551550
print ": ";
552551
print_expression_level 0 e;
552+
print_generic_list tl
553553
in
554554
printl ["_Generic";"("];
555555
print_expression_level 0 exp;

0 commit comments

Comments
 (0)