Into the Depths of C: Elaborating the de Facto Standards

Kayvan Memarian, Justus Matthiesen, James Lingard, Kyndylan Nienhuis, David Chisnall, Robert N. M. Watson, Peter Sewell

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

C remains central to our computing infrastructure. It is notionally defined by ISO standards, but in reality the properties of C assumed by systems code and those implemented by compilers have diverged, both from the ISO standards and from each other, and none of these are clearly understood. We make two contributions to help improve this error-prone situation. First, we describe an in-depth analysis of the design space for the semantics of pointers and memory in C as it is used in practice. We articulate many specific questions, build a suite of semantic test cases, gather experimental data from multiple implementations, and survey what C experts believe about the de facto standards. We identify questions where there is a consensus (either following ISO or differing) and where there are conflicts. We apply all this to an experimental C implemented above capability hardware. Second, we describe a formal model, Cerberus, for large parts of C. Cerberus is parameterised on its memory model; it is linkable either with a candidate de facto memory object model, under construction, or with an operational C11 concurrency model; it is defined by elaboration to a much simpler Core language for accessibility, and it is executable as a test oracle on small examples. This should provide a solid basis for discussion of what mainstream C is now: what programmers and analysis tools can assume and what compilers aim to implement. Ultimately we hope it will be a step towards clear, consistent, and accepted semantics for the various use-cases of C.
Original languageEnglish
Title of host publicationProceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation
EditorsChandra Krintz, Emery Berger
Place of PublicationNew York, NY, USA
PublisherACM Association for Computing Machinery
Pages1–15
Number of pages15
ISBN (Print)9781450342612
DOIs
Publication statusPublished - 2 Jun 2016
Event37th ACM SIGPLAN conference on Programming Language Design and Implementation - Santa Barbara, United States
Duration: 13 Jun 201617 Jun 2016
Conference number: 37
https://pldi16.sigplan.org/

Publication series

NamePLDI '16
PublisherAssociation for Computing Machinery

Conference

Conference37th ACM SIGPLAN conference on Programming Language Design and Implementation
Abbreviated titlePLDI 2016
Country/TerritoryUnited States
CitySanta Barbara
Period13/06/1617/06/16
Internet address

Keywords / Materials (for Non-textual outputs)

  • C

Fingerprint

Dive into the research topics of 'Into the Depths of C: Elaborating the de Facto Standards'. Together they form a unique fingerprint.

Cite this