Properly define blocks as part of the grammar - INRIA - Institut National de Recherche en Informatique et en Automatique Accéder directement au contenu
Rapport Année : 2022

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.
Fichier principal
Vignette du fichier
n2937.pdf (197.22 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)

Dates et versions

hal-03363674 , version 1 (04-10-2021)
hal-03363674 , version 2 (06-10-2022)

Licence

Paternité

Identifiants

  • HAL Id : hal-03363674 , version 2

Citer

Jens Gustedt, Martin Uecker. Properly define blocks as part of the grammar: proposal for C23. [Research Report] N2937, ISO JCT1/SC22/WG14. 2022, pp.3. ⟨hal-03363674v2⟩
97 Consultations
34 Téléchargements

Partager

Gmail Facebook X LinkedIn More