[printer] ensures labels are not put on declarations
Fixes #617 Technically, the C standard distinguishes between declarations and statements, and only the latter may have labels attached to them. Thus, printing a label directly over a `Local_init` will result in ill-formed C code. In order to avoid that, we add a dummy nop (aka `;`) in-between. A first version was done in !1518, but failed to take into account `UnspecifiedSequence` whose first element happens to be a `Local_init`
Showing
- src/kernel_services/ast_printing/cil_printer.ml 9 additions, 3 deletionssrc/kernel_services/ast_printing/cil_printer.ml
- tests/syntax/label_decl.i 9 additions, 0 deletionstests/syntax/label_decl.i
- tests/syntax/oracle/label_decl.res.oracle 33 additions, 0 deletionstests/syntax/oracle/label_decl.res.oracle
Loading
Please register or sign in to comment