ACM Home Page
Please provide us with feedback. Feedback
Physical type checking for C
Full text PdfPdf (1.08 MB)
Source Workshop on Program Analysis for Software Tools and Engineering archive
Proceedings of the 1999 ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering table of contents
Toulouse, France
Pages: 66 - 75  
Year of Publication: 1999
ISBN:1-58113-137-2
Also published in ...
Authors
Satish Chandra  Software Production Research Dept., Bell Laboratories, Lucent Technologies
Thomas Reps  Computer Sciences Dept., University of Wisconsin-Madison
Sponsors
SIGSOFT: ACM Special Interest Group on Software Engineering
SIGPLAN: ACM Special Interest Group on Programming Languages
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 5,   Downloads (12 Months): 44,   Citation Count: 18
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/316158.316183
What is a DOI?

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.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
} L. 0. Andersen. Program Analysis and Specialization for the C Pmgmmming Language. PhD thesis, DIKU, University of Copenhagen, May 1994. (DIKU report 94/19).
 
2
 
3
Satish Chandra and Thomas Reps. Physical type checking for C. Technical Report BL0113590-990302-04, Lucent Technologies, Bell Laboiatories, March 1999. Available at http://vuv.bell-labs.com/'schandra/pubs/checking-tr.ps.
4
 
5
 
6
 
7
F.-J. Grosch and G. Snelting. Polymorphic components for monomorphic languages. In R. Prieto-Diaz and W.B. Frakes, editors, Advances in Software Reuse: Selected Papers from the Second International Workshop on Software Reusability, pages 47-55, Lucca, Italy, March 1993. IEEE Computer Society Press.
 
8
J. Hughes. Backwards analysis of functional programs. Partial Evaluation and Mixed Computation: Proc. of the IFIP TC2 Workshop on Partial Evaluation and Mixed Computation, (Gammel Avemaes, Denmark, Oct. 18-24, lg87), pages 187-208, 1988.
 
9
S. C. Johnson. Lint, a C program checker, July 1978.
 
10
 
11
Robert O'Callahan and Daniel Jackson. Detecting shared representations using type inference. Technical Report CMU-CS-95-202, Carnegie Mellon University, September 1995.
12
 
13
14
 
15
M. Siff, S. Chandra, T. Ball, K. Kunchithapadam, and T. Reps. Coping with type casts in C. - Tech: nical Renort BL0113590-990202-03. Lucent Technologies, Beli Laboratories, February i999. Available at http://ww.bell-labs.com/-schandra/pubs/coping-tr.ps.
16
17
18
19
 
20
 
21
 
22

CITED BY  18

Collaborative Colleagues:
Satish Chandra: colleagues
Thomas Reps: colleagues