Affiliation:
1. Software Production Research Dept., Bell Laboratories, Lucent Technologies
2. Computer Sciences Dept., University of Wisconsin-Madison
Abstract
The effectiveness of traditional type checking in C is limited by the presence of type conversions using type casts. Because the C standard allows arbitrary type conversions between pointer types, neither C compilers, nor tools such as
lint,
can guarantee type safety in the presence of such type conversions. In particular, by using casts involving pointers to structures (C structs), a programmer can interpret any memory region to be of any desired type, further compromising C's weak type system. Not only do type casts make a program vulnerable to type errors, they hinder program comprehension and maintenance by creating latent dependencies between seemingly independent pieces of code.To address these problems, we have developed a stronger form of type checking for C programs, called
physical type checking.
Physical type checking takes into account the layout of C struct fields in memory. This paper describes an inference-based physical type checking algorithm. Our algorithm can be used to perform static safety checks, as well as compute useful information for software engineering applications.
Publisher
Association for Computing Machinery (ACM)
Cited by
16 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Advanced Memory and Shape Analyses;Computer Science Foundations and Applied Logic;2024
2. Points-to Analysis for Context-Oriented JavaScript Programs;Proceedings of the 25th ACM International Workshop on Formal Techniques for Java-like Programs;2023-07-18
3. Improving source-code representations to enhance search-based software repair;Proceedings of the Genetic and Evolutionary Computation Conference;2022-07-08
4. Lightweight Shape Analysis Based on Physical Types;Lecture Notes in Computer Science;2022
5. Type Inference for C;ACM Transactions on Programming Languages and Systems;2020-12