Properly define blocks as part of the grammar - Inria - Institut national de recherche en sciences et technologies du numérique Access content directly
Reports Year : 2022

Properly define blocks as part of the grammar

Abstract

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
Origin : Files produced by the author(s)

Dates and versions

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

Licence

Attribution

Identifiers

  • HAL Id : hal-03363674 , version 2

Cite

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⟩
80 View
28 Download

Share

Gmail Facebook Twitter LinkedIn More