2 |
7u83 |
1 |
<!-- Crown Copyright (c) 1998 -->
|
|
|
2 |
<HTML>
|
|
|
3 |
<HEAD>
|
|
|
4 |
<TITLE>C Checker Reference Manual: Introduction</TITLE>
|
|
|
5 |
</HEAD>
|
|
|
6 |
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#400080" ALINK="#FF0000">
|
|
|
7 |
<A NAME=S3>
|
|
|
8 |
<H1>C Checker Reference Manual</H1>
|
|
|
9 |
<H3>January 1998</H3>
|
|
|
10 |
<A HREF="tdfc5.html"><IMG SRC="../images/next.gif" ALT="next section"></A>
|
|
|
11 |
<A HREF="tdfc1.html"><IMG SRC="../images/prev.gif" ALT="previous section"></A>
|
|
|
12 |
<A HREF="tdfc1.html"><IMG SRC="../images/top.gif" ALT="current document"></A>
|
|
|
13 |
<A HREF="../index.html"><IMG SRC="../images/home.gif" ALT="TenDRA home page">
|
|
|
14 |
</A>
|
|
|
15 |
<IMG SRC="../images/no_index.gif" ALT="document index"><P>
|
|
|
16 |
<HR>
|
|
|
17 |
<DL>
|
|
|
18 |
<DT><A HREF="#S4"><B>1.1 </B> - Background</A><DD>
|
|
|
19 |
<DT><A HREF="#S5"><B>1.2 </B> - The C static checker</A><DD>
|
|
|
20 |
<DT><A HREF="#S6"><B>1.3 </B> - About this document</A><DD>
|
|
|
21 |
</DL>
|
|
|
22 |
|
|
|
23 |
<HR>
|
|
|
24 |
<H1>1 Introduction</H1>
|
|
|
25 |
<A NAME=S4>
|
|
|
26 |
<HR><H2>1.1 Background</H2>
|
|
|
27 |
The C program static checker was originally developed as a programming
|
|
|
28 |
tool to aid the construction of portable programs using the Application
|
|
|
29 |
Programming Interface (API) model of software portability; the principle
|
|
|
30 |
underlying this approach being:
|
|
|
31 |
<BLOCKQUOTE>
|
|
|
32 |
<EM>If a program is written to conform to an abstract API specification,
|
|
|
33 |
then that program will be portable to any machine which implements
|
|
|
34 |
the API specification correctly.</EM>
|
|
|
35 |
</BLOCKQUOTE>
|
|
|
36 |
The tool was designed to address the problem of the lack of separation
|
|
|
37 |
between an API specification and an API implementation and as such
|
|
|
38 |
was considered as a compiler for an abstract machine.<P>
|
|
|
39 |
This approach gave the tool an unusually powerful basis for static
|
|
|
40 |
checking of C programs and a large amount of development work has
|
|
|
41 |
resulted in the production of the TenDRA C static checker (tchk).
|
|
|
42 |
The terms, TenDRA C checker and tchk are used interchangably in this
|
|
|
43 |
document.<P>
|
|
|
44 |
<A NAME=S5>
|
|
|
45 |
<HR><H2>1.2 The C static checker</H2>
|
|
|
46 |
The C static checker is a powerful and flexible tool which can perform
|
|
|
47 |
a number of static checks on C programs, including:<P>
|
|
|
48 |
<UL>
|
|
|
49 |
<LI>strict interface checking. In particular, the checker can analyse
|
|
|
50 |
programs against abstract APIs to check their conformance to the specification.
|
|
|
51 |
Abstract versions of most standard APIs are provided with the tool;
|
|
|
52 |
alternatively users can define their own abstract APIs using the syntax
|
|
|
53 |
described in Annex G;<P>
|
|
|
54 |
<LI>checking of integer sizes, overflows and implicit integer conversions
|
|
|
55 |
including potential 64-bit problems, against a 16 bit or 32 bit architecture
|
|
|
56 |
profile;<P>
|
|
|
57 |
<LI>strict ISO C standard checking, plus configurable support for
|
|
|
58 |
many non-ISO dialect features;<P>
|
|
|
59 |
<LI>extensive type checking, including prototype-style checking for
|
|
|
60 |
traditionally defined functions, conversion checking, type checking
|
|
|
61 |
on printf and scanf style argument strings and type checking between
|
|
|
62 |
translation units;<P>
|
|
|
63 |
<LI>variable analysis, including detection of unused variables, use
|
|
|
64 |
of uninitialised variables, dependencies on order of evaluation in
|
|
|
65 |
expressions and detection of unused function returns, computed values
|
|
|
66 |
and static variables;<P>
|
|
|
67 |
<LI>detection of unused header files;<P>
|
|
|
68 |
<LI>configurable tests for detecting many other common programming
|
|
|
69 |
errors;<P>
|
|
|
70 |
<LI>complete standard API usage analysis;<P>
|
|
|
71 |
<LI>several built-in checking environments plus support for user-defined
|
|
|
72 |
checking profiles.<P>
|
|
|
73 |
</UL>
|
|
|
74 |
<A NAME=S6>
|
|
|
75 |
<HR><H2>1.3 About this document</H2>
|
|
|
76 |
This document is designed as a reference manual detailing the features
|
|
|
77 |
of the C static checker. It contains eleven chapters (including this
|
|
|
78 |
introduction) and nine annexes.<P>
|
|
|
79 |
<UL>
|
|
|
80 |
<LI>Chapter 2: Configuring the Checker describes the built-in checking
|
|
|
81 |
modes and the design of customised environments;<P>
|
|
|
82 |
<LI>Chapters 3-8: Type Checking, Integral Types, Data Flow and Variable
|
|
|
83 |
Analysis , Preprocessing Checks, ISO C and Other Dialects and Common
|
|
|
84 |
Errors respectively;<P>
|
|
|
85 |
<LI>Chapter 9: The Symbol Table Dump deals with the detection of unused
|
|
|
86 |
header files, type checking across translation units and complete
|
|
|
87 |
standard API usage analysis;<P>
|
|
|
88 |
<LI>Chapter 10: Conditional Compilation describes the checker's approach
|
|
|
89 |
to conditional compilation;<P>
|
|
|
90 |
<LI>Chapter 11: References lists the references used in the production
|
|
|
91 |
of this document;<P>
|
|
|
92 |
<LI>Annex A: Checking Modes gives a description of the built-in environments;<P>
|
|
|
93 |
<LI>Annex B: Command Line Options lists the command line checking
|
|
|
94 |
options;<P>
|
|
|
95 |
<LI>Annex C: Specifying Integral Types describes the built-in integer
|
|
|
96 |
modes and the methods for customising them;<P>
|
|
|
97 |
<LI>Annex D: Pragma Syntax Specification;<P>
|
|
|
98 |
<LI>Annex E: Symbol Table Dump Specification;<P>
|
|
|
99 |
<LI>Annex F: Token Syntax describes the methods and syntax used to
|
|
|
100 |
produce abstract APIs;<P>
|
|
|
101 |
<LI>Annex G: Abstract API Manipulation gives details of the ways in
|
|
|
102 |
which TenDRA abstract APIs may be extended, combined or overriden
|
|
|
103 |
by local declarations;<P>
|
|
|
104 |
<LI>Annex H: Specifying Conversions with Tokens.
|
|
|
105 |
</UL>
|
|
|
106 |
<P>
|
|
|
107 |
<!-- FM pgf ignored -->
|
|
|
108 |
<HR>
|
|
|
109 |
<P><I>Part of the <A HREF="../index.html">TenDRA Web</A>.<BR>Crown
|
|
|
110 |
Copyright © 1998.</I></P>
|
|
|
111 |
</BODY>
|
|
|
112 |
</HTML>
|