Properly define blocks as part of the grammar
Résumé
Blocks are a fundamental concept in C for the definition of visibility scopes of identifiers and for the lifetime of objects. Currently, there is no closed definition what a block is and the different definitions that compose the term have to be collected in different places that spread over several clauses. In particular, the fact that dependent statements of iteration or selection statements form blocks of their own is easily overlooked and leads to misunderstandings for example concerning the lifetime of compound literals. We propose to change that situation by introducing terms primary block and secondary block in the syntax and by referring to the other definitions of blocks, namely functions definitions and lambda expressions (if added to C23), in a summary definition.
Domaines
Langage de programmation [cs.PL]Origine | Fichiers produits par l'(les) auteur(s) |
---|