Skip to content
Snippets Groups Projects
  • Virgile Prevosto's avatar
    47914d50
    [printer] ensures labels are not put on declarations · 47914d50
    Virgile Prevosto authored
    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` :sob:
    47914d50
    History
    [printer] ensures labels are not put on declarations
    Virgile Prevosto authored
    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` :sob: