Download LCLint User's Guide
Transcript
Contents iii Contents 1. Overview ..........................................................................................................................................2 2. Operation .........................................................................................................................................3 2.1 Messages .....................................................................................................................................4 2.2 Flags ...........................................................................................................................................4 2.3 Stylized Comments.......................................................................................................................5 2.3.1 Annotations..........................................................................................................................5 2.3.2 Control Comments ...............................................................................................................6 3. Abstract Types .................................................................................................................................6 3.1 Access .........................................................................................................................................8 3.2 Mutability....................................................................................................................................9 3.3 Boolean Types ...........................................................................................................................10 3.4 Primitive C Types ......................................................................................................................11 3.4.1 Characters ..........................................................................................................................11 3.4.2 Enumerators .......................................................................................................................11 3.4.3 Numeric Types ...................................................................................................................11 3.4.4 Arbitrary Integral Types .....................................................................................................12 4. Function Interfaces ........................................................................................................................13 4.1 Modifications.............................................................................................................................13 4.1.1 Special Modifications .........................................................................................................13 4.1.2 Missing Modifies Clauses...................................................................................................14 4.1.3 Limitations .........................................................................................................................15 4.2 Global Variables .......................................................................................................................15 4.2.1 Controlling Globals Checking ............................................................................................15 4.3 Declaration Consistency............................................................................................................17 5. Memory Management....................................................................................................................18 5.1 Storage Model ...........................................................................................................................18 5.2 Deallocation Errors...................................................................................................................19 5.2.1 Unshared References ..........................................................................................................19 5.2.2 Temporary Parameters........................................................................................................20 5.2.3 Owned and Dependent References......................................................................................21 5.2.4 Kept Parameters .................................................................................................................21 5.2.5 Shared References ..............................................................................................................21 5.2.6 Stack References.................................................................................................................21 5.2.7 Inner Storage......................................................................................................................21 5.3 Implicit Memory Annotations.....................................................................................................22 5.4 Reference Counting ...................................................................................................................23 6. Sharing ...........................................................................................................................................25