Into the depths of C: elaborating the de facto standards

Kayvan Memarian, Justus Matthiesen, J. Lingard, Kyndylan Nienhuis, D. Chisnall, R. Watson, Peter Sewell
{"title":"Into the depths of C: elaborating the de facto standards","authors":"Kayvan Memarian, Justus Matthiesen, J. Lingard, Kyndylan Nienhuis, D. Chisnall, R. Watson, Peter Sewell","doi":"10.1145/2908080.2908081","DOIUrl":null,"url":null,"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.","PeriodicalId":178839,"journal":{"name":"Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation","volume":"19 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2016-04-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"92","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2908080.2908081","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 92

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.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
进入C的深处:详细说明事实上的标准
C仍然是我们计算基础设施的核心。理论上,它是由ISO标准定义的,但实际上,系统代码所假定的C的属性和编译器所实现的属性已经与ISO标准和彼此之间产生了分歧,而且这些都没有被清楚地理解。我们做出了两项贡献来帮助改进这种容易出错的情况。首先,我们深入分析了C语言中指针和内存语义的设计空间,因为它在实践中被使用。我们阐明了许多具体的问题,构建了一套语义测试用例,从多个实现中收集实验数据,并调查了C专家对事实标准的看法。我们识别有共识的问题(遵循ISO或不同)和有冲突的问题。我们将所有这些应用于上述性能硬件实现的实验性C。其次,我们描述了一个正式的模型,Cerberus,对于大部分C. Cerberus是参数化的内存模型;它既可以与正在构建的候选事实内存对象模型链接,也可以与可操作的C11并发模型链接;为了便于访问,它被细化为一种更简单的Core语言,并且它可以作为测试oracle在小示例上执行。这应该为讨论现在的主流C语言是什么提供了坚实的基础:程序员和分析工具可以假设什么,编译器的目标是实现什么。最终,我们希望这将是朝着C语言各种用例清晰、一致和可接受的语义迈出的一步。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Assessing the limits of program-specific garbage collection performance Data-driven precondition inference with learned features SDNRacer: concurrency analysis for software-defined networks Exposing errors related to weak memory in GPU applications Effective padding of multidimensional arrays to avoid cache conflict misses
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1