TUHH Open Research
Help
  • Log In
    New user? Click here to register.Have you forgotten your password?
  • English
  • Deutsch
  • Communities & Collections
  • Publications
  • Research Data
  • People
  • Institutions
  • Projects
  • Statistics
  1. Home
  2. TUHH
  3. Publication References
  4. CppSig : extracting type information for C-preprocessor macro expansions
 
Options

CppSig : extracting type information for C-preprocessor macro expansions

Publikationstyp
Conference Paper
Date Issued
2021-10-25
Sprache
English
Author(s)
Dietrich, Christian  orcid-logo
Institut
Operating Systems E-EXK4  
TORE-URI
http://hdl.handle.net/11420/10505
Start Page
62
End Page
68
Citation
Workshop on Programming Languages and Operating Systems (PLOS 2021)
Contribution to Conference
11th Workshop on Programming Languages and Operating Systems, PLOS 2021  
Publisher DOI
10.1145/3477113.3487268
Scopus ID
2-s2.0-85119093371
Publisher
Association for Computing Machinery
Peer Reviewed
true
For decades, the C programming language proved to be a cornerstone of system-software ecosystems, leaving us with billion lines of existing source code. From today’s perspective of object-oriented and functional languages, C itself seems rather limited in its expressiveness and abstractive power. However, with the C preprocessor (CPP) as its companion, macros, which operate on the raw token stream, allow for abstractions that are impossible to achieve within the language itself. While its flexibility and its ease of use make CPP attractive for programmers, its potential undisciplined usage makes it problematic for static source-code analysis and can slow down the on-boarding of new developers.

In this paper, we focus on a disciplined subclass of CPP macros: the statement-like and expression-like macros, which mimic regular C functions, with well-type C expressions as arguments and, incase, a return value. We show how to spot such macros and their arguments in the compiler’s abstract syntax tree, whereby it becomes possible to deduct type signatures for individual macro expansions. With our CppSig prototype, implemented as a Clang plugin, we extract macro-type information from Linux 5.12, whereby it becomes easier to understand even deep macro-expansion
nests. In the future, these expansion signatures could be used to statically enforce gradually-typed CPP macro definitions.
DDC Class
004: Informatik
TUHH
Weiterführende Links
  • Contact
  • Send Feedback
  • Cookie settings
  • Privacy policy
  • Impress
DSpace Software

Built with DSpace-CRIS software - Extension maintained and optimized by 4Science
Design by effective webwork GmbH

  • Deutsche NationalbibliothekDeutsche Nationalbibliothek
  • ORCiD Member OrganizationORCiD Member Organization
  • DataCiteDataCite
  • Re3DataRe3Data
  • OpenDOAROpenDOAR
  • OpenAireOpenAire
  • BASE Bielefeld Academic Search EngineBASE Bielefeld Academic Search Engine
Feedback