Skip to content
Snippets Groups Projects
  • Marvin Häuser's avatar
    3d78ceb0
    simulator: emit channels array only when not empty · 3d78ceb0
    Marvin Häuser authored
    Arrays of length 0 yield implementation-defined behaviour, which causes
    a compiler warning. In C, this was typically used to model
    flexibly-sized array members trailing a struct. Here, length 0 actually
    means it occupies no storage.
    
    Hence, do not emit the _channels array when it would otherwise have a
    length of 0.
    3d78ceb0
    History
    simulator: emit channels array only when not empty
    Marvin Häuser authored
    Arrays of length 0 yield implementation-defined behaviour, which causes
    a compiler warning. In C, this was typically used to model
    flexibly-sized array members trailing a struct. Here, length 0 actually
    means it occupies no storage.
    
    Hence, do not emit the _channels array when it would otherwise have a
    length of 0.