Modular C - Inria - Institut national de recherche en sciences et technologies du numérique Accéder directement au contenu
Rapport (Rapport De Recherche) Année : 2015

Modular C

Résumé

We propose an extension to the C standard called Modular C. It consists in the addition of a handful of directives and a naming scheme transforming traditional transla- tion units into modules. The change to the C language is minimal since we only add one feature, composed identifiers, to the core language. Our modules can import other modules as long as the import relation remains acyclic and a module can refer to its own identifiers and those of the imported modules through freely chosen abbreviations. Other than tradi- tional C include, our import directive ensures complete encapsulation between modules. The abbreviation scheme allows to seamlessly replace an imported module by another one with equivalent interface. In addition to the export of symbols, we provide parameterized code in- jection through the import of “snippets”. This implements a mechanism that allows for code reuse, similar to X macros or templates. Additional features of our proposal are a simple dy- namic module initialization scheme, a structured approach to the C library and a migration path for existing software projects.

Mots clés

Fichier principal
Vignette du fichier
RR-8751.pdf (735.43 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)

Dates et versions

hal-01169491 , version 1 (29-06-2015)
hal-01169491 , version 2 (12-07-2015)
hal-01169491 , version 3 (24-01-2018)
hal-01169491 , version 4 (12-06-2018)

Identifiants

  • HAL Id : hal-01169491 , version 1

Citer

Jens Gustedt. Modular C. [Research Report] RR-8751, INRIA. 2015. ⟨hal-01169491v1⟩
555 Consultations
1977 Téléchargements

Partager

Gmail Facebook X LinkedIn More