home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lcl2-24b.zip / guide-2.4b.os2inf.zip / guide.inf (.txt)
OS/2 Help File  |  1998-06-16  |  201KB  |  9,002 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. LCLint User's Guide ΓòÉΓòÉΓòÉ
  3.  
  4.  
  5.  
  6.                                LCLint User's Guide
  7.  
  8.  
  9.  
  10.  
  11.  
  12.                                    Version 2.4
  13.  
  14.                                    April 1998
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                                    David Evans
  21.  
  22.                        Software Devices and Systems Group
  23.  
  24.                        MIT Laboratory for Computer Science
  25.  
  26.  
  27.  
  28.  LCLint is a tool for statically checking C programs.  With minimal effort, 
  29. LCLint can be used as a better lint.[1]  If additional effort is invested 
  30. adding annotations to programs, LCLint can perform stronger checks than can be 
  31. done by any standard lint. 
  32.  
  33. Some problems detected by LCLint include: 
  34.  
  35.      Violations of information hiding.  A user-defined type can be declared as 
  36.       abstract, and a message is reported where code inappropriately depends on 
  37.       the representation of the type.  (Section 3) 
  38.  
  39.  
  40.      Inconsistent modification of caller-visible state.  Functions can be 
  41.       annotated with information on what caller-visible state may be modified 
  42.       by the function, and an error is reported if the modifications produced 
  43.       by the function contradict its declaration.  (Section 4.1) 
  44.  
  45.  
  46.      Inconsistent use of global variables.  Information on what global and 
  47.       file scope variables a function may use can be added to function 
  48.       declarations, and a message is reported if the implementation of the 
  49.       function uses other global variables or does not uses every global 
  50.       variable listed in its declaration.  (Section 4.2) 
  51.  
  52.  
  53.      Memory management errors.  Instances where storage that has been 
  54.       deallocated is used, or where storage is not deallocated (memory leaks). 
  55.       (Section 5) 
  56.  
  57.  
  58.      Dangerous data sharing or unexpected aliasing.  Parameters to a function 
  59.       share storage in a way that may lead to undefined or undesired behavior, 
  60.       or a reference to storage within the representation of an abstract type 
  61.       is created. (Section 6) 
  62.  
  63.  
  64.      Using possibly undefined storage or returning storage that is not 
  65.       completely defined (except as documented).  (Section 7.1) 
  66.  
  67.  
  68.      Dereferencing a possibly null pointer.  (Section 7.2) 
  69.  
  70.  
  71.      Dangerous macro implementations or invocations. (Section 8) 
  72.  
  73.  
  74.      Violations of customizable naming conventions. (Section 9) 
  75.  
  76.  
  77.      Program behavior that is undefined because it depends on order of 
  78.       evaluation, likely infinite loops, fall-through cases, incomplete logic, 
  79.       statements with no effect, ignored return values, unused declarations, 
  80.       and exceeding certain standard limits.  (Section 10) 
  81.  
  82.  
  83.  LCLint checking can be customized to select what classes of errors are 
  84.  reported using command line flags and stylized comments in the code. 
  85.  
  86.  This document is a guide to using LCLint.  Section 1 is a brief overview of 
  87.  the design goals of LCLint. Section 2 explains how to run LCLint, interpret 
  88.  messages produce, and control checking. Sections 3-10 describe particular 
  89.  checks done by LCLint. 
  90.  
  91.   Contents 
  92.  
  93.  
  94.    1. Overview 
  95.    2. Operation 
  96.           Messages 
  97.           Flags 
  98.           Stylized Comments 
  99.              -  Annotations 
  100.              -  Control Comments 
  101.    3. Abstract Types 
  102.           Access 
  103.           Mutability 
  104.           Boulean Types 
  105.           Primitive C Types 
  106.              -  Characters 
  107.              -  Enumerators 
  108.              -  Numeric Types 
  109.              -  Arbitrary Integral Types 
  110.    4. Function Interfaces 
  111.           Modifications 
  112.              -  Special Modifications 
  113.              -  Missing Modifies Clauses 
  114.              -  Limitations 
  115.           Global Variables 
  116.              -  Controlling Globals Checking 
  117.           Declaration Consistency 
  118.    5. Memory Management 
  119.           Storage Model 
  120.           Deallocation Errors 
  121.              -  Unshared References 
  122.              -  Temporary Parameters 
  123.              -  Owned and Dependent References 
  124.              -  Kept Parameters 
  125.              - 
  126.              -  Stack References 
  127.              -  Inner Storage 
  128.           Implicit Memory Annotations 
  129.           Reference Counting 
  130.    6. Sharing 
  131.           Aliasing 
  132.              -  Unique Parameters 
  133.              -  Returned Parameters 
  134.           Exposure 
  135.              -  Read-Only Storage 
  136.              -  Exposed Storage 
  137.    7. Value Constraints 
  138.           Use Before Definition 
  139.              -  Undefined Parameters 
  140.              -  Relaxing Checking 
  141.              -  Partially Defined Structures 
  142.              -  Global Variables 
  143.           Null Pointers 
  144.              -  Predicate Functions 
  145.              -  Overriding Null Types 
  146.              -  Relaxing Null Checking 
  147.           Execution 
  148.           Special Clauses 
  149.    8. Macros 
  150.           Constant Macros 
  151.           Function-like Macros 
  152.              -  Side-Effect Free Parameters 
  153.              -  Polymorphism 
  154.           Controlling Macro Checking 
  155.           Iterators 
  156.    9. Naming Conventions 
  157.           Type-Based Naming Conventions 
  158.              -  Czech Names 
  159.              -  Slovak Names 
  160.              -  Czechoslovak Names 
  161.           Namespace Prefixes 
  162.           Naming Restrictions 
  163.              -  Reserved Names 
  164.              -  Distinct Identifiers 
  165.   10. Other Checks 
  166.           Undefined Evaluation Order 
  167.           Problematic Control Structures 
  168.              -  Likely Infinite Loops 
  169.              -  Switches 
  170.              -  Deep Breaks 
  171.              -  Loop and If Bodies 
  172.              -  Complete if-else Logic 
  173.           Suspicious Statements 
  174.              -  Statements with No Effects 
  175.              -  Ignored Return Values 
  176.           Unused Declarations 
  177.           Complete Programs 
  178.              -  Unnecessary External Names 
  179.              -  Declarations Missing from Headers 
  180.           Compiler Limits 
  181.  
  182.  
  183.  Appendices 
  184.  
  185.  Appendix A.  Availability 
  186.  Appendix B.  Communication 
  187.  Appendix C.  Flags 
  188.  Appendix D.  Annotations 
  189.  Appendix E.  Control Comments 
  190.  Appendix F.  Libraries 
  191.  Appendix G.  Specifications 
  192.  Appendix H.  Emacs 
  193.  
  194.  
  195.  
  196.  Figures 
  197.  
  198.  
  199.  References 
  200.  Acknowledgements 
  201.  
  202.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  203.  
  204.   David Evans 
  205.  Software Devices and Systems 
  206.  evs@sds.lcs.mit.edu 
  207.  
  208.  
  209. ΓòÉΓòÉΓòÉ 1.1. LCLint User's Guide - 1. Overview ΓòÉΓòÉΓòÉ
  210.  
  211.  
  212.  
  213. 1. Overview 
  214.  
  215. The main goals for LCLint are to: 
  216.  
  217.  
  218.      Detect a large number of bugs in typical C programs, without producing an 
  219.       unacceptable number of spurious messages.  We are willing to accept the 
  220.       possibility that a few spurious messages are produced as long as it 
  221.       enables significantly more powerful checking and the spurious messages 
  222.       can be suppressed easily. 
  223.  
  224.  
  225.      Support a programming methodology involving abstract types and clean, 
  226.       documented interfaces in standard C programs. 
  227.  
  228.  
  229.      Provide a gradual transition for programmers.  LCLint can be used like a 
  230.       better standard lint with minimal effort.  Adding a few annotations to 
  231.       programs enables significantly better checking.  As more effort is put 
  232.       into annotating programs, better checking results. A representational 
  233.       effort/benefit curve for using LCLint is shown in Figure 1 (not available 
  234.       in HTML format).  As different checks are turned on and more information 
  235.       is given in code annotations the number of bugs that can be detected 
  236.       increases dramatically. 
  237.  
  238.  
  239.      Provide enough flexibility so that LCLint can be used effectively with a 
  240.       wide range of coding styles.  Especially important is making it easy to 
  241.       use LCLint effectively to maintain and modify legacy code. 
  242.  
  243.  
  244.      Check programs quickly and with no user interaction.  LCLint runs faster 
  245.       than most compilers.  Libraries can be used to enable fast checking of a 
  246.       few modules in a large program. 
  247.  
  248.   LCLint does many of the traditional lint checks including unused 
  249.  declarations, type inconsistencies, use-before-definition, unreachable code, 
  250.  ignored return values, execution paths with no return, likely infinite loops, 
  251.  and fall-through cases.  This document focuses on more powerful checks that 
  252.  are made possible by additional information given in source code annotations. 
  253.  [2]  Annotations are stylized comments that document certain assumptions about 
  254.  functions, variables, parameters, and types. They may be used to indicate 
  255.  where the representation of a user-defined type is hidden, to limit where a 
  256.  global variable may be used or modified, to constrain what a function 
  257.  implementation may do to its parameters, and to express checked assumptions 
  258.  about variables, types, structure fields, function parameters, and function 
  259.  results.  In addition to the checks specifically enabled by annotations, many 
  260.  of the traditional lint checks are improved by exploiting this additional 
  261.  information. 
  262.  
  263.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  264.  
  265.   David Evans 
  266.  Software Devices and Systems 
  267.  evs@sds.lcs.mit.edu 
  268.  
  269.  
  270. ΓòÉΓòÉΓòÉ 1.2. LCLint User's Guide - 2. Operation ΓòÉΓòÉΓòÉ
  271.  
  272.  
  273.  
  274.  2. Operation 
  275.  
  276. LCLint is invoked by listing files to be checked.  Initialization files, 
  277. command line flags, and stylized comments may be used to customize checking 
  278. globally and locally. 
  279.  
  280. The best way to learn to use LCLint, of course, is to actually use it (if you 
  281. don't already have LCLint installed on your system, download it).  Before you 
  282. read much further in this document, I recommend finding a small C program. 
  283. Then, try running: 
  284.  
  285. lclint *.c 
  286.  
  287. For the most C programs, this will produce a large number of messages.  To turn 
  288. off reporting for some of the messages, try: 
  289.  
  290. lclint -weak *.c 
  291.  
  292. The -weak flag is a mode flag that sets many checking parameters to select 
  293. weaker checking than is done in the default mode.  Other LCLint flags will be 
  294. introduced in the following sections;  a complete list is given in Appendix C. 
  295.  
  296. 2.1 Messages 
  297.  
  298. The format and content of messages printed by LCLint can be customized by the 
  299. user. A typical message is: 
  300.  
  301. sample.c: (in function faucet)
  302. sample.c:11:12: Fresh storage x not released before return
  303.   A memory leak has been detected.  Newly-allocated or only-qualified storage
  304.   is not released before the last reference to is it lost.  Use -mustfree to
  305.   suppress message.
  306.    sample.c:5:47: Fresh storage x allocated
  307.  The first line gives the name of the function in which the error is found. 
  308. This is printed before the first message reported for a function.  (The 
  309. function context is not printed if -showfunc is used.) 
  310.  
  311. The second line is the text of the message.  This message reports a memory leak 
  312. - storage allocated in a function is not deallocated before the function 
  313. returns. The text is preceded by the file name, line and column number where 
  314. the error is located.  The column numbers are used by the emacs mode (see 
  315. Appendix H) to jump to the appropriate line and column location.  (Column 
  316. numbers are not printed if -showcolumn is used.) 
  317.  
  318. The next line is a hint giving more information about the suspected error. Most 
  319. hints also include information on how the message may be suppressed.  For this 
  320. message, setting the -mustfree flag would prevent the message from being 
  321. reported.  Hints may be turned off by using -hints.  Normally, a hint is given 
  322. only the first time a class of error is reported. To have LCLint print a hint 
  323. for every message regardless, use +forcehints. 
  324.  
  325. The final line of the message gives additional location information.  For this 
  326. message, it tells where the leaking storage is allocated. 
  327.  
  328. The generic message format is (parts enclosed in square brackets are optional): 
  329.  
  330.   [<file>:<line> (in <context>)]
  331.   <file>:<line>[,<column>]: message
  332.      [hint]
  333.       <file>:<line>,<column>: extra location information, if appopriate
  334.  
  335. The text of messages and hints may be longer than one line.  They are split 
  336. into lines of length less than the value set using -linelen <number>.  The 
  337. default line length is 80 characters.  LCLint attempts to split lines in a 
  338. sensible place as near to the line length limit as possible. 
  339.  
  340. The +parenfileformat flag can be used to generate file locations in the format 
  341. recognized by Microsoft Developer Studio.  If +parenfileformat is set, the line 
  342. number follows the file name in parentheses (e.g., sample.c(11).). 
  343.  
  344.  2.2 Flags 
  345.  
  346. So that many programming styles can be supported, LCLint provides over 300 
  347. flags for controlling checking and message reporting.  Some of the flags are 
  348. introduced in the body of this document.  Apppendix C describes every flag. 
  349. Modes and shortcut flags are provided for setting many flags at once. 
  350. Individual flags can override the mode settings. 
  351.  
  352. Flags are preceded by + or -.  When a flag is preceded by + we say it is on; 
  353. when it is preceded by - it is off. The precise meaning of on and off depends 
  354. on the type of flag. 
  355.  
  356. The +/- flag settings are used for consistency and clarity, but contradict 
  357. standard UNIX usage and is easy to accidentally use the wrong one.  To reduce 
  358. the likelihood of using the wrong flag, LCLint issues warnings when a flag is 
  359. set in an unusual way.  Warnings are issued when a flag is redundantly set to 
  360. the value it already had (these errors are not reported if the flag is set 
  361. using a stylized comment), if a mode flag or special flag is set after a more 
  362. specific flag that will be set by the general flag was already set, if value 
  363. flags are given unreasonable values, of if flags are set in an inconsistent 
  364. way.  The -warnflags flag suppresses these warnings. 
  365.  
  366. Default flag settings will be read from ~/.lclintrc if it is readable.  If 
  367. there is a .lclintrc file in the working directory, settings in this file will 
  368. be read next and its settings will override those in ~/.lclintrc.  Command-line 
  369. flags override settings in either file.  The syntax of the .lclintrc file is 
  370. the same as that of command-line flags, except that flags may be on separate 
  371. lines and the # character may be used to indicate that the remainder of the 
  372. line is a comment. The -nof flag prevents the  ~/.lclintrc file from being 
  373. loaded.  The -f <filename> flag loads options from filename. 
  374.  
  375.  2.3 Stylized Comments 
  376.  
  377. Stylized comments are used to provide extra information about a type, variable 
  378. or function interface to improve checking, or to control flag settings locally. 
  379.  
  380. All stylized comments begin with /*@ and are closed by the end of the comment. 
  381. The role of the @ may be played by any printable character.  Use -commentchar 
  382. <char> to select a different stylized comment marker. 
  383.  
  384. 2.3.1 Annotations 
  385.  
  386. Annotations are stylized comments that follow a definite syntax.  Although they 
  387. are comments, they may only be used in fixed grammatical contexts (e.g., like a 
  388. type qualifier). 
  389.  
  390. Syntactic comments for function interfaces are described in Section 4; comments 
  391. for declaring constants in Section 8.1. and comments for declaring iterators in 
  392. Section 8.4. Sections 3-8 include descriptions of annotations for expressing 
  393. assumptions about variables, parameters, return values, structure fields and 
  394. type definitions.  A summary of annotations is found in Apppendix D. 
  395.  
  396. 2.3.2 Control Comments 
  397.  
  398. Unlike annotations, control comments may appear between any two tokens in a C 
  399. program.[3]  Syntactically, they are no different from standard comments. 
  400. Control comments are used to provide source-level control of LCLint checking. 
  401. They may be used to suppress spurious messages, set flags, and control checking 
  402. locally in other ways.  A complete description of control comments is found in 
  403. Apppendix E. 
  404.  
  405. Most flags (all except those characterized as "global" in Apppendix C) can be 
  406. set locally using control comments.  A control comment can set flags locally to 
  407. override the command line settings.  The original flag settings are restored 
  408. before processing the next file. The syntax for setting flags in control 
  409. comments is the same as that of the command line, except that flags may also be 
  410. preceded by = to restore their setting to the original command-line value.  For 
  411. instance, 
  412.  
  413. /*@+boolint -modifies =showfunc@*/
  414. sets boolint on (this makes bool and int indistinguishable types), sets 
  415. modifies off (this prevents reporting of modification errors), and sets 
  416. showfunc to its original setting (this controls  whether or not the name of a 
  417. function is displayed before a message). 
  418.  
  419. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  420.  
  421.  David Evans 
  422. Software Devices and Systems 
  423. evs@sds.lcs.mit.edu 
  424.  
  425.  
  426. ΓòÉΓòÉΓòÉ 1.3. LCLint User's Guide - 3. Abstract Types ΓòÉΓòÉΓòÉ
  427.  
  428.  
  429.  
  430.  3. Abstract Types 
  431.  
  432. Traditionally, programming books wax mathematical when they arrive at the topic 
  433. of abstract data types╨ò Such books make it seem as if you'd never actually use 
  434. an abstract data type except as a sleep aid. 
  435.  
  436. - Steve McConnell 
  437.  
  438. Information hiding is a technique for handling complexity.  By hiding 
  439. implementation details, programs can be understood and developed in distinct 
  440. modules and the effects of a change can be localized.  One technique for 
  441. information hiding is data abstraction.  An abstract type is used to represent 
  442. some natural program abstraction.  It provides functions for manipulating 
  443. instances of the type.  The module that implements these functions is called 
  444. the implementation module.  We call the functions that are part of the 
  445. implementation of an abstract type the operations of the type.  Other modules 
  446. that use the abstract type are called clients. 
  447.  
  448. Clients may use the type name and operations, but should not manipulate or rely 
  449. on the actual representation of the type.  Only the implementation module may 
  450. manipulate the representation of an abstract type.  This hides information, 
  451. since implementers and maintainers of client modules should not need to know 
  452. anything about how the abstract type is implemented. It provides modularity, 
  453. since the representation of an abstract type can be changed without having to 
  454. change any client code. 
  455.  
  456. LCLint supports abstract types by detecting places where client code depends on 
  457. the concrete representation of an abstract type. 
  458.  
  459. To declare an abstract type, the abstract annotation is added to a typedef. For 
  460. example (in mstring.h), 
  461.  
  462. typedef /*@abstract@*/ char *mstring;
  463. declares mstring as an abstract type.  It is implemented using a char *, but 
  464. clients of the type should not depend on or need to be aware of this.  If it 
  465. later becomes apparent that a better representation such as a string table 
  466. should be used, we should be able to change the implementation of mstring 
  467. without having to change or inspect any client code. 
  468.  
  469. In a client module, abstract types are checked by name, not structure.  LCLint 
  470. reports an error if an instance of mstring is passed as a char * (for instance, 
  471. as an argument to strlen), since the correctness of this call depends on the 
  472. representation of the abstract type.  LCLint also reports errors if any C 
  473. operator except assignment (=) or sizeof is used on an abstract type.  The 
  474. assignment operator is allowed since its semantics do not depend on the 
  475. representation of the type.[4]  The use of sizeof is also permitted, since this 
  476. is the only way for clients to allocate pointers to the abstract type.  Type 
  477. casting objects to or from abstract types in a client module is an abstraction 
  478. violation and will generate a warning message. 
  479.  
  480. Normally, LCLint will assume a type definition is not abstract unless the 
  481. /*@abstract@*/ qualifier is used.  If instead you want all user-defined types 
  482. to be abstract types unless they are marked as concrete, the +impabstract flag 
  483. can be used.  This adds an implicit abstract annotation to any typedef that is 
  484. not marked with /*@concrete@*/. 
  485.  
  486. Some examples of abstraction violations detected by LCLint are shown in Figure 
  487. 2. 
  488.  
  489.  
  490.  
  491.  3.1 Access 
  492.  
  493. Where code may manipulate the representation of an abstract type, we say the 
  494. code has access to that type.  If code has access to an abstract type, the 
  495. representation of the type and the abstract type are indistinguishable. 
  496. Usually, an abstract type is implemented by a single program module that is the 
  497. only code that has access to the type representation.  Sometimes, more 
  498. complicated access control is desired if the implementation of an abstract type 
  499. is split across program files, or particular client code needs to access the 
  500. representation. 
  501.  
  502. There are a several ways of selecting what code has access the representation 
  503. of an abstract type: 
  504.  
  505.      Modules.  An abstract type defined in M.h is accessible in M.c. 
  506.       Controlled by the accessmodule flag.  This means when accessmodule is on, 
  507.       as it is by default, the module access rule is in effect.  If 
  508.       accessmodule is off (when -accessmodule is used), the module access rule 
  509.       is not in effect and an abstract type defined in M.h is not necessarily 
  510.       accessible in M.c 
  511.  
  512.  
  513.      File names.  An abstract type named type is accessible in files named 
  514.       type.<extenstion>.  For example, the representation of mstring is be 
  515.       accessible in mstring.h and mstring.c.  Controlled by the accessfile 
  516.       flag. 
  517.  
  518.  
  519.      Function names.  An abstract type named type may be accessible in a 
  520.       function named type_name or typeName.  For example, mstring_length and 
  521.       mstringLength would have access to the mstring abstract type.  Controlled 
  522.       by the naming convention (see Section 9). 
  523.  
  524.  
  525.      Access control comments. The syntax /*@access type,+@*/[6] allows the 
  526.       following code to access the representation of type.  Similarly, 
  527.       /*@noaccess type,+@*/ restricts access to the representation of type. 
  528.       The type in a noaccess comment must have been declared as an abstract 
  529.       type. 
  530.  
  531.  
  532.   3.2 Mutability 
  533.  
  534.  We can view types as being mutable or immutable.  A type is mutable if the 
  535.  value of an instance of the type can be changed by passing it as a parameter 
  536.  to a function call.[7]  For example, the primitive type int is immutable.  If 
  537.  i is a local variable of type int and no variables point to the location where 
  538.  i is stored, the value of i must be the same before and after the call f(i). 
  539.  Structure and union types are also immutable, since they are copied when they 
  540.  are passed as arguments.  On the other hand, pointer types are mutable.  If x 
  541.  is a local variable of type int *, the value of *x (and hence, the value of 
  542.  the object x) can be changed by the function call g(x). 
  543.  
  544.  The mutability of a concrete type is determined by its type definition. For 
  545.  abstract types, mutability does not depend on the type representation but on 
  546.  what operations the type provides. If an abstract type has operations that may 
  547.  change the value of instances of the type, the type is mutable.  If not, it is 
  548.  immutable.  The value of an instance of an immutable type never changes. 
  549.  Since object sharing is noticeable only for mutable types, they are checked 
  550.  differently from immutable types. 
  551.  
  552.  The /*@mutable@*/ and /*@immutable@*/ annotations are used to declare an 
  553.  abstract type as mutable or immutable.  (If neither is used, the abstract type 
  554.  is assumed to be mutable.)  For example, 
  555.  
  556.    typedef /*@abstract@*/ /*@mutable@*/ char *mstring;   typedef /*@abstract@*/ 
  557.  /*@immutable@*/ int weekDay; declares mstring as a mutable abstract type and 
  558.  weekDay as  an immutable abstract type. 
  559.  
  560.  Clients of  a mutable abstract type need to know the semantics of assignment. 
  561.  After the assignment expression s = t, do s and t refer to the same object 
  562.  (that is, will changes to the value of s also change the value of t)? 
  563.  
  564.  LCLint prescribes that all abstract types have sharing semantics, so s and t 
  565.  would indeed be the same object.  LCLint will report an error if a mutable 
  566.  type is implemented with a representation (e.g., a struct) that does not 
  567.  provide sharing semantics (controlled by mutrep flag). 
  568.  
  569.  The mutability of an abstract type is not necessarily the same as the 
  570.  mutability of its representation. We could use the immutable concrete type int 
  571.  to represent mutable strings using an index into a string table, or declare 
  572.  mstring as immutable as long as no operations are provided that modify the 
  573.  value of an mstring. 
  574.  
  575.   3.3 Boolean Types 
  576.  
  577.  Standard C has no boolean representation - the result of a comparison operator 
  578.  is an integer, and no type checking is done for test expressions.  Many common 
  579.  errors can be detected by introducing a distinct boolean type and stronger 
  580.  type checking. 
  581.  
  582.  Use the - booltype name flag to select the type name used to represent boolean 
  583.  values[8]  Relations, comparisons and certain standard library functions are 
  584.  declared to return bool types. 
  585.  
  586.   LCLint checks that the test expression in an if, while, or for statement or 
  587.  an operand to &&, || or ! is a boolean.  If the type of a test expression is 
  588.  not a boolean, LCLint will report an error depending on the type of the test 
  589.  expression and flag settings.  If the test expression has pointer type, LCLint 
  590.  reports an error if predboolptr is on (this can be used to prevent messages 
  591.  for the idiom of  testing if a pointer is not null without a comparison).  If 
  592.  it is type int, an error is reported if predboolint is on. For all other 
  593.  types, LCLint reports an error if predboolothers is on. 
  594.  
  595.  Since using = instead of == is such a common bug, reporting of test 
  596.  expressions that are assignments is controlled by the separate predassign 
  597.  flag.  The message can be suppressed by adding extra parentheses around the 
  598.  test expression. 
  599.  
  600.  Apppendix C (page 50) describes other flags for controlling boolean checking. 
  601.  
  602.  Figure 3.  Boolean Checking 
  603.  
  604.   3.4 Primitive C Types 
  605.  
  606.  Two types have compatible type if their types are the same. 
  607.  - ANSI C, 3.1.2.6. 
  608.  
  609.  Two types need not be identical to be compatible. 
  610.  - ANSI C, footnote to 3.1.2.6.  LCLint supports stricter checking of primitive 
  611.  C types.  The char and enum types can be checked as distinct types, and the 
  612.  different numeric types can be type-checked strictly. 
  613.  
  614.   3.4.1 Characters 
  615.  
  616.  The primitive char type can be type-checked as a distinct type.  If char is 
  617.  used as a distinct type, common errors involving assigning ints to chars are 
  618.  detected. 
  619.  
  620.  The +charint flag can be used for checking legacy programs where char and int 
  621.  are used interchangeably.  If charint is on, char types indistinguishable from 
  622.  ints.  To keep char and int as distinct types, but allow chars to be used to 
  623.  index arrays, use +charindex. 
  624.  
  625.  3.4.2 Enumerators 
  626.  
  627.  Standard C treats user-declared enum types just like integers.  An arbitrary 
  628.  integral value may be assigned to an enum type, whether or not it was listed 
  629.  as an enumerator member.  LCLint checks each user-defined enum type as 
  630.  distinct type.  An error is reported if a value that is not an enumerator 
  631.  member is assigned to the enum type, or if an enum type is used as an operand 
  632.  to an arithmetic operator. 
  633.  
  634.  If the enumint flag is on, enum and int types may be used interchangeably. 
  635.  Like charindex, if  the enumindex flag is on, enum types may be used to index 
  636.  arrays. 
  637.  
  638.  3.4.3 Numeric Types 
  639.  
  640.  LCLint reports where numeric types are used in dangerous or inconsistent ways. 
  641.  With the strictest checking, LCLint will report an error anytime numeric types 
  642.  do not match exactly.  If the relaxquals flag is on, only those 
  643.  inconsistencies which may corrupt values are reported.  For example, if an int 
  644.  is assigned to a variable of type long (or passed as a long formal parameter), 
  645.  LCLint will not report an error if relaxquals is on since a long must have at 
  646.  least enough bits to store an int without data loss.  On the other hand, an 
  647.  error would be reported if the long were assigned to an int, since the int 
  648.  type may not have enough bits to store the long value. 
  649.  
  650.  Similarly, if a signed value is assigned to an unsigned, LCLint will report an 
  651.  error since an unsigned type cannot represent all signed values correctly.  If 
  652.  the ignoresigns flag is on, checking is relaxed to ignore all sign qualifiers 
  653.  in type comparisons (this is not recommended, since it will suppress reporting 
  654.  of real bugs, but may be necessary for quickly checking certain legacy code). 
  655.  
  656.  3.4.4 Arbitrary Integral Types 
  657.  
  658.   LCLint supports three different kinds of arbitrary integral types: 
  659.  
  660.  / *@integraltype@*/ 
  661.  
  662.  An arbitrary integral type.  The actual type may be any one of short, int, 
  663.  long, unsigned short, unsigned, or unsigned long . 
  664.  
  665.  /*@unsignedintegraltype@*/ 
  666.  
  667.  An arbitrary unsigned integral type.  The actual type may be any one of 
  668.  unsigned short, unsigned, or unsigned long . 
  669.  
  670.  /*@signedintegraltype@*/ 
  671.  
  672.  An arbitrary signed integral type.  The actual type may be any one of short, 
  673.  int, or long. 
  674.  
  675.  LCLint reports an error if the code depends on the actual representation of a 
  676.  type declared as an arbitrary integral.  The match-any-integral flag relaxes 
  677.  checking and allows an arbitrary integral type is allowed to match any 
  678.  integral type. 
  679.  
  680.   Other flags set the arbitrary integral types to a concrete type.  These 
  681.  should only be used if portability to platforms that may use different 
  682.  representations is not important.  The long-integral and 
  683.  long-unsigned-integral flags set the type corresponding to /*@integraltype@*/ 
  684.  to be unsigned long and long respectively. The long-unsigned-unsigned-integral 
  685.  flag sets the type corresponding to /*@unsignedintegraltype@*/ to be unsigned 
  686.  long. The long-signed-integral flag sets the type corresponding to 
  687.  /*@signedintegraltype@*/ to be long. 
  688.  
  689.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  690.  
  691.   David Evans 
  692.  Software Devices and Systems 
  693.  evs@sds.lcs.mit.edu 
  694.  
  695.  
  696. ΓòÉΓòÉΓòÉ 1.3.1. Figure 2.  Violations using abstract types. ΓòÉΓòÉΓòÉ
  697.  
  698.  
  699.  
  700. Figure 2.  Violations using abstract types. 
  701.  
  702.      source 
  703.      messages 
  704.  
  705.   David Evans 
  706.  Software Devices and Systems 
  707.  evs@sds.lcs.mit.edu 
  708.  
  709.  
  710. ΓòÉΓòÉΓòÉ 1.3.1.1. palindrome.c ΓòÉΓòÉΓòÉ
  711.  
  712.  
  713.  
  714. palindrome.c 
  715.  
  716. #include "bool.h"
  717. #include "mstring.h"
  718.  
  719. bool isPalindrome (mstring s)
  720. {
  721.    char *current = (char *) s;
  722.    int i, len = (int) strlen (s);
  723.  
  724.    for (i = 0; i <= (len+1)/2; i++)
  725.      {
  726.         if (current[i] != s[len-i-1])
  727.            return FALSE;
  728.      }
  729.    return TRUE;
  730. }
  731.  
  732. bool callPal (void)
  733. {
  734.    return (isPalindrome ("bob"));
  735. }
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801. ΓòÉΓòÉΓòÉ 1.3.1.1.1. bool.h ΓòÉΓòÉΓòÉ
  802.  
  803.  
  804.  
  805. bool.h 
  806.  
  807. #ifndef BOOL_H
  808. #define BOOL_H
  809.  
  810. #ifndef FALSE
  811. #define FALSE 0
  812. #endif
  813.  
  814. #ifndef TRUE
  815. #define TRUE (! FALSE)
  816. #endif
  817.  
  818. typedef int bool;
  819.  
  820. # define bool_initMod()
  821. # define bool_unparse(b) ((b) ? "true" : "false" )
  822. # define bool_not(b) ((b) ? FALSE : TRUE)
  823. # define bool_equal(a,b) ((a) ? (b) : !(b))
  824.  
  825. # endif
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886. ΓòÉΓòÉΓòÉ 1.3.1.1.2. mstring.h ΓòÉΓòÉΓòÉ
  887.  
  888.  
  889.  
  890. mstring.h 
  891.  
  892. typedef /*@abstract@*/ char *mstring;
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954. ΓòÉΓòÉΓòÉ 1.3.1.2. fig2-out.html ΓòÉΓòÉΓòÉ
  955.  
  956.  
  957.  
  958. LCLint Output 
  959.  
  960. LCLint 2.2 --- 25 Aug 96
  961.  
  962. palindrome.c: (in function isPalindrome)
  963. palindrome.c:6,29: Cast from underlying abstract type
  964.                       mstring: (char *)s
  965.   An abstraction barrier is broken. If necessary, use
  966.   /*@access @*/ to allow access to an abstract
  967.   type. (-abstract will suppress message)
  968. palindrome.c:7,31: Function strlen expects arg 1 to be
  969.                       char * gets mstring: s
  970.   Underlying types match, but mstring is an abstract
  971.   type that is not accessible here.
  972. palindrome.c:11,27: Array fetch from non-array
  973.                        (mstring): s[len - i - 1]
  974.   Types are incompatible. (-type will suppress
  975.   message)
  976. palindrome.c: (in function callPal)
  977. palindrome.c:19,26: Function isPalindrome expects arg
  978.     1 to be mstring gets char *: "bob"
  979.   Underlying types match, but mstring is an abstract
  980.   type that is not accessible here.
  981.  
  982. Finished LCLint checking --- 4 code errors found
  983.  
  984.  
  985. ΓòÉΓòÉΓòÉ 1.3.2. Figure 3.  Boolean checking. ΓòÉΓòÉΓòÉ
  986.  
  987.  
  988.  
  989. Figure 3.  Boolean checking. 
  990.  
  991.      source 
  992.      messages 
  993.  
  994.   David Evans 
  995.  Software Devices and Systems 
  996.  evs@sds.lcs.mit.edu 
  997.  
  998.  
  999. ΓòÉΓòÉΓòÉ 1.3.2.1. bool.c ΓòÉΓòÉΓòÉ
  1000.  
  1001.  
  1002.  
  1003. bool.c 
  1004.  
  1005. #include "bool.h"
  1006.  
  1007. int f (int i, char *s,
  1008.        bool b1, bool b2)
  1009. {
  1010.   if (i = 3)
  1011.     return b1;
  1012.   if (!i || s)
  1013.     return i;
  1014.   if (s)
  1015.     return 7;
  1016.   if (b1 == b2)
  1017.     return 3;
  1018.   return 2;
  1019. }
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081. ΓòÉΓòÉΓòÉ 1.3.2.2. fig3-out.html ΓòÉΓòÉΓòÉ
  1082.  
  1083.  
  1084.  
  1085. LCLint Output 
  1086.  
  1087. LCLint 2.4 --- 12 Apr 98
  1088.  
  1089. bool.c: (in function f)
  1090. bool.c:7,12: Return value type bool does not match
  1091.                 declared type int: b1
  1092.   To make bool and int types equivalent, use +boolint.
  1093. bool.c:6,7: Test expression for if is assignment
  1094.                expression: i = 3
  1095.   The condition test is an assignment expression.
  1096.   Probably, you mean to use == instead of =. If an
  1097.   assignment is intended, add an extra parentheses
  1098.   nesting (e.g., if ((a = b)) ...) to suppress this
  1099.   message. (-predassign will suppress message)
  1100. bool.c:6,7: Test expression for if not bool, type int:
  1101.                i = 3
  1102.   Test expression type is not boolean or int.
  1103.   (-predboolint will suppress message)
  1104. bool.c:8,8: Operand of ! is non-boolean (int): !i
  1105.   The operand of a boolean operator is not a boolean.
  1106.   Use +ptrnegate to allow ! to be used on pointers.
  1107.   (-boolops will suppress message)
  1108. bool.c:8,13: Right operand of || is non-boolean (char
  1109.                 *): !i || s
  1110. bool.c:10,7: Test expression for if not bool, type
  1111.                 char *: s
  1112.   Test expression type is not boolean. (-predboolptr
  1113.   will suppress message)
  1114. bool.c:12,7: Use of == with bool variables (risks
  1115.     inconsistency because of multiple true values):
  1116.     b1 == b2
  1117.   Two bool values are compared directly using a C
  1118.   primitive. This may produce unexpected results since
  1119.   all non-zero values are considered TRUE, so
  1120.   different TRUE values may not be equal. The file
  1121.   bool.h (included in lclint/lib) provides bool_equal
  1122.   for safe bool comparisons. (-boolcompare will
  1123.   suppress message)
  1124.  
  1125. Finished LCLint checking --- 7 code errors found
  1126.  
  1127.  
  1128. ΓòÉΓòÉΓòÉ 1.4. LCLint User's Guide - 4. Function Interfaces ΓòÉΓòÉΓòÉ
  1129.  
  1130.  
  1131.  
  1132.  4. Function Interfaces 
  1133.  
  1134. Functions communicate with their calling environment through an interface.  The 
  1135. caller communicates the values of actual parameters and global variables to the 
  1136. function, and the function communicates to the caller through the return value, 
  1137. global variables and storage reachable from the actual parameters.  By keeping 
  1138. interfaces narrow (i.e., restricting the amount of information visible across a 
  1139. function interface), we can understand and implement functions independently. 
  1140.  
  1141. A function prototype documents the interface to a function.  It serves as a 
  1142. contract between the function and its caller.  In early versions of C, the 
  1143. function "prototype" was very limited.  It described the type returned by the 
  1144. function but nothing about its parameters.  The main improvement provided by 
  1145. ANSI C was the ability to add information on the number and types of parameter 
  1146. to a function.  LCLint provides the means to express much more about a function 
  1147. interface: what global variable the function may use, what values visible to 
  1148. the caller it may modify, if a pointer parameter may be a null pointer or point 
  1149. to undefined storage, if storage pointed to by a parameter is deallocated 
  1150. before the function returns, if the function may create new aliases to a 
  1151. parameter, can the caller modify or deallocate the return value, etc. 
  1152.  
  1153. The extra interface information places constraints on both how the function may 
  1154. be called and how it may be implemented.  LCLint reports places where these 
  1155. constrains are not satisfied.  Typically, these indicate bugs in the code or 
  1156. errors in the interface documentation. 
  1157.  
  1158. This section describes syntactic comments may be added to a function 
  1159. declaration to document what global variables the function implementation may 
  1160. use and what values visible to its caller it may modify.  Sections 5-7 describe 
  1161. annotations may be added to parameters to constrain valid arguments to a 
  1162. function and how these arguments may be used after the call and to the return 
  1163. value to constrain results. 
  1164.  
  1165.  4.1 Modifications 
  1166.  
  1167. The modifies clause lists what values visible to the caller may be modified by 
  1168. a function.  Modifies clauses limit what values a function may modify, but they 
  1169. do not require that listed values are always modified.  The declaration, 
  1170.  
  1171. int f (int *p, int *q) /*@modifies *p@*/;
  1172. declares a function f that may modify the value pointed to by its first 
  1173. argument but may not modify the value of its second argument or any global 
  1174. state. 
  1175.  
  1176. LCLint checks that a function does not modify any caller-visible value not 
  1177. encompassed by its  modifies clause and does modify all values listed in its 
  1178. modifies clause on some possible execution of the function.  Figure 4 shows an 
  1179. example of modifies checking done by LCLint. 
  1180.  
  1181.  4.1.1 Special Modifications 
  1182.  
  1183. A few special names are provided for describing function modifications: 
  1184.  
  1185. internalState 
  1186.  
  1187. The function modifies some internal state (that is, the value of a static 
  1188. variable).  Even though a client cannot access the internal state directly, it 
  1189. is important to know that something may be modified by the function call both 
  1190. for clear documentation and for checking undefined order of evaluation (Section 
  1191. 10.1) and side-effect free parameters (Section 8.2.1). 
  1192.  
  1193.  fileSystem 
  1194.  
  1195. The function modifies the file system.  Any modification that may change the 
  1196. system state is considered a file system modification.  All functions that 
  1197. modify an object of type pointer to FILE also modify the file system.  In 
  1198. addition, functions that do not modify a FILE pointer but modify some state 
  1199. that is visible outside this process also modify the file system (e.g., 
  1200. rename).  The flag mod-file-system controls reporting of undocumented file 
  1201. system modifications.  nothing 
  1202.  
  1203. The function modifies nothing (i.e., it is side-effect free). 
  1204.  
  1205. The syntactic comment, /*@*/ in a function declaration or definition (after the 
  1206. parameter list, before the semi-colon or function body) denotes a function that 
  1207. modifies nothing and does not use any global variables (see Section 4.2). 
  1208.  
  1209. Figure 4.  Modifies checking. 
  1210.  
  1211.  
  1212.  
  1213.  4.1.2 Missing Modifies Clauses 
  1214.  
  1215. LCLint is designed so programs with many functions that are declared without 
  1216. modifies clauses can be checked effectively.  Unless modnomods is in on, no 
  1217. modification errors are reported checking a function declared with no modifies 
  1218. clause. 
  1219.  
  1220. A function with no modifies clause is an unconstrained function since there are 
  1221. no documented constraints on what it may modify.  When an unconstrained 
  1222. function is called, it is checked differently from a function declared with a 
  1223. modifies clause.  To prevent spurious errors, no modification error is reported 
  1224. at the call site unless the moduncon flag is on.  Flags control whether errors 
  1225. involving unconstrained functions are reported for other checks that depend on 
  1226. modifications (side-effect free macro parameters (Section 8.2.1), undefined 
  1227. evaluation order (Section 10.1), and likely infinite loops (Section 10.2.1).) 
  1228.  
  1229.  4.1.3 Limitations 
  1230.  
  1231. Determining whether a function modifies a particular parameter or global is in 
  1232. general an undecidable[9] problem.  To enable useful checking, certain 
  1233. simplifying assumptions are necessary.  LCLint assumes an object is modified 
  1234. when it appears on the left hand side of an assignment or it is passed to a 
  1235. function as a parameter which may be modified by that function (according to 
  1236. the called function's modifies clause). Hence, LCLint will report spurious 
  1237. modification errors for assignments that do not change the value of an object 
  1238. or modifications that are always reversed before a procedure returns.  The 
  1239. /*@-mods@*/ and /*@=mods@*/ control comments can be used around these 
  1240. modifications to suppress the message. 
  1241.  
  1242.  4.2 Global Variables 
  1243.  
  1244. Another aspect of a function's interface, is the global variables it uses.  A 
  1245. globals list in a function declaration lists external variables that may be 
  1246. used in the function body. LCLint checks that global variables used in a 
  1247. procedure match those listed in its globals list. A global is used in a 
  1248. function if it appears in the body directly, or it is in the globals list of a 
  1249. function called in the body. LCLint reports if a global that is used in a 
  1250. procedure is not listed in its globals list, and if a listed global is not used 
  1251. in the function implementation. 
  1252.  
  1253.  Figure 5 shows an example function definition with a globals list and 
  1254. associated checking done by LCLint. 
  1255.  
  1256.  4.2.1 Controlling Globals Checking 
  1257.  
  1258. Whether on not an error is reported for a use of a global variable in a given 
  1259. function depends on the scope of the variable (file static or external), the 
  1260. checking annotation used in the variable declaration or the implicit annotation 
  1261. if no checking annotation is used, whether or not the function is declared with 
  1262. a globals list, and flag settings. 
  1263.  
  1264. A global or file static variable declaration may be preceded by an annotation 
  1265. to indicate how the variable should be checked.  In order of decreasing checks, 
  1266. the annotations are: 
  1267.  
  1268. /*@checkedstrict@*/ 
  1269.  
  1270. Strictest checking.  Undocumented uses and modifications of the variable are 
  1271. reported in all functions whether or not they have a globals list (unless 
  1272. checkstrictglobs is off).  /*@checked@*/ 
  1273.  
  1274. Undocumented use of the variable is reported in a function with a globals list, 
  1275. but not in a function declared with no globals (unless globnoglobs is on). 
  1276.  
  1277.  /*@checkmod@*/ 
  1278.  
  1279. Undocumented uses of the variable are not reported, but undocumented 
  1280. modifications are reported.  (If modglobsnomods is on, errors are reported even 
  1281. in functions declared with no modifies clause or globals list.) 
  1282. /*@unchecked@*/ 
  1283.  
  1284. No messages are reported for undocumented use or modification of this global 
  1285. variable.  If a variable has none of these annotations, an implicit annotation 
  1286. is determined by the flag settings. 
  1287.  
  1288. Different flags control the implicit annotation for variables declared with 
  1289. global scope and variables declared with file scope (i.e., using the static 
  1290. storage qualifier). To set the implicit annotation for global variables 
  1291. declared in context (globs for external variables or statics for file static 
  1292. variable) to be annotation (checked, checkmod, checkedstrict ) use 
  1293. imp<annotation><context>.  For example, +impcheckedstrictstatics makes the 
  1294. implicit checking on unqualified file static variables checkedstrict.  (See 
  1295. Apppendix C, page 51, for a complete list of globals checking flags.) 
  1296.  
  1297.  4.3 Declaration Consistency 
  1298.  
  1299. LCLint checks that function declarations and definitions are consistent.  The 
  1300. general rule is that the first declaration of a function imply all later 
  1301. declarations and definitions.  If a function is declared in a header file, the 
  1302. first declaration processed is its first declaration (if it is declared in more 
  1303. than one header file an error is reported if redecl is set).  Otherwise, the 
  1304. first declaration in the file defining the function is its first declaration. 
  1305.  
  1306. Later declarations may not include variables in the globals list that were not 
  1307. included in the first declaration.  The exception to this is when the first 
  1308. declaration is in a header file and the later declaration or definition 
  1309. includes file static variables.  Since these are not visible in the header 
  1310. file, they can not be included in the header file declaration.  Similarly, the 
  1311. modifies clause of a later declaration may not include objects that are not 
  1312. modifiable in the first declaration.  The later declaration may be more 
  1313. specific.  For example, if the header declaration is: 
  1314.  
  1315. extern void setName (employee e, char *s) /*@modifies e@*/;
  1316. the later declaration could be, 
  1317.  
  1318.    void setName (employee e, char *) /*@modifies e->name@*/;
  1319. If employee is an abstract type, the declaration in the header should not refer 
  1320. to a particular implementation (i.e., it shouldn't rely on there being a name 
  1321. field), but the implementation declaration can be more specific. 
  1322.  
  1323. This rule also applies to file static variables.  The header declaration for a 
  1324. function that modifies a file static variable should use modifies internalState 
  1325. since file static variables are not visible to clients.  The implementation 
  1326. declaration should list the actual file static variables that may be modified. 
  1327.  
  1328. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1329.  
  1330.  David Evans 
  1331. Software Devices and Systems 
  1332. evs@sds.lcs.mit.edu 
  1333.  
  1334.  
  1335. ΓòÉΓòÉΓòÉ 1.4.1. Figure 4.  Modifies checking. ΓòÉΓòÉΓòÉ
  1336.  
  1337.  
  1338.  
  1339. Figure 4.  Modifies checking. 
  1340.  
  1341.      source 
  1342.      messages 
  1343.  
  1344.   David Evans 
  1345.  Software Devices and Systems 
  1346.  evs@sds.lcs.mit.edu 
  1347.  
  1348.  
  1349. ΓòÉΓòÉΓòÉ 1.4.1.1. modify.c ΓòÉΓòÉΓòÉ
  1350.  
  1351.  
  1352.  
  1353. modify.c 
  1354.  
  1355. void setx (int *x, int *y)
  1356.   /*@modifies *x@*/
  1357. {
  1358.   *y = *x;
  1359. }
  1360.  
  1361. void sety (int *x, int *y)
  1362.    /*@modifies *y@*/
  1363. {
  1364.    setx (y, x);
  1365. }
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427. ΓòÉΓòÉΓòÉ 1.4.1.2. fig4-out.html ΓòÉΓòÉΓòÉ
  1428.  
  1429.  
  1430.  
  1431. LCLint Output 
  1432.  
  1433. LCLint 2.2 --- 25 Aug 96
  1434.  
  1435. modify.c: (in function setx)
  1436. modify.c:4,3: Undocumented modification of *y: *y = *x
  1437.   An externally-visible object is modified by a
  1438.   function, but not listed in its modifies clause.
  1439.   (-mods will suppress message)
  1440. modify.c:5,1: Suspect object listed in modifies of
  1441.                  setx not modified: *x
  1442.   An object listed in the modifies clause is not
  1443.   modified by the implementation of the function. The
  1444.   modification may not be detected if it is done
  1445.   through a call to an unspecified function. (-mustmod
  1446.   will suppress message)
  1447.    modify.c:1,6: Declaration of setx
  1448. modify.c:1,6: Function setx exported but not declared
  1449.                  in header file
  1450.   A declaration is exported, but does not appear in a
  1451.   header file. (-exportheader will suppress message)
  1452.    modify.c:5,1: Definition of setx
  1453. modify.c:7,6: Function sety exported but not declared
  1454.                  in header file
  1455.    modify.c:11,1: Definition of sety
  1456.  
  1457. Finished LCLint checking --- 4 code errors found
  1458.  
  1459.  
  1460. ΓòÉΓòÉΓòÉ 1.4.2. Figure 5.  Globals checking. ΓòÉΓòÉΓòÉ
  1461.  
  1462.  
  1463.  
  1464. Figure 5.  Globals checking. 
  1465.  
  1466.      source 
  1467.      messages 
  1468.  
  1469.   David Evans 
  1470.  Software Devices and Systems 
  1471.  evs@sds.lcs.mit.edu 
  1472.  
  1473.  
  1474. ΓòÉΓòÉΓòÉ 1.4.2.1. globals.c ΓòÉΓòÉΓòÉ
  1475.  
  1476.  
  1477.  
  1478. globals.c 
  1479.  
  1480. int glob1, glob2;
  1481.  
  1482. int f (void) /*@globals glob1;@*/
  1483. {
  1484.    return glob2;
  1485. }
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546. ΓòÉΓòÉΓòÉ 1.4.2.2. fig5-out.html ΓòÉΓòÉΓòÉ
  1547.  
  1548.  
  1549.  
  1550. LCLint Output 
  1551.  
  1552. LCLint 2.2 --- 25 Aug 96
  1553.  
  1554. globals.c: (in function f)
  1555. globals.c:5,11: Undocumented use of global glob2
  1556.   A checked global variable is used in the function,
  1557.   but not listed in its globals clause. By default,
  1558.   only globals specified in .lcl files are checked. To
  1559.   check all globals, use +allglobals. To check globals
  1560.   selectively use /*@checked@*/ in the global
  1561.   declaration. (-globs will suppress message)
  1562. globals.c:3,5: Global glob1 listed but not used
  1563.   A global variable listed in the function's globals
  1564.   list is not used in the body of the function.
  1565.   (-globuse will suppress message)
  1566. globals.c:1,5: Variable glob1 exported but not
  1567.                   declared in header file
  1568.   A variable declaration is exported, but does not
  1569.   appear in a header file. (Used with exportheader.)
  1570.   (-exportheadervar will suppress message)
  1571. globals.c:1,12: Variable glob2 exported but not
  1572.                    declared in header file
  1573. globals.c:3,5: Function f exported but not declared in
  1574.                   header file
  1575.   A declaration is exported, but does not appear in a
  1576.   header file. (-exportheader will suppress message)
  1577.    globals.c:6,1: Definition of f
  1578.  
  1579. Finished LCLint checking --- 5 code errors found
  1580.  
  1581.  
  1582. ΓòÉΓòÉΓòÉ 1.5. LCLint User's Guide - 5. Memory Management ΓòÉΓòÉΓòÉ
  1583.  
  1584.  
  1585.  
  1586.  5. Memory Management 
  1587.  
  1588. About half the bugs in typical C programs can be attributed to memory 
  1589. management problems.  Memory management bugs are notoriously difficult to 
  1590. detect through traditional techniques.  Often, the symptom of the bug is far 
  1591. removed from its actual source.  Memory management bug often only appear 
  1592. sporadically and some bugs may only be apparent when compiler optimizations are 
  1593. turned on or the code is compiled on a different platform.  Run-time tools 
  1594. offer some help, but are cumbersome to use and limited to detecting errors that 
  1595. occur when test cases are run.  By detecting these errors statically, we can be 
  1596. confident that certain types of errors will never occur and provide verified 
  1597. documentation on the memory management behavior of a program. 
  1598.  
  1599. LCLint can detect many memory management errors at compile time including: 
  1600.  
  1601.      using storage that may have been freed (Section 5.2) 
  1602.  
  1603.  
  1604.      failing to deallocate memory (Section 5.2) 
  1605.  
  1606.  
  1607.      returning a pointer to stack-allocated storage (Section 5.2.6) 
  1608.  
  1609.  
  1610.      undocumented or dangerous aliasing or storage sharing (Section 6) 
  1611.  
  1612.  
  1613.      passing or returning storage that is not completely defined (Section 7.1) 
  1614.  
  1615.  
  1616.      dereferencing a null pointers (Section 7.2) 
  1617.  
  1618.  
  1619.   Most of these checks rely heavily on annotations added to programs to 
  1620.  document assumptions related to memory management and pointer values.  By 
  1621.  documenting these assumptions for function interfaces, variables, type 
  1622.  definitions and structure fields, memory management bugs can be detected at 
  1623.  their source -- where an assumption is violated.  In addition, precise 
  1624.  documentation about memory management decisions makes its easier to change 
  1625.  code. 
  1626.  
  1627.   5.1 Storage Model[10] 
  1628.  
  1629.   Yea, from the table of my memory I'll wipe away all trivial fond records, all 
  1630.  saws of books, all forms, all pressures past, that youth and observation 
  1631.  copied there. 
  1632.  - Hamlet prefers garbage collection (Shakespeare, Hamlet. Act I, Scene v) 
  1633.  This section describes execution-time concepts for describing the state of 
  1634.  storage more precisely than can be done using standard C terminology.  Certain 
  1635.  uses of storage are likely to indicate program bugs, and are reported as 
  1636.  anomalies. 
  1637.  
  1638.  LCL assumes a CLU-like object storage model.[11]  An object is a typed region 
  1639.  of storage.  Some objects use a fixed amount of storage that is allocated and 
  1640.  deallocated automatically by the compiler. 
  1641.  
  1642.  Other objects use dynamic storage that must be managed by the program. 
  1643.  
  1644.  Storage is undefined if it has not been assigned a value, and defined after it 
  1645.  has been assigned a value.  An object is completely defined if all storage 
  1646.  that may be reached from it is defined.  What storage is reachable from an 
  1647.  object depends on the type and value of the object.  For example, if p is a 
  1648.  pointer to a structure, p is completely defined if the value of p is NULL, or 
  1649.  if every field of the structure p points to is completely defined. 
  1650.  
  1651.  When an expression is used as the left side of an assignment expression we say 
  1652.  it is used as an lvalue.  Its location in memory is used, but not its value. 
  1653.  Undefined storage may be used as an lvalue since only its location is needed. 
  1654.  When storage is used in any other way, such as on the right side of an 
  1655.  assignment, as an operand to a primitive operator (including the indirection 
  1656.  operator, *),[12] or as a 
  1657.  
  1658.  function parameter, we say it is used as an rvalue.  It is an anomaly to use 
  1659.  undefined storage as an rvalue. 
  1660.  
  1661.  A pointer is a typed memory address.  A pointer is either live or dead.  A 
  1662.  live pointer is either NULL or an address within allocated storage.  A pointer 
  1663.  that points to an object is an object pointer.  A pointer that points inside 
  1664.  an object (e.g., to the third element of an allocated block) is an offset 
  1665.  pointer.  A pointer that points to allocated storage that is not defined is an 
  1666.  allocated pointer.  The result of dereferencing an allocated pointer is 
  1667.  undefined storage.  Hence, it is an anomaly to use it as an rvalue.  A dead 
  1668.  (or "dangling") pointer does not point to allocated storage.  A pointer 
  1669.  becomes dead if the storage it points to is deallocated (e.g., the pointer is 
  1670.  passed to the free library function.)  It is an anomaly to use a dead pointer 
  1671.  as an rvalue. 
  1672.  
  1673.  There is a special object null corresponding to the NULL pointer in a C 
  1674.  program.  A pointer that may have the value NULL is a possibly-null pointer. 
  1675.  It is an anomaly to use a possibly-null pointer where a non-null pointer is 
  1676.  expected (e.g., certain function arguments or the indirection operator). 
  1677.  
  1678.   5.2 Deallocation Errors 
  1679.  
  1680.  There are two kinds of deallocation errors with which we are concerned: 
  1681.  deallocating storage when there are other live references to the same storage, 
  1682.  or failing to deallocate storage before the last  reference to it is lost.  To 
  1683.  handle these deallocation errors, we introduce a concept of an obligation to 
  1684.  release storage.  Every time storage is allocated, it creates an obligation to 
  1685.  release the storage.  This obligation is attached to the reference to which 
  1686.  the storage is assigned.[13]  Before the scope of the reference is exited or 
  1687.  it is assigned to a new value, the storage to which it points must be 
  1688.  released.  Annotations can be used to indicate that this obligation is 
  1689.  transferred through a return value, function parameter or assignment to an 
  1690.  external reference. 
  1691.  
  1692.   5.2.1 Unshared References 
  1693.  
  1694.  `Tis in my memory lock'd, and you yourself shall keep the key of it. 
  1695.  - Ophelia prefers explicit deallocation (Hamlet.  Act I, Scene iii)  The only 
  1696.  annotation is used to indicate a reference is the only pointer to the object 
  1697.  it points to.  We can view the reference as having an obligation to release 
  1698.  this storage.  This obligation is satisfied by transferring it to some other 
  1699.  reference in one of three ways: 
  1700.  
  1701.      pass it as an actual parameter corresponding to a formal parameter 
  1702.       declared with an only annotation 
  1703.      assign it to an external reference declared with an only annotation 
  1704.      return it as a result declared with an only annotation 
  1705.   After the release obligation is transferred, the original reference is a dead 
  1706.  pointer and the storage it points to may not be used. 
  1707.  
  1708.  All obligations to release storage stem from primitive allocation routines 
  1709.  (e.g., malloc), and are ultimately satisfied by calls to free.  The standard 
  1710.  library declared the primitive allocation and deallocation routines. 
  1711.  
  1712.  The basic memory allocator, malloc, is declared:[14] 
  1713.  
  1714.   /*@only@*/ void *malloc (size_t size);
  1715.  It returns an object that is referenced only by the function return value. 
  1716.  
  1717.  The deallocator, free, is declared:[15] 
  1718.  
  1719.   void free (/*@only@*/ void *ptr);
  1720.  
  1721.  The parameter to free must reference an unshared object.  Since the parameter 
  1722.  is declared using only, the caller may not use the referenced object after the 
  1723.  call, and may not pass in a reference to a shared object.  There is nothing 
  1724.  special about malloc and free -- their behavior can be described entirely in 
  1725.  terms of the provided annotations. 
  1726.  
  1727.  Figure 6.  Deallocation errors. 
  1728.  
  1729.  
  1730.  
  1731.   5.2.2 Temporary Parameters 
  1732.  
  1733.  The temp annotation is used to declare a function parameter that is used 
  1734.  temporarily by the function.  An error is reported if the function releases 
  1735.  the storage associated with a temp formal parameter or creates new aliases it 
  1736.  that are visible after the function returns.  Any storage may be passed as a 
  1737.  temp parameter, and it satisfies its original memory constraints after the 
  1738.  function returns. 
  1739.  
  1740.   5.2.3 Owned and Dependent References 
  1741.  
  1742.  In real programs it is sometimes necessary to have storage that is shared 
  1743.  between several possibly references.  The owned and dependent annotations 
  1744.  provide a more flexible way of managing storage, at the cost of less checking. 
  1745.  The owned annotation denotes a reference with an obligation to release 
  1746.  storage. Unlike only, however, other external references marked with dependent 
  1747.  annotations may share this object.  It is up to the programmer to ensure that 
  1748.  the lifetime of a dependent reference is contained within the lifetime of the 
  1749.  corresponding owned reference. 
  1750.  
  1751.   5.2.4 Kept Parameters 
  1752.  
  1753.  The keep annotation is similar to only, except the caller may use the 
  1754.  reference after the call.  The called function must assign the keep parameter 
  1755.  to an only reference, or pass it as a keep parameter to another function.  It 
  1756.  is up to the programmer to make sure that the calling function does not use 
  1757.  this reference after it is released.  The keep annotation is useful for adding 
  1758.  an object to a collection (e.g., a symbol table), where it is known that it 
  1759.  will not be deallocated until the collection is. 
  1760.  
  1761.   5.2.5 Shared References 
  1762.  
  1763.  If LCLint is used to check a program designed to be used in a 
  1764.  garbage-collected environment, there may be storage that is shared by one or 
  1765.  more references and never explicitly released.  The shared annotation declares 
  1766.  storage that may be shared arbitrarily, but never released. 
  1767.  
  1768.   5.2.6 Stack References 
  1769.  
  1770.  Local variables that are not allocated dynamically are store on a call stack. 
  1771.  When a function returns, its stack frame is deallocated, destroying the 
  1772.  storage associated with the function's local variables.  A memory error occurs 
  1773.  if a pointer into this storage is live after the function returns.  LCLint 
  1774.  detects errors involving stack references exported from a function through 
  1775.  return values or assignments to references reachable from global variables or 
  1776.  actual parameters.  No annotations are needed to detect stack reference 
  1777.  errors, since it is clear from a declaration if storage is allocated on the 
  1778.  function stack. 
  1779.  
  1780.  Figure 7.  Stack references. 
  1781.  
  1782.  
  1783.  
  1784.   5.2.7 Inner Storage 
  1785.  
  1786.  An annotation always applies to the outermost level of storage.  For example, 
  1787.  
  1788.   /*@only@*/ int **x;
  1789.  declares x as an unshared pointer to a pointer to an int.  The only annotation 
  1790.  applies to x, but not to *x.  To apply annotations to inner storage a type 
  1791.  definition may be used: 
  1792.  
  1793.     typedef /*@only@*/ int *oip;
  1794.     /*@only@*/ oip *x;
  1795.  Now, x is an only pointer to an oip, which is an only pointer to an int. 
  1796.  
  1797.  When annotations are use in type definitions, they may be overridden in 
  1798.  instance declarations.  For example, 
  1799.  
  1800.   /*@dependent@*/ oip x;
  1801.  makes x a dependent pointer to an int. 
  1802.  
  1803.   5.3 Implicit Memory Annotations 
  1804.  
  1805.  Since it is important that LCLint can check unannotated programs effectively, 
  1806.  the meaning of declarations with no memory annotations is chosen to minimize 
  1807.  the number of annotations needed to get useful checking on an unannotated 
  1808.  program. 
  1809.  
  1810.  An implicit memory management annotation may be assumed for declarations with 
  1811.  no explicit memory management annotation.  Implicit annotations are checked 
  1812.  identically to the corresponding explicit annotation, except error messages 
  1813.  indicate that they result from an implicit annotation. 
  1814.  
  1815.  Unannotated function parameters are assumed to be temp.  This means if memory 
  1816.  checking is turned on for an unannotated program, all functions that release 
  1817.  storage referenced by a parameter or assign a global variable to alias the 
  1818.  storage will produce error messages.  (Controlled by paramimptemp.) 
  1819.  
  1820.  Unannotated return values, structure fields and global variables are assumed 
  1821.  to be only.  With implicit annotations (on by default), turning on memory 
  1822.  checking for an unannotated program will produce errors for any function that 
  1823.  does not return unshared storage or assignment of shared storage to a global 
  1824.  variable or structure field.[16]  (Controlled by retimponly, structimponly and 
  1825.  globimponly .  The codeimponly flag sets all of the implicit only flags.) 
  1826.  
  1827.  Figure 8.  Implicit annotations 
  1828.  
  1829.  
  1830.  
  1831.   5.4 Reference Counting 
  1832.  
  1833.  Another approach to memory management is to add a field to a type to 
  1834.  explicitly keep track of the number of references to that storage.  Every time 
  1835.  a reference is added or lost the reference count is adjusted accordingly;  if 
  1836.  it would become zero, the storage is released.  Reference counting it 
  1837.  difficult to do without automatic checking since it is easy to forget to 
  1838.  increment or decrement the reference count, and exceedingly difficult to track 
  1839.  down these errors. 
  1840.  
  1841.  LCLint supports reference counting by using annotations to constrain the use 
  1842.  of reference counted storage in a manner similar to other memory management 
  1843.  annotations. 
  1844.  
  1845.  A reference counted type is declared using the refcounted annotation.  Only 
  1846.  pointer to struct types may be declared as reference counted, since reference 
  1847.  counted storage must have a field to count the references.  One field in the 
  1848.  structure (or integral type) is preceded by the refs annotation to indicate 
  1849.  that the value of this field is the number of live references to the 
  1850.  structure. 
  1851.  
  1852.  For example (in rstring.h), 
  1853.  
  1854.        typedef /*@abstract@*/ /*@refcounted@*/ struct {
  1855.             /*@refs@*/ int refs;
  1856.           char *contents;
  1857.         } *rstring;
  1858.  declares rstring as an abstract, reference-counted type.  The refs field 
  1859.  counts the number of references and the contents field holds the contents of a 
  1860.  string. 
  1861.  
  1862.  All functions that return refcounted storage must increase the reference count 
  1863.  before returning.  LCLint cannot determine if the reference count was 
  1864.  increased, so any function that directly returns a reference to refcounted 
  1865.  storage will produce an error.  This is avoided, by using a function to return 
  1866.  a new reference (e.g., rstring_ref in Figure 9). 
  1867.  
  1868.  A reference counted type may be passed as a temp or dependent parameter.  It 
  1869.  may not be passed as an only parameter.  Instead, the killref annotation is 
  1870.  used to denote a parameter whose reference is eliminated by the function call. 
  1871.  Like only parameters, an actual parameter corresponding to a killref formal 
  1872.  parameter may not be used in the calling function after the call.  LCLint 
  1873.  checks that the implementation of a function releases all killref parameters, 
  1874.  either by passing them as killref parameters, or assigning or returning them 
  1875.  without increasing the reference count. 
  1876.  
  1877.  Figure 9.  Reference counting. 
  1878.  
  1879.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  1880.  
  1881.   David Evans 
  1882.  Software Devices and Systems 
  1883.  evs@sds.lcs.mit.edu 
  1884.  
  1885.  
  1886. ΓòÉΓòÉΓòÉ 1.5.1. Figure 6.  Deallocation errors. ΓòÉΓòÉΓòÉ
  1887.  
  1888.  
  1889.  
  1890. Figure 6.  Deallocation errors. 
  1891.  
  1892.      source 
  1893.      messages 
  1894.  
  1895.   David Evans 
  1896.  Software Devices and Systems 
  1897.  evs@sds.lcs.mit.edu 
  1898.  
  1899.  
  1900. ΓòÉΓòÉΓòÉ 1.5.1.1. only.c ΓòÉΓòÉΓòÉ
  1901.  
  1902.  
  1903.  
  1904. only.c 
  1905.  
  1906. extern /*@only@*/ int *glob;
  1907.  
  1908. /*@only@*/ int *
  1909.   f (/*@only@*/ int *x, int *y,
  1910.      int *z)
  1911.   /*@globals int *glob;@*/
  1912. {
  1913.   int *m = (int *)
  1914.     malloc (sizeof (int));
  1915.  
  1916.   glob = y;
  1917.   free (x);
  1918.   *m = *x;
  1919.   return z;
  1920. }
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981. ΓòÉΓòÉΓòÉ 1.5.1.2. fig6-out.html ΓòÉΓòÉΓòÉ
  1982.  
  1983.  
  1984.  
  1985. LCLint Output 
  1986.  
  1987. LCLint 2.2 --- 25 Aug 96
  1988.  
  1989. only.c: (in function f)
  1990. only.c:11,3: Only storage glob not released before
  1991.                 assignment: glob = y
  1992.   A memory leak has been detected. Newly-allocated or
  1993.   only-qualified storage is not released before the
  1994.   last reference to it is lost. (-mustfree will
  1995.   suppress message)
  1996.    only.c:1,24: Storage glob becomes only
  1997. only.c:11,3: Implicitly temp storage y assigned to
  1998.                 only: glob = y
  1999.   Temp storage (associated with a formal parameter) is
  2000.   transferred to a non-temporary reference. The
  2001.   storage may be released or new aliases created.
  2002.   (-temptrans will suppress message)
  2003. only.c:13,4: Dereference of possibly null pointer m:
  2004.                 *m
  2005.   A possibly null pointer is dereferenced.  Value is
  2006.   either the result of a function which may return
  2007.   null (in which case, code should check it is not
  2008.   null), or a global, parameter or structure field
  2009.   declared with the null qualifier. (-nullderef will
  2010.   suppress message)
  2011.    only.c:8,12: Storage m may become null
  2012. only.c:13,9: Variable x used after being released
  2013.   Memory is used after it has been released (either by
  2014.   passing as an only param or assigning to and only
  2015.   global. (-usereleased will suppress message)
  2016.    only.c:12,9: Storage x released
  2017. only.c:14,10: Implicitly temp storage z returned as
  2018.                  only: z
  2019. only.c:14,12: Fresh storage m not released before
  2020.                  return
  2021.    only.c:9,27: Fresh storage m allocated
  2022.  
  2023. Finished LCLint checking --- 6 code errors found
  2024.  
  2025.  
  2026. ΓòÉΓòÉΓòÉ 1.5.2. Figure 7.  Stack references. ΓòÉΓòÉΓòÉ
  2027.  
  2028.  
  2029.  
  2030. Figure 7.  Stack references. 
  2031.  
  2032.      source 
  2033.      messages 
  2034.  
  2035.   David Evans 
  2036.  Software Devices and Systems 
  2037.  evs@sds.lcs.mit.edu 
  2038.  
  2039.  
  2040. ΓòÉΓòÉΓòÉ 1.5.2.1. stack.c ΓòÉΓòÉΓòÉ
  2041.  
  2042.  
  2043.  
  2044. stack.c 
  2045.  
  2046. int *glob;
  2047.  
  2048. /*@dependent@*/
  2049. int *f (int **x)
  2050. {
  2051.   int sa[2] = { 0, 1 };
  2052.   int loc = 3;
  2053.  
  2054.   glob = &loc;
  2055.   *x = &sa[0];
  2056.  
  2057.   return &loc;
  2058. }
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120. ΓòÉΓòÉΓòÉ 1.5.2.2. fig7-out.html ΓòÉΓòÉΓòÉ
  2121.  
  2122.  
  2123.  
  2124. LCLint Output 
  2125.  
  2126. LCLint 2.2 --- 25 Aug 96
  2127.  
  2128. stack.c: (in function f)
  2129. stack.c:12,10: Stack-allocated storage &loc reachable
  2130.                   from return value: &loc
  2131.   A stack reference is pointed to by an external
  2132.   reference when the function returns. The
  2133.   stack-allocated storage is destroyed after the call,
  2134.   leaving a dangling reference. (-stackref will
  2135.   suppress message)
  2136. ;stack.c:12,15: Stack-allocated storage *x reachable
  2137.                   from parameter x
  2138.    stack.c:10,3: Storage *x becomes stack
  2139. stack.c:12,15: Stack-allocated storage glob reachable
  2140.                   from global glob
  2141.    stack.c:9,3: Storage glob becomes stack
  2142.  
  2143. Finished LCLint checking --- 3 code errors found
  2144.  
  2145.  
  2146. ΓòÉΓòÉΓòÉ 1.5.3. Figure 8.  Implicit Annotations. ΓòÉΓòÉΓòÉ
  2147.  
  2148.  
  2149.  
  2150. implicit.c 
  2151.  
  2152. typedef struct {
  2153.   /* only */ char *name;  /* implicit only annotation if +structimponly */
  2154.   int val;
  2155. } *rec;
  2156.  
  2157. extern /* only */ rec rec_last ; /* implicit only
  2158. annotation if +globimponly */
  2159.  
  2160. extern /* only */ rec   /* implicit if +retimponly */
  2161.   rec_create (/* temp */ char *name, /* implicit if +paramimptemp */
  2162.               int val);
  2163.  
  2164.  
  2165. ΓòÉΓòÉΓòÉ 1.5.4. Figure 9.  Reference counting. ΓòÉΓòÉΓòÉ
  2166.  
  2167.  
  2168.  
  2169. Figure 9.  Reference counting. 
  2170.  
  2171.      source 
  2172.      messages 
  2173.  
  2174.   David Evans 
  2175.  Software Devices and Systems 
  2176.  evs@sds.lcs.mit.edu 
  2177.  
  2178.  
  2179. ΓòÉΓòÉΓòÉ 1.5.4.1. rstring.c ΓòÉΓòÉΓòÉ
  2180.  
  2181.  
  2182.  
  2183. rstring.c 
  2184.  
  2185. #include "rstring.h"
  2186.  
  2187. static rstring rstring_ref (rstring r)
  2188. {
  2189.   r->refs++;
  2190.   return r;
  2191. }
  2192.  
  2193. rstring rstring_first (rstring r1, rstring r2)
  2194. {
  2195.   if (strcmp (r1->contents, r2->contents) < 0)
  2196. ;    {
  2197.       return r1;
  2198.     }
  2199.   else
  2200.     {
  2201.       return rstring_ref (r2);
  2202.     }
  2203. }
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.  
  2264. ΓòÉΓòÉΓòÉ 1.5.4.1.1. rstring.h ΓòÉΓòÉΓòÉ
  2265.  
  2266.  
  2267.  
  2268. rstring.h 
  2269.  
  2270. typedef /*@abstract@*/ /*@refcounted@*/ struct {
  2271.    /*@refs@*/ int refs;
  2272.    char *contents;
  2273. } *rstring;
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336. ΓòÉΓòÉΓòÉ 1.5.4.2. fig9-out.html ΓòÉΓòÉΓòÉ
  2337.  
  2338.  
  2339.  
  2340. LCLint Output 
  2341.  
  2342. LCLint 2.2 --- 25 Aug 96
  2343.  
  2344. rstring.c: (in function rstring_first)
  2345. rstring.c:13,14: Reference counted storage returned
  2346.     without modifying reference count: r1
  2347.   Reference counted storage is transferred in a way
  2348.   that may not be consistent with the reference count.
  2349.   (-refcounttrans will suppress message)
  2350.  
  2351. Finished LCLint checking --- 1 code error found
  2352.  
  2353.  
  2354. ΓòÉΓòÉΓòÉ 1.6. LCLint User's Guide - 6. Sharing ΓòÉΓòÉΓòÉ
  2355.  
  2356.  
  2357.  
  2358.  6. Sharing 
  2359.  
  2360.  Errors involving unexpected sharing of storage can cause serious problems. 
  2361. Undocumented sharing may lead to unpredictable modifications, and some library 
  2362. calls (e.g., strcpy) have undefined behavior if parameters share storage. 
  2363. Another class of sharing errors occurs when clients of an abstract type may 
  2364. obtain a reference to mutable storage that is part of the abstract 
  2365. representation.  This exposes the representation of the abstract type, since 
  2366. clients may modify an instance of the abstract type indirectly through this 
  2367. shared storage. 
  2368.  
  2369.  
  2370.  
  2371.  6.1 Aliasing 
  2372.  
  2373. LCLint detects errors involving dangerous aliasing of parameters.  Some of 
  2374. these errors are already detected through the standard memory annotations 
  2375. (e.g., only parameters may not be aliases.)  Two additional annotations are 
  2376. provided for constraining aliasing of parameters and return values. 
  2377.  
  2378.  6.1.1 Unique Parameters 
  2379.  
  2380. The unique annotation denotes a parameter that may not be aliased by any other 
  2381. storage reachable from the function implementation -- that is, any storage 
  2382. reachable through the other parameters or global variables used by the 
  2383. function.  The unique annotation places similar constraints on function 
  2384. parameters as the only annotation, but it does not transfer the obligation to 
  2385. release storage. 
  2386.  
  2387. LCLint will report an error if a unique parameter may be aliased by another 
  2388. parameter or global variable. 
  2389.  
  2390.  Figure 10.  Unique parameters. 
  2391.  
  2392.  6.1.2 Returned Parameters 
  2393.  
  2394. LCLint reports an error if a function returns a reference to storage reachable 
  2395. from one of its parameters (if retalias is on) since this may introduce 
  2396. unexpected aliases in the body of the calling function when the result is 
  2397. assigned. 
  2398.  
  2399. The returned annotation denotes a parameter that may be aliased by the return 
  2400. value.  LCLint checks the call assuming the result may be an alias to the 
  2401. returned parameter. Figure 11 shows an example use of a returned annotation. 
  2402.  
  2403.  6.2 Exposure 
  2404.  
  2405. LCLint detects places where the representation of an abstract type is exposed. 
  2406. This occurs if a client has a pointer to storage that is part of the 
  2407. representation of an instance of the abstract type.  The client can then modify 
  2408. or examine the storage this points to, and manipulate the value of the abstract 
  2409. type instance without using its operations. 
  2410.  
  2411. There are three ways a representation may be exposed: 
  2412.  
  2413.    1. Returning (or assigning to a global variable) an object that includes a 
  2414.       pointer to a mutable component of an abstract type representation. 
  2415.       (Controlled by retexpose). 
  2416.    2. Assigning a mutable component of an abstract object to storage reachable 
  2417.       from an actual parameter or a global variable that may be used after the 
  2418.       call. This means the client may manipulate the abstract object using the 
  2419.       actual parameter after the call.  Note that if the corresponding formal 
  2420.       parameter is declared only, the caller may not use the actual parameter 
  2421.       after the call so the representation is not exposed.  (Controlled by 
  2422.       assignexpose). 
  2423.    3. Casting mutable storage to or from an abstract type.  (Controlled by 
  2424.       castexpose). 
  2425.   Annotations may be used to allow exposed storage to be returned safely by 
  2426.  restricting how the caller may use the returned storage. 
  2427.  
  2428.   6.2.1 Read-Only Storage 
  2429.  
  2430.  It is often useful for a function to return a pointer to internal storage (or 
  2431.  a instance of a mutable abstract type) that is intended only as an observer. 
  2432.  The caller may use the result, but should not modify the storage it points to. 
  2433.  For example, consider an naΓòºve implementation of the employee_getName 
  2434.  operation for the abstract employee type: 
  2435.  
  2436.      typedef /*@abstract@*/ struct {
  2437.         char *name;
  2438.         int id;
  2439.      } *employee;
  2440.      ...
  2441.      char *employee_getName (employee e) { return e->name; }
  2442.  LCLint produces a message to indicate that the return value exposes the 
  2443.  representation.  One solution would be to return a fresh copy of e->name. This 
  2444.  is expensive, though, especially if we expect employee_getName is used mainly 
  2445.  just to get a string for searching or printing.  Instead, we could change the 
  2446.  declaration of employee_getName to: 
  2447.  
  2448.   extern /*@observer@*/ char *employee_getName (employee e);
  2449.  Now, the original implementation is correct.  The declaration indicates that 
  2450.  the result may not be modified by the caller, so it is acceptable to return 
  2451.  shared storage.[17]  LCLint checks that the return value is not modified by 
  2452.  the caller.  An error is reported if observer storage is modified directly, 
  2453.  passed as a function parameter that may be modified, assigned to a global 
  2454.  variable or reference derivable from a global variable that is not declared 
  2455.  with an observer annotation, or returned as a function result or a reference 
  2456.  derivable from the function result that is not annotation with an observer 
  2457.  annotation. 
  2458.  
  2459.  String Literals 
  2460.  
  2461.  A program that attempts to modify a string literal has undefined behavior 
  2462.  [ANSI, Section 3.1.4]. This is not enforced by most C compilers, and can lead 
  2463.  to particularly pernicious bugs that only appear when optimizations are turned 
  2464.  on and the compiler attempts to minimize storage for string literals.  LCLint 
  2465.  can be used to check that string literals are not modified, by treating them 
  2466.  as observer storage.  If readonlystrings is on (default in standard mode), 
  2467.  LCLint will report an error if a string literal is modified. 
  2468.  
  2469.   6.2.2 Exposed Storage 
  2470.  
  2471.  Sometimes it is necessary to expose the representation of an abstract type. 
  2472.  This may be evidence of a design flaw, but in some cases is justified for 
  2473.  efficiency reasons.  The exposed annotation denotes storage that is exposed. 
  2474.  It may be used on a return value for results that reference storage internal 
  2475.  to an abstract representation, on a parameter value to indicate a parameter 
  2476.  that may be assigned directly to part of an abstract representation,[18] or on 
  2477.  a field of an abstract representation to indicate that external references to 
  2478.  the storage may exist. An error is reported if exposed storage is released, 
  2479.  but unlike an observer, no error is reported if it is modified. 
  2480.  
  2481.  Figure 12 shows examples of exposure problems detected by LCLint. 
  2482.  
  2483.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  2484.  
  2485.   David Evans 
  2486.  Software Devices and Systems 
  2487.  evs@sds.lcs.mit.edu 
  2488.  
  2489.  
  2490. ΓòÉΓòÉΓòÉ 1.6.1. Figure 10.  Unique parameters. ΓòÉΓòÉΓòÉ
  2491.  
  2492.  
  2493.  
  2494. Figure 10.  Unique parameters. 
  2495.  
  2496.      source 
  2497.      messages 
  2498.  
  2499.   David Evans 
  2500.  Software Devices and Systems 
  2501.  evs@sds.lcs.mit.edu 
  2502.  
  2503.  
  2504. ΓòÉΓòÉΓòÉ 1.6.1.1. unique.c ΓòÉΓòÉΓòÉ
  2505.  
  2506.  
  2507.  
  2508. unique.c 
  2509.  
  2510. # include <string.h>
  2511. ;
  2512. void
  2513. capitalize (/*@out@*/ char *s,
  2514.             char *t)
  2515. {
  2516.   strcpy (s, t);
  2517.   *s = toupper (*s);
  2518. }
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579. ΓòÉΓòÉΓòÉ 1.6.1.2. fig10-out.html ΓòÉΓòÉΓòÉ
  2580.  
  2581.  
  2582.  
  2583. LCLint Output 
  2584.  
  2585. LCLint 2.2 --- 25 Aug 96
  2586.  
  2587. unique.c: (in function capitalize)
  2588. unique.c:7,11: Parameter 1 (s) to function strcpy is
  2589.     declared unique but may be aliased externally by
  2590.     parameter 2 (t)
  2591.   A unique or only parameter may be aliased by some
  2592.   other parameter or visible global. (-mayaliasunique
  2593.   will suppress message)
  2594.  
  2595. Finished LCLint checking --- 1 code error found
  2596.  
  2597.  
  2598. ΓòÉΓòÉΓòÉ 1.6.2. Figure 11.  Returned parameters. ΓòÉΓòÉΓòÉ
  2599.  
  2600.  
  2601.  
  2602. Figure 11.  Returned parameters. 
  2603.  
  2604.      source 
  2605.      messages 
  2606.  
  2607.   David Evans 
  2608.  Software Devices and Systems 
  2609.  evs@sds.lcs.mit.edu 
  2610.  
  2611.  
  2612. ΓòÉΓòÉΓòÉ 1.6.2.1. returned.c ΓòÉΓòÉΓòÉ
  2613.  
  2614.  
  2615.  
  2616. returned.c 
  2617.  
  2618. #include "intSet.h"
  2619.  
  2620. extern intSet intSet_insert
  2621.    (/*@returned@*/ intSet s, int x);
  2622.  
  2623. /*
  2624. ** with returned, no error is reported, since the same
  2625. ** storage is returned from insert, and returned
  2626. ** from intSet_singleton as an implicit only result.
  2627. */
  2628.  
  2629. intSet intSet_singleton (int x)
  2630. {
  2631.    return (intSet_insert (intSet_new (), x));
  2632.  }
  2633.  
  2634. /*
  2635. ** without returned:
  2636. */
  2637.  
  2638. extern intSet intSet_insert2 (intSet s, int x);
  2639.  
  2640. intSet intSet_singleton2 (int x)
  2641. {
  2642.   return (intSet_insert2 (intSet_new (), x));
  2643. }
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704. ΓòÉΓòÉΓòÉ 1.6.2.1.1. intSet.h ΓòÉΓòÉΓòÉ
  2705.  
  2706.  
  2707.  
  2708. intSet.h 
  2709.  
  2710. typedef /*@abstract@*/ struct
  2711. {
  2712.   int nelements;
  2713.   int *elements;
  2714. } *intSet ;
  2715.  
  2716. extern intSet intSet_new (void);
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777. ΓòÉΓòÉΓòÉ 1.6.2.2. fig11-out.html ΓòÉΓòÉΓòÉ
  2778.  
  2779.  
  2780.  
  2781. LCLint Output 
  2782.  
  2783. LCLint 2.2 --- 25 Aug 96
  2784.  
  2785. returned.c: (in function intSet_singleton2)
  2786. returned.c:25,27: New fresh storage passed as
  2787.     implicitly temp (not released): intSet_new()
  2788.   A memory leak has been detected. Newly-allocated or
  2789.   only-qualified storage is not released before the
  2790.   last reference to it is lost. (-mustfree will
  2791.   suppress message)
  2792.  
  2793. Finished LCLint checking --- 1 code error found
  2794.  
  2795.  
  2796. ΓòÉΓòÉΓòÉ 1.6.3. Figure 12.  Exposure checking. ΓòÉΓòÉΓòÉ
  2797.  
  2798.  
  2799.  
  2800. Figure 12.  Exposure checking. 
  2801.  
  2802.      source 
  2803.      messages 
  2804.  
  2805.   David Evans 
  2806.  Software Devices and Systems 
  2807.  evs@sds.lcs.mit.edu 
  2808.  
  2809.  
  2810. ΓòÉΓòÉΓòÉ 1.6.3.1. exposure.c ΓòÉΓòÉΓòÉ
  2811.  
  2812.  
  2813.  
  2814. exposure.c 
  2815.  
  2816. #include "employee.h"
  2817.  
  2818. char *
  2819. employee_getName (employee e)
  2820. {
  2821.   return e->name;
  2822. }
  2823.  
  2824. /*@observer@*/ char *
  2825. employee_obsName (employee e)
  2826. { return e->name; }
  2827.  
  2828. /*@exposed@*/ char *
  2829. employee_exposeName (employee e)
  2830. { return e->name; }
  2831.  
  2832. void
  2833. employee_capName (employee e)
  2834. {
  2835.   char *name;
  2836.  
  2837.   name = employee_obsName (e);
  2838.   *name = toupper (*name);
  2839. }
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858.  
  2859.  
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902. ΓòÉΓòÉΓòÉ 1.6.3.1.1. employee.h ΓòÉΓòÉΓòÉ
  2903.  
  2904.  
  2905.  
  2906. employee.h 
  2907.  
  2908. typedef /*@abstract@*/ struct
  2909. {
  2910.   char *name;
  2911.   int *id;
  2912. } *employee;
  2913.  
  2914.  
  2915.  
  2916.  
  2917.  
  2918.  
  2919.  
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973. ΓòÉΓòÉΓòÉ 1.6.3.2. fig12-out.html ΓòÉΓòÉΓòÉ
  2974.  
  2975.  
  2976.  
  2977. LCLint Output 
  2978.  
  2979. LCLint 2.2 --- 25 Aug 96
  2980.  
  2981. exposure.c: (in function employee_getName)
  2982. exposure.c:6,10: Function returns reference to
  2983.                     parameter e: e->name
  2984.   The returned value shares storage with a parameter
  2985.   or global. If a parameter is to be returned, use the
  2986.   returned qualifier. If the result is not modified,
  2987.   use the observer qualifier on the result type.
  2988.   Otherwise, exposed can be used, but limited checking
  2989.   is done. (-retalias will suppress message)
  2990. exposure.c:6,10: Return value exposes rep of employee:
  2991.                     e->name
  2992.   The return value shares storage with an instance of
  2993.   an abstract type. This means clients may have access
  2994.   to a pointer into the abstract representation. Use
  2995.   the observer qualifier to return exposed storage
  2996.   that may not be modified by the client. Use the
  2997.   exposed qualifier to return modifiable (but not
  2998.   deallocatable) exposed storage (dangerous).
  2999.   (-retexpose will suppress message)
  3000. exposure.c:6,18: Released storage e->name reachable
  3001.                     from parameter at return point
  3002.   Memory is used after it has been released (either by
  3003.   passing as an only param or assigning to and only
  3004.   global. (-usereleased will suppress message)
  3005.    exposure.c:6,10: Storage e->name is released
  3006. exposure.c: (in function employee_capName)
  3007. exposure.c:23,3: Suspect modification of observer
  3008.                     name: *name = toupper(*name)
  3009.   Storage declared with observer is possibly modified.
  3010.   Observer storage may not be modified. (-modobserver
  3011.   will suppress message)
  3012. exposure.c:4,1: Function employee_getName exported but
  3013.                    not declared in header file
  3014.   A declaration is exported, but does not appear in a
  3015.   header file. (-exportheader will suppress message)
  3016.    exposure.c:7,1: Definition of employee_getName
  3017. exposure.c:10,1: Function employee_obsName exported
  3018.                     but not declared in header file
  3019.    exposure.c:11,19: Definition of employee_obsName
  3020. exposure.c:14,1: Function employee_exposeName exported
  3021.                     but not declared in header file
  3022.    exposure.c:15,19: Definition of employee_exposeName
  3023. exposure.c:18,1: Function employee_capName exported
  3024.                     but not declared in header file
  3025.    exposure.c:24,1: Definition of employee_capName
  3026.  
  3027. Finished LCLint checking --- 8 code errors found
  3028.  
  3029.  
  3030. ΓòÉΓòÉΓòÉ 1.7. LCLint User's Guide - 7. Value Constraints ΓòÉΓòÉΓòÉ
  3031.  
  3032.  
  3033.  
  3034.  7. Value Constraints 
  3035.  
  3036. LCLint can be used to constrain values of parameters, function results, global 
  3037. variables, and derived storage such as structure fields.  These constraints are 
  3038. checked at interface points -- where a function is called or returns. Section 
  3039. 7.1 describes how to constrain parameters, return values and structures to 
  3040. detect use before definition errors.  A similar approach is used for 
  3041. restricting the use of possibly null pointers in Section 7.2.  To do both well, 
  3042. and avoid spurious errors, information about when and if a function returns if 
  3043. useful.  Annotations for documenting execution control are described in Section 
  3044. 7.3. 
  3045.  
  3046.  
  3047.  
  3048.  7.1 Use Before Definition 
  3049.  
  3050. Like many static checkers, LCLint detects instances where the value of a 
  3051. location is used before it is defined.  This analysis is done at the procedural 
  3052. level.  If there is a path through the procedure that 
  3053.  
  3054. uses a local variable before it is defined, a use before definition error is 
  3055. reported.  Use before definition checking is controlled by the usedef flag. 
  3056.  
  3057. LCLint can do more checking than standard checkers though, because the 
  3058. annotations can be used to describe what storage must be defined and what 
  3059. storage may be undefined at interface points. Unannotated references are 
  3060. expected to be completely defined at interface points.  This means all storage 
  3061. reachable from a global variable, parameter to a function, or function return 
  3062. value is defined before and after a function call. 
  3063.  
  3064.  7.1.1 Undefined Parameters 
  3065.  
  3066. Sometimes, function parameters or return values are expected to reference 
  3067. undefined or partially defined storage.  For example, a pointer parameter may 
  3068. be intended only as an address to store a result, or a memory allocator may 
  3069. return allocated but undefined storage.  The out annotation denotes a pointer 
  3070. to storage that may be undefined. 
  3071.  
  3072. LCLint does not report an error when a pointer to allocated but undefined 
  3073. storage is passed as an out parameter.  Within the body of a function, LCLint 
  3074. will assume an out parameter is allocated but not necessarily bound to a value, 
  3075. so an error is reported if its value is used before it is defined. 
  3076.  
  3077. LCLint reports an error if storage reachable by the caller after the call is 
  3078. not defined when the function returns.  This can be suppressed by -mustdefine. 
  3079. When checking a call, an actual parameter corresponding to an out parameter is 
  3080. assumed to be completely defined after the call returns. 
  3081.  
  3082. When checking unannotated programs, many spurious use before definition errors 
  3083. may be reported  If impouts is on, no error is reported when an 
  3084. incompletely-defined parameter is passed to a formal parameter with no 
  3085. definition annotation, and the actual parameter is assumed to be defined after 
  3086. the call.  The /*@in@*/ annotation can be used to denote a parameter that must 
  3087. be completely defined, even if impouts is on.  If impouts is off, there is an 
  3088. implicit in annotation on every parameter with no definition annotation. 
  3089.  
  3090. Figure 13.  Use before definition. 
  3091.  
  3092.  7.1.2 Relaxing Checking 
  3093.  
  3094. The reldef annotation relaxes definition checking for a particular declaration. 
  3095. Storage declared with a reldef annotation is assumed to be defined when it is 
  3096. used, but no error is reported if it is not defined before it is returned or 
  3097. passed as a parameter. 
  3098.  
  3099. It is up to the programmer to check reldef fields are used correctly.  They 
  3100. should be avoided in most cases, but may be useful for fields of structures 
  3101. that may or may not be defined depending on other constraints. 
  3102.  
  3103.  7.1.3 Partially Defined Structures 
  3104.  
  3105. The partial annotated can be used to relax checking of structure fields.  A 
  3106. structure with undefined fields may be passed as a partial parameter or 
  3107. returned as a partial result.  Inside a function body, no error is reported 
  3108. when the field of a partial structure is used.  After a call, all fields of a 
  3109. structure that is passed as a partial parameter are assumed to be completely 
  3110. defined. 
  3111.  
  3112.  
  3113.  
  3114.  7.1.4 Global Variables 
  3115.  
  3116. Special annotations can be used in the globals list of a function declaration 
  3117. (Section 4.2) to describe the states of global variables before and after the 
  3118. call. 
  3119.  
  3120. If a global is preceded by undef, it is assumed to be undefined before the 
  3121. call. Thus, no error is reported if the global is not defined when the function 
  3122. is called, but an error is reported if the global is used in the function body 
  3123. before it is defined. 
  3124.  
  3125. The killed annotation denotes a global variable that may be undefined when the 
  3126. call returns.  For globals that contain dynamically allocated storage, a killed 
  3127. global variable is similar to an only parameter (Section 5.2).  An error is 
  3128. reported if it contains the only reference to storage that is not released 
  3129. before the call returns. 
  3130.  
  3131. Figure 14.  Annotated globals lists. 
  3132.  
  3133.  
  3134.  
  3135.  7.2 Null Pointers 
  3136.  
  3137. A common cause of program failures is when a null pointer is dereferenced. 
  3138. LCLint detects these errors by distinguishing possibly NULL pointers at 
  3139. interface boundaries. 
  3140.  
  3141. The null annotation is used to indicate that a pointer value may be NULL.  A 
  3142. pointer declared with no null annotation, may not be NULL.  If null checking is 
  3143. turned on (controlled by null), LCLint will report an error when a possibly 
  3144. null pointer is passed as a parameter, returned as a result, or assigned to an 
  3145. external reference with no null qualifier. 
  3146.  
  3147. If a pointer is declared with the null annotation, the code must check that it 
  3148. is not NULL on all paths leading to the a dereference of the pointer (or the 
  3149. pointer being returned or passed as a value with no null annotation). 
  3150. Dereferences of possibly null pointers may be protected by conditional 
  3151. statements or assertions (to see how assert is declared see Section 7.3) that 
  3152. check the pointer is not NULL. 
  3153.  
  3154. Consider two implementations of firstChar in Figure 15. For firstChar1, LCLint 
  3155. reports an error since the pointer that is dereferenced is declared with a null 
  3156. annotation.  For firstChar2, no error is reported since the true branch of the 
  3157. s == NULL if statement returns, so the dereference of s is only reached if s is 
  3158. not NULL. 
  3159.  
  3160.  
  3161.  
  3162.  7.2.1 Predicate Functions 
  3163.  
  3164. Another way to protect null dereference, is to declare a function using 
  3165. falsenull or truenull and call the function in a conditional statement before 
  3166. the null-annotated pointer is dereferenced.  The falsenull and truenull 
  3167. annotations may only be used on return values for functions that return a 
  3168. boolean[19] result and whose first argument is a possibly null pointer. 
  3169.  
  3170. A function is annotated with truenull is assumed to return TRUE if its first 
  3171. parameter is NULL and FALSE otherwise. For example, if isNull is declared as, 
  3172.  
  3173.    /*@truenull@*/ bool isNull (/*@null@*/ char *x);
  3174. we could write firstChar2: 
  3175.  
  3176.    char firstChar2 (/*@null@*/ char *s)
  3177.    {
  3178.       if (isNull (s)) return '\0';
  3179.       return *s;
  3180.    }
  3181. No error is reported since the dereference of s is only reached if isNull(s) is 
  3182. false, and since isNull is declared with the truenull annotation this means s 
  3183. must not be null. 
  3184.  
  3185. The falsenull annotation is not quite the opposite of truenull.  If a function 
  3186. declared with falsenull returns TRUE, it means its parameter is not NULL.  If 
  3187. it returns FALSE, the parameter may or may not be NULL. 
  3188.  
  3189. For example, we could define isNonEmpty to return TRUE if its parameter is not 
  3190. NULL and has least one character before the NUL terminator: 
  3191.  
  3192.    /*@falsenull@*/ bool isNonEmpty (/*@null@*/ char *x)
  3193.    {
  3194.      return (x != NULL && *x != `\0');
  3195.    }
  3196. LCLint does not check that the implementation of a function declared with 
  3197. falsenull or truenull is consistent with its annotation, but assumes the 
  3198. annotation is correct when code that calls the function is checked. 
  3199.  
  3200.  7.2.2 Overriding Null Types 
  3201.  
  3202. The null annotation may be used in a type definition to indicate that all 
  3203. instances of the type may be NULL.  For declarations of a type declared using 
  3204. null, the null annotation in the type definition may be overridden with 
  3205. notnull. This is particularly useful for parameters to hidden static operations 
  3206. of abstract types where the null test has already been done before the function 
  3207. is called, or function results of the type which are never NULL.  For an 
  3208. abstract type, notnull may not be used for parameters to external functions, 
  3209. since clients should not be aware of when the concrete representation may by 
  3210. NULL.  Parameters to static functions in the implementation module, however, 
  3211. may be declared using notnull, since they may only be called from places where 
  3212. the representation is accessible.  Return values for static or external 
  3213. functions may be declared using notnull. 
  3214.  
  3215. Figure 16.  Using notnull. 
  3216.  
  3217.  
  3218.  
  3219.  7.2.3 Relaxing Null Checking 
  3220.  
  3221. An additional annotation, relnull may be used to relax null checking (relnull 
  3222. is analogous to reldef for definition checking).  No error is reported when a 
  3223. relnull value is dereferenced, or when a possibly null value is assigned to an 
  3224. identifier declared using relnull. 
  3225.  
  3226. This is generally used for structure fields that may or may not be null 
  3227. depending on some other constraint.  LCLint does not report and error when NULL 
  3228. is assigned to a relnull reference, or when a relnull reference is 
  3229. dereferenced.  It is up to the programmer to ensure that this constraint is 
  3230. satisfied before the pointer is dereferenced. 
  3231.  
  3232.  7.3 Execution 
  3233.  
  3234. To detect certain errors and avoid spurious errors, it is important to know 
  3235. something about the control flow behavior of called functions. Without 
  3236. additional information, LCLint assumes that all functions eventually return and 
  3237. execution continues normally at the call site. 
  3238.  
  3239. The exits annotation is used to denote a function that never returns.  For 
  3240. example, 
  3241.  
  3242. extern /*@exits@*/ void fatalerror (/*@observer@*/ char *s);
  3243. declares fatalerror to never return.  This allows LCLint to correctly analyze 
  3244. code like, 
  3245.  
  3246.    if (x == NULL) fatalerror ("Yikes!");
  3247.    *x = 3;
  3248. Other functions may exit, but sometimes (or usually) return normally.  The 
  3249. mayexit annotation denotes a function that may or may not return.  This doesn't 
  3250. help checking much, since LCLint must assume that a function declared with 
  3251. mayexit returns normally when checking the code. 
  3252.  
  3253. To be more precise, the trueexit and falseexit annotations may be used Similar 
  3254. to truenull and falsenull (see Section 7.2.1), trueexit and falseexit mean that 
  3255. a function always exits if the value of its first argument is TRUE or FALSE 
  3256. respectively.  They may be used only on functions whose first argument has a 
  3257. boolean type. 
  3258.  
  3259. A function declared with trueexit must exit if the value of its argument is 
  3260. TRUE, and a function declared with falseexit must exit if the value of its 
  3261. argument is FALSE.  For example, the standard library declares assert as[20]: 
  3262.  
  3263. /*@falseexit@*/ void assert (/*@sef@*/ bool /*@alt int@*/ pred);
  3264. This way, code like, 
  3265.  
  3266.    assert (x != NULL);
  3267.  
  3268.    *x = 3;
  3269. is checked correctly, since the falseexit annotation on assert means the 
  3270. deference of x is not reached is x != NULL is false. 
  3271.  
  3272. 7.4 Special Clauses 
  3273.  
  3274.  Sometimes it is necessary to specify function interfaces at a lower level than 
  3275. is possible with the standard annotations.  For example, if a function defines 
  3276. some fields of a returned structure but does not define all the fields.  The 
  3277. /*@special@*/ annotation is used to mark a parameter, global variable, or 
  3278. return value that is described using special clauses.  The usual implicit 
  3279. definition rules do not apply to a special declaration. 
  3280.  
  3281. Special clauses may be used to constrain the state of a parameter or return 
  3282. value before or after a call.  One or more special clauses may appear in a 
  3283. function declaration, before the modifies or globals clauses.  Special clauses 
  3284. may be listed in any order, but the same special clause should not be used more 
  3285. than once.  Parameters used in special clauses must be annotated with 
  3286. /*@special@*/ in the function header.  In a special clause list, result is used 
  3287. to refer to the return value of the function.  If result appears in a special 
  3288. clause, the function return value must be annotated with /*@special@*/. 
  3289.  
  3290. The following special clauses are used to describe the definition state or 
  3291. parameters before and after the function is called and the return value after 
  3292. the function returns: 
  3293.  
  3294.  /*@uses references@*/ 
  3295.  
  3296. References in the uses clause must be completely defined before the function is 
  3297. called.  They are assumed to be defined at function entrance when the function 
  3298. is checked.  /*@sets references@*/ 
  3299.  
  3300. References in the sets clause must be allocated before the function is called. 
  3301. They are completely defined after the function returns. When the function is 
  3302. checked, they are assumed to be allocated at function entrance and an error is 
  3303. reported if there is a path on which they are not defined before the function 
  3304. returns.  /*@defines references@*/ 
  3305.  
  3306. References in the defines clause must not refer to unshared, allocated storage 
  3307. before the function is called.  They are completely defined after the function 
  3308. returns. When the function is checked, they are assumed to be undefined at 
  3309. function entrance and an error is reported if there is a path on which they are 
  3310. not defined before the function returns.  /*@allocates references@*/ 
  3311.  
  3312. References in the allocates clause must not refer to unshared, allocated 
  3313. storage before the function is called.  They are allocated but not necessarily 
  3314. defined after the function returns. When the function is checked, they are 
  3315. assumed to be undefined at function entrance and an error is reported if there 
  3316. is a path on which they are not allocated before the function returns. 
  3317. /*@releases references@*/ 
  3318.  
  3319. References in the releases clause are deallocated by the function.  They must 
  3320. correspond to storage which could be passed as an only parameter before the 
  3321. function is called, and are dead pointers after the function returns.  When the 
  3322. function is checked, they are assumed to be allocated at function entrance and 
  3323. an error is reported if they refer to live, allocated storage at any return 
  3324. point. 
  3325.  
  3326.  Additional generic special clauses can be used to describe other aspects of 
  3327. the state of inner storage before or after a call.  Generic special clauses 
  3328. have the form state:constraint.  The state is either pre (before the function 
  3329. is called), or post (after the function is called).  The constraint is similar 
  3330. to an annotation.  The following constraints are supported: 
  3331.  
  3332.  
  3333.  
  3334. Aliasing Annotations 
  3335.  
  3336.  pre:only, post:only 
  3337. pre:shared, post:shared 
  3338. pre:owned, post:owned 
  3339. pre:dependent, post:dependent 
  3340.  
  3341. References refer to only, shared, owned or dependent storage before (pre) or 
  3342. after (post) the call. 
  3343.  
  3344. Exposure Annotations 
  3345.  
  3346.  pre:observer, post:observer 
  3347. pre:exposed, post:exposed 
  3348.  
  3349.  References refer to observer or exposed storage before (pre) or after (post) 
  3350. the call. 
  3351.  
  3352. Null State Annotations 
  3353.  
  3354.  pre:isnull, post:isnull 
  3355.  
  3356. References have the value NULL before (pre) or after (post) the call. Note, 
  3357. this is not the same name or meaning as the null annotation (which means the 
  3358. value may be NULL.)  pre:notnull, post:notnull 
  3359.  
  3360. References do not have the value NULL before (pre) or after (post) the call. 
  3361. Some examples of special clauses are shown in Figure 17. The defines clause for 
  3362. record_new indicates that the id field of the structure pointed to by the 
  3363. result is defined, but the name field is not.  So, record_create needs to call 
  3364. record_setName to define the name field.  Similarly, the releases clause for 
  3365. record_clearName indicates that no storage is associated with the name field of 
  3366. its parameter after the return, so no failure to deallocate storage message is 
  3367. produced for the call to free in record_free. 
  3368.  
  3369. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  3370.  
  3371.  David Evans 
  3372. Software Devices and Systems 
  3373. evs@sds.lcs.mit.edu 
  3374.  
  3375.  
  3376. ΓòÉΓòÉΓòÉ 1.7.1. Figure 13.  Use before definition. ΓòÉΓòÉΓòÉ
  3377.  
  3378.  
  3379.  
  3380. Figure 13.  Use before definition. 
  3381.  
  3382.      source 
  3383.      messages 
  3384.  
  3385.   David Evans 
  3386.  Software Devices and Systems 
  3387.  evs@sds.lcs.mit.edu 
  3388.  
  3389.  
  3390. ΓòÉΓòÉΓòÉ 1.7.1.1. usedef.c ΓòÉΓòÉΓòÉ
  3391.  
  3392.  
  3393.  
  3394. usedef.c 
  3395.  
  3396. extern void
  3397.   setVal (/*@out@*/ int *x);
  3398. extern int
  3399.   getVal (/*@in@*/ int *x);
  3400. extern int mysteryVal (int *x);
  3401.  
  3402. int
  3403. dumbfunc (/*@out@*/ int *x, int i)
  3404. {
  3405.   if (i > 3)
  3406. ;    return *x;
  3407.   else if (i > 1)
  3408. ;    return getVal (x);
  3409.   else if (i == 0)
  3410.     return mysteryVal (x);
  3411.   else
  3412.     {
  3413.       setVal (x);
  3414.       return *x;
  3415.     }
  3416. }
  3417.  
  3418.  
  3419. ΓòÉΓòÉΓòÉ 1.7.1.2. fig13-out.html ΓòÉΓòÉΓòÉ
  3420.  
  3421.  
  3422.  
  3423. LCLint Output 
  3424.  
  3425. LCLint 2.2 --- 25 Aug 96
  3426.  
  3427. usedef.c: (in function dumbfunc)
  3428. usedef.c:11,12: Value *x used before definition
  3429.   An rvalue is used that may not be initialized to a
  3430.   value on some execution path. (-usedef will suppress
  3431.   message)
  3432. usedef.c:13,20: Passed storage x not completely
  3433.     defined (*x is undefined): getVal (x)
  3434.   Storage derivable from a parameter, return value or
  3435.   global is not defined. Use /*@out@*/ to denote
  3436.   passed or returned storage which need not be
  3437.   defined. (-compdef will suppress message)
  3438. usedef.c:15,24: Passed storage x not completely
  3439.     defined (*x is undefined): mysteryVal (x)
  3440.  
  3441. Finished LCLint checking --- 3 code errors found
  3442.  
  3443.  
  3444. ΓòÉΓòÉΓòÉ 1.7.2. Figure 14.  Annotated Globals Lists. ΓòÉΓòÉΓòÉ
  3445.  
  3446.  
  3447.  
  3448. Figure 14.  Annotated Globals Lists. 
  3449.  
  3450.      source 
  3451.      messages 
  3452.  
  3453.   David Evans 
  3454.  Software Devices and Systems 
  3455.  evs@sds.lcs.mit.edu 
  3456.  
  3457.  
  3458. ΓòÉΓòÉΓòÉ 1.7.2.1. annotglobs.c ΓòÉΓòÉΓòÉ
  3459.  
  3460.  
  3461.  
  3462. annotglobs.c 
  3463.  
  3464. int globnum;
  3465.  
  3466. struct {
  3467.   char *firstname;
  3468.   char *lastname;
  3469.   int id;
  3470. } globname;
  3471.  
  3472. void
  3473. initialize (/*@only@*/ char *name)
  3474.   /*@globals undef globnum,
  3475.              undef globname @*/
  3476. {
  3477.   globname.id = globnum;
  3478.   globname.lastname = name;
  3479. }
  3480.  
  3481. void finalize (void)
  3482.    /*@globals killed globname@*/
  3483. {
  3484.   free (globname.lastname);
  3485. }
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513.  
  3514.  
  3515.  
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546. ΓòÉΓòÉΓòÉ 1.7.2.2. fig14-out.html ΓòÉΓòÉΓòÉ
  3547.  
  3548.  
  3549.  
  3550. LCLint Output 
  3551.  
  3552. LCLint 2.2 --- 25 Aug 96
  3553.  
  3554. annotglobs.c: (in function initialize)
  3555. annotglobs.c:14,17: Undef global globnum used before
  3556.                        definition
  3557.   An rvalue is used that may not be initialized to a
  3558.   value on some execution path. (-usedef will suppress
  3559.   message)
  3560. annotglobs.c:16,2: Global storage globname contains 1
  3561.     undefined field when call returns: firstname
  3562.   Storage derivable from a parameter, return value or
  3563.   global is not defined. Use /*@out@*/ to denote
  3564.   passed or returned storage which need not be
  3565.   defined. (-compdef will suppress message)
  3566. annotglobs.c: (in function finalize)
  3567. annotglobs.c:22,2: Only storage globname.firstname
  3568.     (type char *) derived from killed global is not
  3569.     released (memory leak)
  3570.   A storage leak due to incomplete deallocation of a
  3571.   structure or deep pointer is suspected. Unshared
  3572.   storage that is reachable from a reference that is
  3573.   being deallocated has not yet been deallocated.
  3574.   LCLint assumes when an object is passed as an out
  3575.   only void pointer that the outer object will be
  3576.   deallocated, but the inner objects will not.
  3577.   (-compdestroy will suppress message)
  3578.  
  3579. Finished LCLint checking --- 3 code errors found
  3580.  
  3581.  
  3582. ΓòÉΓòÉΓòÉ 1.7.3. Figure 15.  Null checking. ΓòÉΓòÉΓòÉ
  3583.  
  3584.  
  3585.  
  3586. Figure 15.  Null checking. 
  3587.  
  3588.      source 
  3589.      messages 
  3590.  
  3591.   David Evans 
  3592.  Software Devices and Systems 
  3593.  evs@sds.lcs.mit.edu 
  3594.  
  3595.  
  3596. ΓòÉΓòÉΓòÉ 1.7.3.1. null.c ΓòÉΓòÉΓòÉ
  3597.  
  3598.  
  3599.  
  3600. null.c 
  3601.  
  3602. char firstChar1 (/*@null@*/ char *s)
  3603. {
  3604.   return *s;
  3605. }
  3606.  
  3607. char firstChar2 (/*@null@*/ char *s)
  3608. {
  3609.   if (s == NULL) return '\0';
  3610.   return *s;
  3611. }
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640.  
  3641.  
  3642.  
  3643.  
  3644.  
  3645.  
  3646.  
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.  
  3657.  
  3658.  
  3659.  
  3660.  
  3661.  
  3662.  
  3663.  
  3664.  
  3665.  
  3666.  
  3667.  
  3668.  
  3669.  
  3670.  
  3671.  
  3672. ΓòÉΓòÉΓòÉ 1.7.3.2. fig15-out.html ΓòÉΓòÉΓòÉ
  3673.  
  3674.  
  3675.  
  3676. LCLint Output 
  3677.  
  3678. LCLint 2.2 --- 25 Aug 96
  3679.  
  3680. null.c: (in function firstChar1)
  3681. null.c:3,11: Dereference of possibly null pointer s:
  3682.                 *s
  3683.   A possibly null pointer is dereferenced.  Value is
  3684.   either the result of a function which may return
  3685.   null (in which case, code should check it is not
  3686.   null), or a global, parameter or structure field
  3687.   declared with the null qualifier. (-nullderef will
  3688.   suppress message)
  3689.    null.c:1,35: Storage s may become null
  3690.  
  3691. Finished LCLint checking --- 1 code error found
  3692.  
  3693.  
  3694. ΓòÉΓòÉΓòÉ 1.7.4. Figure 16.  Using notnull. ΓòÉΓòÉΓòÉ
  3695.  
  3696.  
  3697.  
  3698. Figure 16.  Using notnull. 
  3699.  
  3700.      source 
  3701.      messages 
  3702.  
  3703.   David Evans 
  3704.  Software Devices and Systems 
  3705.  evs@sds.lcs.mit.edu 
  3706.  
  3707.  
  3708. ΓòÉΓòÉΓòÉ 1.7.4.1. mstringnn.c ΓòÉΓòÉΓòÉ
  3709.  
  3710.  
  3711.  
  3712. mstringnn.c 
  3713.  
  3714. typedef /*@abstract@*/ /*@null@*/ char *mstring;
  3715.  
  3716. static mstring mstring_createNew (int x) ;
  3717.  
  3718. mstring mstring_space1 (void)
  3719. {
  3720.   mstring m = mstring_createNew (1);
  3721.  
  3722.   /* error, since m could be NULL */
  3723.   *m = ' '; *(m + 1) = '\0';
  3724.   return m;
  3725. }
  3726.  
  3727. static /*@notnull@*/ mstring mstring_createNewNN (int x) ;
  3728.  
  3729. mstring mstring_space2 (void)
  3730. {
  3731.   mstring m = mstring_createNewNN (1);
  3732.  
  3733.   /* no error, because of notnull annotation */
  3734.   *m = ' '; *(m + 1) = '\0';
  3735.   return m;
  3736. }
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.  
  3772.  
  3773.  
  3774.  
  3775.  
  3776.  
  3777.  
  3778.  
  3779.  
  3780.  
  3781.  
  3782.  
  3783.  
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797. ΓòÉΓòÉΓòÉ 1.7.4.2. fig16-out.html ΓòÉΓòÉΓòÉ
  3798.  
  3799.  
  3800.  
  3801. LCLint Output 
  3802.  
  3803. LCLint 2.2 --- 25 Aug 96
  3804.  
  3805. mstringnn.c: (in function mstring_space1)
  3806. mstringnn.c:10,4: Dereference of possibly null pointer
  3807.                      m: *m
  3808.   A possibly null pointer is dereferenced.  Value is
  3809.   either the result of a function which may return
  3810.   null (in which case, code should check it is not
  3811.   null), or a global, parameter or structure field
  3812.   declared with the null qualifier. (-nullderef will
  3813.   suppress message)
  3814.    mstringnn.c:7,15: Storage m may become null
  3815.  
  3816. Finished LCLint checking --- 1 code error found
  3817.  
  3818.  
  3819. ΓòÉΓòÉΓòÉ 1.8. LCLint User's Guide - 8. Macros ΓòÉΓòÉΓòÉ
  3820.  
  3821.  
  3822.  
  3823.  8. Macros 
  3824.  
  3825. Macros are commonly used in C programs to implement constants or to mimic 
  3826. functions without the overhead of a function call.  Macros that are used to 
  3827. implement functions are a persistent source of bugs in C programs, since they 
  3828. may not behave like the intended function when they are invoked with certain 
  3829. parameters or used in certain syntactic contexts. 
  3830.  
  3831. LCLint eliminates most of the potential problems by detecting macros with 
  3832. dangerous implementations and dangerous macro invocations.  Whether or not a 
  3833. macro definition is checked or expanded normally depends on flag settings and 
  3834. control comments (see Section 8.3).  Stylized macros can also be used to define 
  3835. control structures for iterating through many values (see Section 8.4). 
  3836.  
  3837.  8.1 Constant Macros 
  3838.  
  3839. Macros may be used to implement constants.  To get type-checking for constant 
  3840. macros, use the  constant syntactic comment: 
  3841.  
  3842. /*@constant null char *mstring_undefined@*/
  3843. Declared constants are not expanded and are checked according to the 
  3844. declaration.  A constant with a null annotation may be used as only storage. 
  3845.  
  3846.  8.2 Function-like Macros 
  3847.  
  3848. Using macros to imitate functions is notoriously dangerous.  Consider this 
  3849. broken macro for squaring a number: 
  3850.  
  3851. # define square(x) x * x
  3852. This works fine for a simple invocation like square(i).  It behaves 
  3853. unexpectedly, though, if it is invoked with a parameter that has a side effect. 
  3854.  
  3855. For example, square(i++) expands to i++ * i++.  Not only does this give the 
  3856. incorrect result, it has undefined behavior since the order in which the 
  3857. operands are evaluated is not defined.  (See Section 10.1 for more information 
  3858. on how expressions exhibiting undefined evaluation order behavior are detected 
  3859. by LCLint.)  To correct the problem we either need to rewrite the macro so that 
  3860. its parameter is evaluated exactly once, or prevent clients from invoking the 
  3861. macro with a parameter that has a side-effect. 
  3862.  
  3863. Another possible problem with macros is that they may produce unexpected 
  3864. results because of operator precedence rules.  The invocation, square(i+1) 
  3865. expands to i+1*i+1, which evaluates to i+i+1 instead of the square of i+1.  To 
  3866. ensure the expected behavior, the macro parameter should be enclosed in 
  3867. parentheses where it is used in the macro body. 
  3868.  
  3869. Macros may also behave unexpectedly if they are not syntactically equivalent to 
  3870. an expression.  Consider the macro definition, 
  3871.  
  3872. # define incCounts()  ntotal++; ncurrent++;
  3873. This works fine, unless it is used as a statement.  For example, 
  3874.  
  3875. if (x < 3) incCounts();
  3876. increments ntotal if x < 3 but always increments ncurrent. 
  3877.  
  3878. One solution is to use the comma operator to define the macro: 
  3879.  
  3880. # define incCounts()  (ntotal++, ncurrent++)
  3881. More complicated macros can be written using a do ╨ò while construction: 
  3882.  
  3883.   # define incCounts() \
  3884.      do { ntotal++; ncurrent++; } while (FALSE)
  3885. LCLint detects these pitfalls in macro definitions, and checks that a macro 
  3886. behaves as much like a function as possible.  A client should only be able to 
  3887. tell that a function was implemented by a macro if it attempts to use the macro 
  3888. as a pointer to a function. 
  3889.  
  3890. These checks are done by LCLint on a macro definition corresponding to a 
  3891. function: 
  3892.  
  3893.      Each parameter to a macro (except those declared to be side-effect free, 
  3894.       see Section 8.2.1) must be used exactly once in all possible executions 
  3895.       of the macro, so  side-effecting arguments behave as expected.[21] 
  3896.       (Controlled by macroparams.) 
  3897.      A parameter to a macro may not be used as the left hand side of an 
  3898.       assignment expression or as the operand of an increment or decrement 
  3899.       operator in the macro text, since this produces non-functional behavior. 
  3900.       (Controlled by macroassign.) 
  3901.      Macro parameters must be enclosed in parentheses when they are used in 
  3902.       potentially dangerous contexts.  (Controlled by macroparens.) 
  3903.      A macro definition must be syntactically equivalent to a statement when 
  3904.       it is invoked followed by a semicolon. (Controlled by macrostmt.) 
  3905.      The type of the macro body must match the return type of the 
  3906.       corresponding function.  If the macro is declared with type void, its 
  3907.       body may have any type but the macro value may not be used. 
  3908.      All variables declared in the body of a macro definition must be in the 
  3909.       macro variable namespace, so they do not conflict with variables in the 
  3910.       scope where the macro is invoked (which may be used in the macro 
  3911.       parameters).  By default, the macro namespace is all names prefixed by 
  3912.       m_.  (See Section 9.2 for information on controlling namespaces.) 
  3913.   At the call site, a macro is checked like any other function call. 
  3914.  
  3915.   8.2.1 Side-Effect Free Parameters 
  3916.  
  3917.  Suppose we really do want to implement square as a macro, but want do so in a 
  3918.  safe way.  One way to do this is to require that it is never invoked with a 
  3919.  parameter that has a side-effect.  LCLint will check that this constraint 
  3920.  holds, if the parameter is annotated to be side-effect free.  That is, the 
  3921.  expression corresponding to this parameter must not modify any state, so it 
  3922.  does not matter how many times it is evaluated.  The sef annotation is used to 
  3923.  denote a parameter that may not have any side-effects: 
  3924.  
  3925.      extern int square (/*@sef@*/ int x);
  3926.      # define square(x) ((x) *(x))
  3927.  Now, LCLint will not report an error checking the definition of square even 
  3928.  though x is used more than once. 
  3929.  
  3930.  A message will be reported, however, if square is invoked with a parameter 
  3931.  that has a side-effect. 
  3932.  
  3933.  For the code fragment, 
  3934.  
  3935.   square (i++)
  3936.  LCLint produces the message: 
  3937.  
  3938.      Parameter 1 to square is declared sef, but the argument may modify i: i++
  3939.  It is also an error to pass a non-sef macro parameter as a sef macro parameter 
  3940.  in the body of a macro definition.  For example, 
  3941.  
  3942.      extern int sumsquares (int x, int y);
  3943.      # define sumsquares(x,y) (square(x) + square(y))
  3944.  Although x only appears once in the definition of sumsquares it will be 
  3945.  evaluated twice since square is expanded. LCLint reports an error when a 
  3946.  non-sef macro parameter is passed as a sef parameter. 
  3947.  
  3948.  A parameter may be passed as a sef parameter without an error being reported, 
  3949.  if LCLint can determine that evaluating the parameter has no side-effects. 
  3950.  For function calls, the modifies clause is used to determine if a side-effect 
  3951.  is possible.[22]  To prevent many spurious errors, if the called function has 
  3952.  no modifies clause, LCLint will report an error only if sefuncon is on. 
  3953.  Justifiably paranoid programmers will insist on setting sefuncon on, and will 
  3954.  add modifies clauses to unconstrained functions that are used in sef macro 
  3955.  arguments. 
  3956.  
  3957.   8.2.2 Polymorphism 
  3958.  
  3959.  One problem with our new definition of square is that while the original macro 
  3960.  would work for parameters of any numeric type, LCLint will now report an error 
  3961.  is the new version is used with a non-integer parameter. 
  3962.  
  3963.  We can use the /*@alt type;,+@> syntax to indicate that an alternate type may 
  3964.  be used.  For example, 
  3965.  
  3966.     extern int /*@alt float@*/ square (/*@sef@*/ int /*@alt float@*/ x);
  3967.     # define square(x) ((x) *(x))
  3968.  declares square for both ints and floats. 
  3969.  
  3970.  Alternate types are also useful for declaring functions for which the return 
  3971.  value may be safely ignored (see Section 10.3.2). 
  3972.  
  3973.   8.3 Controlling Macro Checking 
  3974.  
  3975.  By default, LCLint expands macros normally and checks the resulting code after 
  3976.  macros have been expanded.  Flags and control comments may be used to control 
  3977.  which macros are expanded and which are checked as functions or constants. 
  3978.  
  3979.  If  the fcnmacros flag is on, LCLint assumes all macros defined with parameter 
  3980.  lists implement functions and checks them accordingly.  Parameterized macros 
  3981.  are not expanded and are checked as functions with unknown result and 
  3982.  parameter types (or using the types in the prototype, if one is given).  The 
  3983.  analogous flag for macros that define constants is constmacros.  If it is on, 
  3984.  macros with no parameter lists are assumed to be constants, and checked 
  3985.  accordingly.  The allmacros flag sets both fcnmacros and constmacros.  If the 
  3986.  macrofcndecl flag is set, a message reports parameterized macros with no 
  3987.  corresponding function prototype.  If the macroconstdecl flag is set, a 
  3988.  similar message reports macros with no parameters with no corresponding 
  3989.  constant declaration. 
  3990.  
  3991.  The macro checks described in the previous sections make sense only for macros 
  3992.  that are intended to replace functions or constants.  When fcnmacros or 
  3993.  constmacros is on, more general macros need to be marked so they will not be 
  3994.  checked as functions or constants, and will be expanded normally.  Macros 
  3995.  which are not meant to behave like functions should be preceded by the 
  3996.  /*@notfunction@*/ comment.  For example, 
  3997.  
  3998.      /*@notfunction@*/
  3999.      # define forever for(;;)
  4000.  Macros preceded by notfunction are expanded normally before regular checking 
  4001.  is done.  If a macro that is not syntactically equivalent to a statement 
  4002.  without a semi-colon (e.g., a macro which enters a new scope) is not preceded 
  4003.  by notfunction, parse errors may result when fcnmacros or constmacros is on. 
  4004.  
  4005.   8.4 Iterators 
  4006.  
  4007.  It is often useful to be able to execute the same code for many different 
  4008.  values.  For example, we may want to sum all elements in an intSet that 
  4009.  represents a set of integers.  If intSet is an abstract type, there is no easy 
  4010.  way of doing this in a client module without depending on the concrete 
  4011.  representation of the type.  Instead, we could provide such a mechanism as 
  4012.  part of the type's implementation.  We call a mechanism for looping through 
  4013.  many values an iterator. 
  4014.  
  4015.  The C language provides no mechanism for creating user-defined iterators. 
  4016.  LCLint supports a stylized form of iterators declared using syntactic comments 
  4017.  and defined using macros. 
  4018.  
  4019.  Iterator declarations are similar to function declarations except instead of 
  4020.  returning a value, they assign values to their yield parameters in each 
  4021.  iteration.  For example, we could add this iterator declaration to intSet.h: 
  4022.  
  4023.   /*@iter intSet_elements (intSet s, yield int el);@*/
  4024.  The yield annotation means that the variable passed as the second actual 
  4025.  argument is declared as a local variable of type int and assigned a value in 
  4026.  each loop iteration. 
  4027.  
  4028.  Defining Iterators 
  4029.  
  4030.  An iterator is defined using a macro.  Here's one (not particularly efficient) 
  4031.  way of defining intSet_elements: 
  4032.  
  4033.      typedef /*@abstract@*/ struct {
  4034.         int nelements;
  4035.         int *elements;
  4036.      } intSet;
  4037.      ...
  4038.      # define intSet_elements(s,m_el) \
  4039.        { int m_i; \
  4040.          for (m_i = (0); m_i <= ((s)->nelements); m_i++) { \
  4041.              int m_el = (s)->elements[(m_i)];
  4042.  
  4043.      # define end_intSet_elements }}
  4044.  Each time through the loop, the yield parameter m_el is assigned to the next 
  4045.  value.  After all values have been assigned to m_el for one iteration, the 
  4046.  loop terminates.  Variables declared by the iterator macro (including the 
  4047.  yield parameter) are preceded by the macro variable namespace prefix m_ (see 
  4048.  Section 8.2) to avoid conflicts with variables defined in the scope where the 
  4049.  iterator is used. 
  4050.  
  4051.  Using Iterators 
  4052.  
  4053.  The general structure for using an iterator is, 
  4054.  
  4055.  iter (<params>) stmt; end_iter 
  4056.  
  4057.  For example, a client could use intSet_elements to sum the elements of an 
  4058.  intSet: 
  4059.  
  4060.      intSet s;
  4061.      int sum = 0;
  4062.      ...
  4063.      intSet_elements (s, el) {
  4064.         sum += el;
  4065.      } end_intSet_elements;
  4066.  The actual parameter corresponding to a yield parameter, el, is not declared 
  4067.  in the function scope.  Instead, it is declared by the iterator and assigned 
  4068.  to an appropriate value for each iteration. 
  4069.  
  4070.  LCLint will do the following checks for uses of stylized iterators: 
  4071.  
  4072.      An invocation of the iterator iter must be balanced by a corresponding 
  4073.       end, named end_iter. 
  4074.      All actual parameters must be defined, except those corresponding to 
  4075.       yield parameters. 
  4076.      Yield parameters must be new identifiers, not declared in the current 
  4077.       scope or any enclosing scope. 
  4078.   Iterators are a bit awkward to implement, but they enable compact, easily 
  4079.  understood client code.  For abstract collection types, an iterator can be 
  4080.  used to enable clients to operate on elements of the collection without 
  4081.  breaking data abstraction. 
  4082.  
  4083.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4084.  
  4085.   David Evans 
  4086.  Software Devices and Systems 
  4087.  evs@sds.lcs.mit.edu 
  4088.  
  4089.  
  4090. ΓòÉΓòÉΓòÉ 1.9. LCLint User's Guide - 9. Naming Conventions ΓòÉΓòÉΓòÉ
  4091.  
  4092.  
  4093.  
  4094.  9.  Naming Conventions 
  4095.  
  4096. Naming conventions tend to be a religious issue. Generally, it doesn't matter 
  4097. too much what naming convention is followed as long as one is chosen and 
  4098. followed religiously.  There are two kinds of naming conventions supported by 
  4099. LCLint.  Type-based naming conventions (Section 9.1) constrain identifier names 
  4100. according to the abstract types that are accessible where the identifier is 
  4101. defined.  Prefix naming conventions (Section 9.2) constrain the initial 
  4102. characters of identifier names according to what is being declared and its 
  4103. scope.  Naming conventions may be combined or different conventions may be 
  4104. selected for different kinds of identifiers.  In addition, LCLint supports 
  4105. checking that names do not conflict with names reserved for the standard 
  4106. library or implementation (Section 9.3) and that names are sufficiently 
  4107. distinguishable from other names. 
  4108.  
  4109. 9.1 Type-Based Naming Conventions 
  4110.  
  4111. Generic naming conventions constrain valid names of identifiers.  By limiting 
  4112. valid names, namespaces may be preserved and programs may be more easily 
  4113. understood since the name gives clues as to how and where the name is defined 
  4114. and how it should be used. 
  4115.  
  4116. Names may be constrained by the scope of the name (external, file static, 
  4117. internal), the file in which the identifier is defined, the type of the 
  4118. identifier, and global constraints. 
  4119.  
  4120. 9.1.1 Czech Names 
  4121.  
  4122. Of course, this is a complete jumble to the uninitiated, and that's the joke. 
  4123. - Charles Simonyi, on the Hungarian naming convention 
  4124.  
  4125. Czech[23] names denote operations and variables of abstract types by preceding 
  4126. the names by <type>_.  The remainder of the name should begin with a lowercase 
  4127. character, but may use any other character besides the underscore.  Types may 
  4128. be named using any non-underscore characters. 
  4129.  
  4130. The Czech naming convention is selected by the czech flag.  If accessczech is 
  4131. on, a function, variable, constant or iterator named <type>_<name> has access 
  4132. to the abstract type <type>. 
  4133.  
  4134. Reporting of violations of the Czech naming convention is controlled by 
  4135. different flags depending on what is being declared: 
  4136.  
  4137. czechfcns 
  4138.  
  4139. Functions and iterators.  An error is reported for a function name of the form 
  4140. <prefix>_<name> where <prefix> is not the name of an accessible type.  Note 
  4141. that if accessczech is on, a type named <prefix> would be accessible in a 
  4142. function beginning with <prefix>_.  If accessczech is off, an error is reported 
  4143. instead. An error is reported for a function name that does not have an 
  4144. underscore if any abstract types are accessible where the function is defined. 
  4145. czechvars 
  4146. czechconstants 
  4147. czechmacros 
  4148.  
  4149. Variables, constants and expanded macros.  An error is reported if the 
  4150. identifier name starts with <prefix>_ and prefix is not the name of an 
  4151. accessible abstract type, or if an abstract type is accessible and the 
  4152. identifier name does not begin with <type>_ where type is the name of an 
  4153. accessible abstract type.  If accessczech is on, the representation of the type 
  4154. is visible in the constant or variable definition.  czechtypes 
  4155.  
  4156. User-defined types.  An error is reported if a type name includes an underscore 
  4157. character. 
  4158.  
  4159. 9.1.2 Slovak Names 
  4160.  
  4161. Slovak names are similar to Czech names, except they are spelled differently. A 
  4162. Slovak name is of the form <type><Name>.  The type prefix may not use uppercase 
  4163. characters.  The remainder of the name starts with the first uppercase 
  4164. character. 
  4165.  
  4166. The slovak flag selects the Slovak naming convention.  Like Czech names, it may 
  4167. be used with accessslovak to control access to abstract representations. The 
  4168. slovakfcns, slovakvars, slovakconstants, and slovakmacros flags are analogous 
  4169. to the similar Czech flags.  If slovaktype is on, an error is reported if a 
  4170. type name includes an uppercase letter. 
  4171.  
  4172.  9.1.3 Czechoslovak Names 
  4173.  
  4174. Czechoslovak names are a combination of Czech names and Slovak names. 
  4175. Operations may be named either <type>_ followed by any sequence of 
  4176. non-underscore characters, or <type> followed by an uppercase letter and any 
  4177. sequence of characters.  Czechoslovak names have been out of favor since 1993, 
  4178. but may be necessary for checking legacy code. The czechoslovakfcns, 
  4179. czechoslovakvars, czechoslovakmacros, and czechoslovakconstants flags are 
  4180. analogous to the similar Czech flags.  If czechoslovaktype is on, an error is 
  4181. reported if a type name contains either an uppercase letter or an underscore 
  4182. character. 
  4183.  
  4184.  9.2 Namespace Prefixes 
  4185.  
  4186. Another way to restrict names is to constrain the leading character sequences 
  4187. of various kinds of identifiers.  For example, a the names of all user-defined 
  4188. types might begin with "T" followed by an uppercase letter and all file static 
  4189. names begin with an uppercase letter.  This may be useful for enforcing a 
  4190. namespace (e.g., all names exported by the X-windows library should begin with 
  4191. "X") or just making programs easier to understand by establishing an enforced 
  4192. convention.  LCLint can be used to constrain identifiers in this way to detect 
  4193. identifiers inconsistent with prefixes. 
  4194.  
  4195. All namespace flags are of the form, -<context>prefix <string>.  For example, 
  4196. the macro variable namespace restricting identifiers declared in macro bodies 
  4197. to be preceded by "m_" would be selected by -macrovarprefix "m_".  The string 
  4198. may contain regular characters that may appear in a C identifier.  These must 
  4199. match the initial characters of the identifier name.  In addition, special 
  4200. characters (shown in Table 1) can be used to denoted a class of characters.[24] 
  4201. The * character may be used at the end of a prefix string to specify the rest 
  4202. of the identifier is zero or more characters matching the character immediately 
  4203. before the *. For example, the prefix string "T&*" matches "T" or "TWINDOW" but 
  4204. not "Twin". 
  4205.  
  4206. ^    Any uppercase letter, A-Z
  4207. &    Any lowercase letter, a-z
  4208. %    Any character that is not an uppercase letter (allows lowercase
  4209.      letters, digits and underscore)
  4210. ~    Any character that is not a lowercase letter (allows uppercase letters,
  4211.      digits and underscore)
  4212. $    Any letter (a-z, A-Z)
  4213. /    Any letter or digit (A-Z, a-z, 0-9)
  4214. ?    Any character valid in a C identifier
  4215. #    Any digit, 0-9
  4216.  
  4217. Table 1.  Prefix character codes. 
  4218.  
  4219.  Different prefixes can be selected for the following identifier contexts: 
  4220.  
  4221. macrovarprefix 
  4222.  
  4223.  Any variable declared inside a macro body  uncheckedmacroprefix 
  4224.  
  4225.  Any macro that is not checked as a function or constant (see Section 8.4) 
  4226. tagprefix 
  4227.  
  4228. Tags for struct, union and enum declarations  enumprefix 
  4229.  
  4230. Members of enum types  typeprefix 
  4231.  
  4232. Name of a user-defined type  filestaticprefix 
  4233.  
  4234. Any identifier with file static scope  globvarprefix 
  4235.  
  4236. Any variable (not of function type) with global variables scope  externalprefix 
  4237.  
  4238. Any exported identifier 
  4239.  
  4240. If an identifier is in more than one of the namespace contexts, the most 
  4241. specific defined namespace prefix is used (e.g., a global variable is also an 
  4242. exported identifier, so if globalvarprefix is set, it is checked against the 
  4243. variable name; if not, the identifier is checked against the externalprefix.) 
  4244.  
  4245. For each prefix flag, a corresponding flag named <prefixname>exclude controls 
  4246. whether errors are reported if identifiers in a different namespace match the 
  4247. namespace prefix.  For example, if macrovarprefixexclude is on, LCLint checks 
  4248. that no identifier that is not a variable declared inside a macro body uses the 
  4249. macro variable prefix. 
  4250.  
  4251. Here is a (somewhat draconian) sample naming convention: 
  4252.  
  4253. -uncheckedmacroprefix "~*" 
  4254.     unchecked macros have no lowercase letters 
  4255.  -typeprefix "T^&*" 
  4256.  all type typenames begin with T followed by an uppercase letter.  The rest of 
  4257. the name is all lowercase letters. 
  4258. +typeprefixexclude 
  4259. no identifier that does not name a user-defined type may begin with the type 
  4260. name prefix (set above) 
  4261.  -filestaticprefix"^&&&" 
  4262.  file static scope variables begin with an uppercase letter and three lowercase 
  4263. letters 
  4264.  -globvarprefix "G" 
  4265.  all global variables variables start with G 
  4266.  +globvarprefixexclude 
  4267. no identifier that is not a global variable starts with G 
  4268.  
  4269.  
  4270.  
  4271.  9.3 Naming Restrictions 
  4272.  
  4273.  Additional naming restrictions can be used to check that names do no conflict 
  4274. with names reserved for the standard library, and that identifier are 
  4275. sufficiently distinct (either for the compiler and linker, or for the 
  4276. programmer.) Restrictions may be different for names that are needed by the 
  4277. linker (external names) and names that are only needed during compilations 
  4278. (internal names).  Names of non-static functions and global variables are 
  4279. external; all other names are internal. 
  4280.  
  4281.  9.3.1 Reserved Names 
  4282.  
  4283.  Many names are reserved for the implementation and standard library.  A 
  4284. complete list of reserved names can be found in [vdL, p. 126-128] or [ANSI, 
  4285. Section 4].  Some name prefixes such as str followed by a lowercase character 
  4286. are reserved for future library extensions.  Most C compilers do not detect 
  4287. naming conflicts, and they can lead to unpredictable program behavior.  If 
  4288. ansireserved is on, LCLint reports errors for external names that conflict with 
  4289. reserved names.  If ansireservedinternal is on, errors are also reported for 
  4290. internal names. 
  4291.  
  4292.  9.3.2 Distinct Identifiers 
  4293.  
  4294.  The decision to retain the old six-character case-insensitive restriction on 
  4295. significance was most painful. 
  4296. - ANSI C Rationale 
  4297.  
  4298.  LCLint can check that identifiers differ within a given number of characters, 
  4299. optionally ignoring alphabetic case and differences between characters that 
  4300. look similar. The number of significant characters may be different for 
  4301. external and internal names. 
  4302.  
  4303.  Using +distinctexternalnames sets the number of significant characters for 
  4304. external names to six and makes alphabetical case insignificant for external 
  4305. names.  This is the minimum significance acceptable in an ANSI-conforming 
  4306. compiler.  Most modern compilers exceed these minimums (which are particularly 
  4307. hard to follow if one uses the Czech or Slovak naming convention).  The number 
  4308. of significant characters can be changed using the externalnamelength <number> 
  4309. flag.  If externalnamecaseinsensitive is on, alphabetical case is ignored in 
  4310. comparing external names. LCLint reports identifiers that differ only in 
  4311. alphabetic case. 
  4312.  
  4313.  For internal identifiers, a conforming compiler must recognize at least 31 
  4314. characters and treat alphabetical cases distinctly.  Nevertheless, it may still 
  4315. be useful to check that internal names are more distinct then required by the 
  4316. compiler to minimize the likelihood that identifiers are confused in the 
  4317. program.  Analogously to external names, the internalnamelength <number> flag 
  4318. sets the number of significant characters in an internal name and 
  4319. internalnamecaseinsensitive sets the case sensitivity.  The 
  4320. internalnamelookalike flag further restricts distinctions between identifiers. 
  4321. When set, similar-looking characters match -- the lowercase letter "l" matches 
  4322. the uppercase letter "I" and the number "1"; the letter "O" or "o" matches the 
  4323. number "0"; "5" matches "S"; and "2" matches "Z".  Identifiers that are not 
  4324. distinct except for look-alike characters will produce an error message. 
  4325. External names are also internal names, so they must satisfy both the external 
  4326. and internal distinct identifier checks. 
  4327.  
  4328.  Figure 18 illustrates some of the name checking done by LCLint. 
  4329.  
  4330. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4331.  
  4332.  David Evans 
  4333. Software Devices and Systems 
  4334. evs@sds.lcs.mit.edu 
  4335.  
  4336.  
  4337. ΓòÉΓòÉΓòÉ 1.10. LCLint User's Guide - 10. Other Checks ΓòÉΓòÉΓòÉ
  4338.  
  4339.  
  4340.  
  4341.  10. Other Checks 
  4342.  
  4343.  The section describes other errors detected by LCLint that are not directly 
  4344. related to extra information provided in annotations.  Many of the checks are 
  4345. significantly improved, however, because of the extra information that is known 
  4346. about the program. 
  4347.  
  4348.  10.1 Undefined Evaluation Order 
  4349.  
  4350.  The order in which side effects take place in a C program is not entirely 
  4351. defined by the code.  Certain execution points are known as sequence points -- 
  4352. a function call (after the arguments have been evaluated), the end of a full 
  4353. expression (an initializer, expression in an expression statement, the control 
  4354. expression of an if, switch, while or do statement, each expression of a for 
  4355. statement, and the expression in a return statement), and after the first 
  4356. operand or a &&, ||, ? or , operand. 
  4357.  
  4358.  All side effects before a sequence point must be complete before the sequence 
  4359. point, and no evaluations after the sequence point shall have taken place 
  4360. [ANSI, Section 2.1.2.3].  Between sequence points, side effects and evaluations 
  4361. may take place in any order. Hence, the order in which expressions or arguments 
  4362. are evaluated is not specified.  Compilers are free to evaluate function 
  4363. arguments and parts of expressions (that do not contain sequence points) in any 
  4364. order.  The behavior of code that uses a value that is modified by another 
  4365. expression that is not required to be evaluated before or after the other use 
  4366. is undefined. 
  4367.  
  4368.  LCLint detects instances where undetermined order of evaluation produces 
  4369. undefined behavior.  If modifies clauses and globals lists are used, this 
  4370. checking is enabled in expressions involving function calls. Evaluation order 
  4371. checking is controlled by the evalorder flag. 
  4372.  
  4373.  When checking systems without modifies and globals information, evaluation 
  4374. order checking may report errors when unconstrained functions are called in 
  4375. procedure arguments. Since LCLint has no annotations to constrain what these 
  4376. functions may modify, it cannot be guaranteed that the evaluation order is 
  4377. defined if another argument calls an unconstrained function or uses a global 
  4378. variable or storage reachable from a parameter to the unconstrained function. 
  4379. Its best to add modifies and globals clauses to constrain the unconstrained 
  4380. functions in ways that eliminate the possibility of undefined behavior.  For 
  4381. large legacy systems, this may require too much effort.  Instead, the 
  4382. -evalorderuncon flag may be used to prevent reporting of undefined behavior due 
  4383. to the order of evaluation of unconstrained functions. 
  4384.  
  4385. Figure 19.  Evaluation order 
  4386.  
  4387.  
  4388.  
  4389. 10.2 Problematic Control Structures 
  4390.  
  4391.  A number of control structures that are syntactically legal may indicate 
  4392. likely bugs in programs.  LCLint can detect errors involving likely infinite 
  4393. loops (Section 10.2.1), fall through cases and missing cases in switch 
  4394. statements (Section 10.2.2), break statements within deeply nested loops or 
  4395. switches (Section 10.2.3), clauses of if, while or for statements that are 
  4396. empty statements or unblocked single statements (Section 10.2.4) and incomplete 
  4397. if-else logic (Section 10.2.5).  Although any of these may appear in a correct 
  4398. program, depending on the programming style used they may indicate likely bugs 
  4399. or style violations that should be detected and eliminated. 
  4400.  
  4401. 10.2.1 Likely Infinite Loops 
  4402.  
  4403.  LCLint reports an error if it detects a loop that appears to be infinite.  An 
  4404. error is reported for a loop which does not modify any value used in its 
  4405. condition test inside the body of the loop or in the condition test itself. 
  4406. This checking is enhanced by modifies clauses and globals lists since they 
  4407. provide more information about what global variable may be used in the 
  4408. condition test and what values may be modified by function calls in the loop 
  4409. body. 
  4410.  
  4411.  Figure 20 shows examples of infinite loops detected by LCLint. An error is 
  4412. reported for the loop in line 14, since neither of the values used in the loop 
  4413. condition (x directly and glob1 through the call to f) is modified by the body 
  4414. of the loop.  If the declaration of g is changed to include glob1 in the 
  4415. modifies clause no error is reported.  (In this example, if we assume the 
  4416. annotations are correct, then the programmer has probably called the wrong 
  4417. function in the loop body.  This isn't surprising, given the horrible choices 
  4418. of function and variable names!) 
  4419.  
  4420. If an unconstrained function is called within the loop body, LCLint will assume 
  4421. that it modifies a value used in the condition test and not report an infinite 
  4422. loop error, unless infloopsuncon is on.  If infloopsuncon is on, LCLint will 
  4423. report infinite loop errors for loops where there is no explicit modification 
  4424. of a value used in the condition test, but where they may be an undetected 
  4425. modification through a call to an unconstrained function (e.g., line 15 in 
  4426. Figure 20). 
  4427.  
  4428.  
  4429.  
  4430. 10.2.2 Switches 
  4431.  
  4432. The automatic fall-through of C switch statements is almost never the intended 
  4433. behavior.[25]  LCLint detects case statements with code that may fall through 
  4434. to the next case.  The casebreak flag controls reporting of fall through cases. 
  4435. A single fall through case may be marked by preceding the case keyword with 
  4436. /*@fallthrough@*/ to indicate explicitly that execution falls through to this 
  4437. case. 
  4438.  
  4439. For switches on enum types, LCLint reports an error if a member of the 
  4440. enumerator does not appear as a case in the switch body (and there is no 
  4441. default case).  (Controlled by misscase.) 
  4442.  
  4443. An example of switch checking is shown in Figure 21. 
  4444.  
  4445. 10.2.3 Deep Breaks 
  4446.  
  4447. There is no syntax provided by C (other than goto) for breaking out of a nested 
  4448. loop.  All break and continue statements act only on the innermost surrounding 
  4449. loop or switch.  This often leads to serious problems[26] when a programmer 
  4450. intends to break the outer loop or switch instead.  LCLint optionally reports 
  4451. errors for break and continue statements in nested contexts. 
  4452.  
  4453.      break inside a loop (while or for) that is inside a loop.  Controlled by 
  4454.       looploopbreak.  To indicate that a break is inside an inner loop, precede 
  4455.       the break by /*@innerbreak@*/. 
  4456.      break inside a loop that is inside a switch statement.  Controlled by 
  4457.       switchloopbreak.  To mark the break as a loop break, precede the break by 
  4458.       /*@loopbreak@*/. 
  4459.      break inside a switch statement that is inside a loop.  Controlled by 
  4460.       loopswitchbreak.  To mark the break as a switch break, precede the break 
  4461.       by /*@switchbreak@*/. 
  4462.      break inside a switch inside another switch.  Controlled by 
  4463.       switchswitchbreak.  To indicate that the break is for the inner switch, 
  4464.       use /*@innerbreak@*/. 
  4465.   Since continue only makes sense within loops, errors are only reported for 
  4466.  continue statements within nested loops.  (Controlled by looploopcontinue.)  A 
  4467.  safe inner continue may be precede by /*@innercontinue@*/ to suppress error 
  4468.  messages locally. The deepbreak flag sets all nested break and continue 
  4469.  checking flags. 
  4470.  
  4471.  LCLint reports an error if the marker preceding a break is not consistent with 
  4472.  its effect.  An error is reported if innerbreak precedes a break that is not 
  4473.  breaking an inner loop, switchbreak precedes a break that is not breaking a 
  4474.  switch, or loopbreak precedes a break that is not breaking a loop. 
  4475.  
  4476.  10.2.4 Loop and If Bodies 
  4477.  
  4478.  An empty statement after an if, while or for often indicates a potential bug. 
  4479.  A single statement (i.e., not a compound block) after an if, while or for is 
  4480.  not likely to indicate a bug, but make the code harder to read and edit. 
  4481.  LCLint can report errors for if or loop statements with empty bodies or bodies 
  4482.  that are not compound statements.  Separate flags control checking for 
  4483.  statements following an  if, while or for: 
  4484.  
  4485.      [if, while, for] empty -- report errors for empty bodies (e.g., if (x > 
  4486.       3) ;) 
  4487.      [if, while, for] block -- report errors for non-block bodies (e.g., if (x 
  4488.       > 3) x++;) 
  4489.   The if statement checks also apply to the body of the else clause.  An 
  4490.  ifblock error is not reported if the body of the else clause is an if 
  4491.  statement, to allow else if chains. 
  4492.  
  4493.  10.2.5 Complete if-else Logic 
  4494.  
  4495.  Although it may be perfectly reasonable in many contexts, an if-else chain 
  4496.  with no final else may indicate missing logic or forgetting to check error 
  4497.  cases. If elseifcomplete is on, LCLint reports errors when an if statement 
  4498.  that is the body of an else clause does not have a matching else clause.  For 
  4499.  example, the code, 
  4500.  
  4501.      if (x == 0) { return "nil"; }
  4502.      else if (x == 1) { return "many"; }
  4503.  produces an error message since the second if has no matching else branch. 
  4504.  
  4505.  10.3 Suspicious Statements 
  4506.  
  4507.   LCLint detects errors involving statements with no apparent effects (Section 
  4508.  10.3.1) and statements that ignore the result of a called function (Section 
  4509.  10.3.2). 
  4510.  
  4511.  10.3.1 Statements with No Effects 
  4512.  
  4513.   LCLint can report errors for statements that have no effect.  (Controlled by 
  4514.  noeffect.)  Because of modifies clauses, LCLint can detect more errors than 
  4515.  traditional checkers.  Unless the noeffectuncon flag is on, errors are not 
  4516.  reported for statements that involve calls to unconstrained functions since 
  4517.  the unconstrained function may cause a modification. 
  4518.  
  4519.  Figure 22.  Statements with no effect. 
  4520.  
  4521.  
  4522.  
  4523.   10.3.2 Ignored Return Values 
  4524.  
  4525.  LCLint reports an error when a return value is ignored.  Checking may be 
  4526.  controlled based on the type of the return value: retvalint controls reporting 
  4527.  of ignored return values of type int, and retvalbool for return values of type 
  4528.  bool, and retvalothers for all other types.  A function statement may be cast 
  4529.  to void to prevent this error from being reported. 
  4530.  
  4531.  Alternate types (Section 8.2.2) can be used to declare functions that return 
  4532.  values that may safely be ignored by declaring the result type to alternately 
  4533.  by void.  Several functions in the standard library are specified to 
  4534.  alternately return void to prevent ignored return value errors for standard 
  4535.  library functions (e.g., strcpy) where the result may be safely ignored (see 
  4536.  Apppendix F). 
  4537.  
  4538.  Figure 23 shows example of ignored return value errors reported by LCLint. 
  4539.  
  4540.  
  4541.  
  4542.  10.4 Unused Declarations 
  4543.  
  4544.  LCLint detects constants, functions, parameters, variables, types, enumerator 
  4545.  members, and structure or union fields that are declared but never used.  The 
  4546.  flags constuse, fcnuse, paramuse, varuse, typeuse, enummemuse and fielduse 
  4547.  control whether unused declaration errors are reported for each kind of 
  4548.  declaration. Errors for exported declarations are reported only if topuse is 
  4549.  on (see Section 10.5). 
  4550.  
  4551.  The /*@unused@*/ annotation can be used before a declaration to indicate that 
  4552.  the item declared need not be used.  Unused declaration errors are not 
  4553.  reported for identifiers declared with unused. 
  4554.  
  4555.   10.5 Complete Programs 
  4556.  
  4557.  LCLint can be used on both complete and partial programs.  When checking 
  4558.  complete programs, additional checks can be done to ensure that every 
  4559.  identifier declared by the program is defined and used, and that functions 
  4560.  that do not need to be exported are declared static. 
  4561.  
  4562.  LCLint checks that all declared variables and functions are defined 
  4563.  (controlled by compdef). Declarations of functions and variables that are 
  4564.  defined in an external library, may be preceded by /*@external@*/ to suppress 
  4565.  undefined declaration errors. 
  4566.  
  4567.  LCLint reports external declarations which are unused (Controlled by topuse). 
  4568.  Which declarations are reported also depends on the declaration use flags (see 
  4569.  Section 10.4). 
  4570.  
  4571.  The partial flag sets flags for checking a partial system.  Top-level unused 
  4572.  declarations, undefined declarations, and unnecessary external names are not 
  4573.  reported if partial is set. 
  4574.  
  4575.   10.5.1 Unnecessary External Names 
  4576.  
  4577.  LCLint can report variables and functions that are declared with global scope 
  4578.  (i.e., without using static), that are not used outside the file in which they 
  4579.  are defined.  In a stand-alone system, these identifiers should usually be 
  4580.  declared using static to limit their scope.  If the exportstatic flag is on, 
  4581.  LCLint will report declarations that could have file scope.  It should only be 
  4582.  used when all relevant source files are listed on the LCLint command line; 
  4583.  otherwise, variables and functions may be incorrectly identified as only used 
  4584.  in the file scope since LCLint did not process the other file in which they 
  4585.  are used. 
  4586.  
  4587.   10.5.2 Declarations Missing from Headers 
  4588.  
  4589.  A common practice in C programming styles, is that every function or variable 
  4590.  exported by M.c is declared in M.h.  If the exportheader flag is on, LCLint 
  4591.  will report exported declarations in M.c  that are not declared in M.h. 
  4592.  
  4593.  
  4594.  
  4595.   10.6 Compiler Limits 
  4596.  
  4597.  The ANSI Standard includes limits on minimum numbers that a conforming 
  4598.  compiler must support.  Whether of not a particular compiler exceeds these 
  4599.  limits, it is worth checking that a program does not exceed them so that it 
  4600.  may be safely compiled by other compilers.  In addition, exceeding a limit may 
  4601.  indicate a problem in the code (e.g., it is too complex if the control nest 
  4602.  depth limit is exceeded) that should be fixed regardless of the compiler.  The 
  4603.  following limits are checked by LCLint.  For each  limit, the maximum value 
  4604.  may be set from the command line (or locally using a stylized comment).  If 
  4605.  the ansilimits flag is on, all limits are checked with the minimum values of a 
  4606.  conforming compiler. 
  4607.  
  4608.  includenest 
  4609.  
  4610.  Maximum nesting depth of file inclusion (#include).  (ANSI minimum is 8) 
  4611.  controlnestdepth 
  4612.  
  4613.  Maximum nesting of compound statements, control structures.  (ANSI minimum is 
  4614.  15)  numenummembers 
  4615.  
  4616.  Number of members in an enum declaration. (ANSI minimum is 127) 
  4617.  numstructfields 
  4618.  
  4619.  Number of fields in a struct or union declaration. (ANSI minimum is 127) 
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.  Since human beings themselves are not fully debugged yet, there will be bugs 
  4628.  in your code no matter what you do. 
  4629.  - Chris Mason, Zero-defects  memo (Microsoft Secrets, Cusumano and Selby) 
  4630.  
  4631.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4632.  
  4633.   David Evans 
  4634.  Software Devices and Systems 
  4635.  evs@sds.lcs.mit.edu 
  4636.  
  4637.  
  4638. ΓòÉΓòÉΓòÉ 1.10.1. Figure 19.  Evaluation Order ΓòÉΓòÉΓòÉ
  4639.  
  4640.  
  4641.  
  4642. Figure 19.  Evaluation Order 
  4643.  
  4644.      source 
  4645.      messages 
  4646.  
  4647.   David Evans 
  4648.  Software Devices and Systems 
  4649.  evs@sds.lcs.mit.edu 
  4650.  
  4651.  
  4652. ΓòÉΓòÉΓòÉ 1.10.1.1. order.c ΓòÉΓòÉΓòÉ
  4653.  
  4654.  
  4655.  
  4656. order.c 
  4657.  
  4658. extern int glob;
  4659.  
  4660. extern int mystery (void);
  4661.  
  4662. extern int modglob (void)
  4663.    /*@globals glob@*/
  4664.    /*@modifies glob@*/ ;
  4665.  
  4666. int f (int x, int y[])
  4667. {
  4668.   int i = x++ * x;
  4669.  
  4670.   y[i] = i++;
  4671.   i += modglob() * glob;
  4672.   i += mystery() * glob;
  4673.   return i;
  4674. }
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.  
  4696.  
  4697.  
  4698.  
  4699.  
  4700.  
  4701.  
  4702.  
  4703.  
  4704.  
  4705.  
  4706.  
  4707.  
  4708.  
  4709.  
  4710.  
  4711.  
  4712.  
  4713.  
  4714.  
  4715.  
  4716.  
  4717.  
  4718.  
  4719.  
  4720.  
  4721.  
  4722.  
  4723.  
  4724.  
  4725.  
  4726.  
  4727.  
  4728.  
  4729.  
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735. ΓòÉΓòÉΓòÉ 1.10.1.2. fig19-out.html ΓòÉΓòÉΓòÉ
  4736.  
  4737.  
  4738.  
  4739. LCLint Output 
  4740.  
  4741. LCLint 2.2 --- 25 Aug 96
  4742.  
  4743. order.c: (in function f)
  4744. order.c:11,17: Expression has undefined behavior
  4745.     (value of right operand modified by left operand):
  4746.     x++ * x
  4747.   Code has unspecified behavior. Order of evaluation
  4748.   of function parameters or subexpressions is not
  4749.   defined, so if a value is used and modified in
  4750.   different places not separated by a sequence point
  4751.   constraining evaluation order, then the result of
  4752.   the expression is unspecified. (-evalorder will
  4753.   suppress message)
  4754. order.c:13,11: Expression has undefined behavior (left
  4755.     operand uses i, modified by right operand):
  4756.     y[i] = i++
  4757. order.c:14,20: Expression has undefined behavior
  4758.     (value of right operand modified by left operand):
  4759.     modglob() * glob
  4760. order.c:15,20: Expression has undefined behavior
  4761.     (unconstrained function mystery used in left
  4762.     operand may set global variable glob used in right
  4763.     operand): mystery() * glob
  4764.   Code involving a call to function with no modifies
  4765.   or globals clause may have undefined or
  4766.   implementation-dependent behavior (LCLint assumes
  4767.   the unconstrained call may modify any reachable
  4768.   state or use any global). Add a specification for
  4769.   the function. (-evalorderuncon will suppress
  4770.   message)
  4771.  
  4772. Finished LCLint checking --- 4 code errors found
  4773.  
  4774.  
  4775. ΓòÉΓòÉΓòÉ 1.10.2. Figure 20.  Infinite loop checking ΓòÉΓòÉΓòÉ
  4776.  
  4777.  
  4778.  
  4779. Figure 20.  Infinite loop checking 
  4780.  
  4781.      source 
  4782.      messages 
  4783.  
  4784.   David Evans 
  4785.  Software Devices and Systems 
  4786.  evs@sds.lcs.mit.edu 
  4787.  
  4788.  
  4789. ΓòÉΓòÉΓòÉ 1.10.2.1. loop.c ΓòÉΓòÉΓòÉ
  4790.  
  4791.  
  4792.  
  4793. loop.c 
  4794.  
  4795. extern int glob1, glob2;
  4796.  
  4797. extern int f (void)
  4798.   /*@globals glob1@*/
  4799.   /*@modifies nothing@*/ ;
  4800.  
  4801. extern void g (void)
  4802.   /*@modifies glob2@*/ ;
  4803.  
  4804. extern void h (void) ;
  4805.  
  4806. void upto (int x)
  4807. {
  4808.   while (x > f()) g();
  4809.   while (f() < 3) h();
  4810. }
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.  
  4824.  
  4825.  
  4826.  
  4827.  
  4828.  
  4829.  
  4830.  
  4831.  
  4832.  
  4833.  
  4834.  
  4835.  
  4836.  
  4837.  
  4838.  
  4839.  
  4840.  
  4841.  
  4842.  
  4843.  
  4844.  
  4845.  
  4846.  
  4847.  
  4848.  
  4849.  
  4850.  
  4851.  
  4852.  
  4853.  
  4854.  
  4855.  
  4856.  
  4857.  
  4858.  
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871. ΓòÉΓòÉΓòÉ 1.10.2.2. fig20-out.html ΓòÉΓòÉΓòÉ
  4872.  
  4873.  
  4874.  
  4875. LCLint Output 
  4876.  
  4877. LCLint 2.2 --- 25 Aug 96
  4878.  
  4879. loop.c: (in function upto)
  4880. loop.c:14,10: Suspected infinite loop.  No value used
  4881.     in loop test (x, glob1) is modified by test or
  4882.     loop body.
  4883.   This appears to be an infinite loop. Nothing in the
  4884.   body of the loop or the loop test modifies the value
  4885.   of the loop test. Perhaps the specification of a
  4886.   function called in the loop body is missing a
  4887.   modification. (-infloops will suppress message)
  4888.  
  4889. Finished LCLint checking --- 1 code error found
  4890.  
  4891.  
  4892. ΓòÉΓòÉΓòÉ 1.10.3. Figure 21.  Switch checking. ΓòÉΓòÉΓòÉ
  4893.  
  4894.  
  4895.  
  4896. Figure 21.  Switch checking. 
  4897.  
  4898.      source 
  4899.      messages 
  4900.  
  4901.   David Evans 
  4902.  Software Devices and Systems 
  4903.  evs@sds.lcs.mit.edu 
  4904.  
  4905.  
  4906. ΓòÉΓòÉΓòÉ 1.10.3.1. switch.c ΓòÉΓòÉΓòÉ
  4907.  
  4908.  
  4909.  
  4910. switch.c 
  4911.  
  4912. typedef enum {
  4913.   YES, NO, DEFINITELY,
  4914.   PROBABLY, MAYBE } ynm;
  4915.  
  4916. void decide (ynm y)
  4917. {
  4918.   switch (y)
  4919.     {
  4920.     case PROBABLY:
  4921.     case NO: printf ("No!");
  4922.     case MAYBE: printf ("Maybe");
  4923.          /*@fallthrough@*/
  4924.     case YES: printf ("Yes!");
  4925.     }
  4926. }
  4927.  
  4928.  
  4929.  
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.  
  4958.  
  4959.  
  4960.  
  4961.  
  4962.  
  4963.  
  4964.  
  4965.  
  4966.  
  4967.  
  4968.  
  4969.  
  4970.  
  4971.  
  4972.  
  4973.  
  4974.  
  4975.  
  4976.  
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.  
  4984.  
  4985.  
  4986.  
  4987. ΓòÉΓòÉΓòÉ 1.10.3.2. fig21-out.html ΓòÉΓòÉΓòÉ
  4988.  
  4989.  
  4990.  
  4991. LCLint Output 
  4992.  
  4993. LCLint 2.2 --- 25 Aug 96
  4994.  
  4995. noeffect.c: (in function noeffect)
  4996. noeffect.c:6,3: Statement has no effect: y == *x
  4997.   Statement has no visible effect --- no values are
  4998.   modified. (-noeffect will suppress message)
  4999. noeffect.c:7,3: Statement has no effect: nomodcall(x)
  5000. noeffect.c:8,3: Statement has no effect (possible
  5001.     undected modification through call to
  5002.     unconstrained function mysterycall):
  5003.     mysterycall(x)
  5004.   Statement has no visible effect --- no values are
  5005.   modified. It may modify something through a call to
  5006.   an unconstrained function. (-noeffectuncon will
  5007.   suppress message)
  5008.  
  5009. Finished LCLint checking --- 3 code errors found
  5010.  
  5011.  
  5012. ΓòÉΓòÉΓòÉ 1.10.3.2.1. noeffect.c ΓòÉΓòÉΓòÉ
  5013.  
  5014.  
  5015.  
  5016. noeffect.c 
  5017.  
  5018. extern void nomodcall (int *x) /*@*/;
  5019. extern void mysterycall (int *x);
  5020.  
  5021. int noeffect (int *x, int y)
  5022. {
  5023.   y == *x;
  5024.   nomodcall (x);
  5025.   mysterycall (x);
  5026.   return *x;
  5027. }
  5028.  
  5029.  
  5030.  
  5031.  
  5032.  
  5033.  
  5034.  
  5035.  
  5036.  
  5037.  
  5038.  
  5039.  
  5040.  
  5041.  
  5042.  
  5043.  
  5044.  
  5045.  
  5046.  
  5047.  
  5048.  
  5049.  
  5050.  
  5051.  
  5052.  
  5053.  
  5054.  
  5055.  
  5056.  
  5057.  
  5058.  
  5059.  
  5060.  
  5061.  
  5062.  
  5063.  
  5064.  
  5065.  
  5066.  
  5067.  
  5068.  
  5069.  
  5070.  
  5071.  
  5072.  
  5073.  
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088. ΓòÉΓòÉΓòÉ 1.10.4. Figure 22.  Statements with no effect. ΓòÉΓòÉΓòÉ
  5089.  
  5090.  
  5091.  
  5092. Figure 22.  Statements with no effect. 
  5093.  
  5094.      source 
  5095.      messages 
  5096.  
  5097.   David Evans 
  5098.  Software Devices and Systems 
  5099.  evs@sds.lcs.mit.edu 
  5100.  
  5101.  
  5102. ΓòÉΓòÉΓòÉ 1.10.4.1. fig22-out.html ΓòÉΓòÉΓòÉ
  5103.  
  5104.  
  5105.  
  5106. LCLint Output 
  5107.  
  5108. LCLint 2.2 --- 25 Aug 96
  5109.  
  5110. noeffect.c: (in function noeffect)
  5111. noeffect.c:6,3: Statement has no effect: y == *x
  5112.   Statement has no visible effect --- no values are
  5113.   modified. (-noeffect will suppress message)
  5114. noeffect.c:7,3: Statement has no effect: nomodcall(x)
  5115. noeffect.c:8,3: Statement has no effect (possible
  5116.     undected modification through call to
  5117.     unconstrained function mysterycall):
  5118.     mysterycall(x)
  5119.   Statement has no visible effect --- no values are
  5120.   modified. It may modify something through a call to
  5121.   an unconstrained function. (-noeffectuncon will
  5122.   suppress message)
  5123.  
  5124. Finished LCLint checking --- 3 code errors found
  5125.  
  5126.  
  5127. ΓòÉΓòÉΓòÉ 1.10.5. Figure 23.  Ignored return values. ΓòÉΓòÉΓòÉ
  5128.  
  5129.  
  5130.  
  5131. Figure 23.  Ignored return values. 
  5132.  
  5133.      source 
  5134.      messages 
  5135.  
  5136.   David Evans 
  5137.  Software Devices and Systems 
  5138.  evs@sds.lcs.mit.edu 
  5139.  
  5140.  
  5141. ΓòÉΓòÉΓòÉ 1.10.5.1. ignore.c ΓòÉΓòÉΓòÉ
  5142.  
  5143.  
  5144.  
  5145. ignore.c 
  5146.  
  5147. extern int fi (void);
  5148. extern bool fb (void);
  5149. extern int /*@alt void@*/
  5150.   fv (void);
  5151.  
  5152. int ignore (void)
  5153. {
  5154.   fi ();
  5155.   (void) fi ();
  5156.   fb ();
  5157.   fv ();
  5158.   return fv ();
  5159. }
  5160.  
  5161.  
  5162.  
  5163.  
  5164.  
  5165.  
  5166.  
  5167.  
  5168.  
  5169.  
  5170.  
  5171.  
  5172.  
  5173.  
  5174.  
  5175.  
  5176.  
  5177.  
  5178.  
  5179.  
  5180.  
  5181.  
  5182.  
  5183.  
  5184.  
  5185.  
  5186.  
  5187.  
  5188.  
  5189.  
  5190.  
  5191.  
  5192.  
  5193.  
  5194.  
  5195.  
  5196.  
  5197.  
  5198.  
  5199.  
  5200.  
  5201.  
  5202.  
  5203.  
  5204.  
  5205.  
  5206.  
  5207.  
  5208.  
  5209.  
  5210.  
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220. ΓòÉΓòÉΓòÉ 1.10.5.2. fig23-out.html ΓòÉΓòÉΓòÉ
  5221.  
  5222.  
  5223.  
  5224. LCLint Output 
  5225.  
  5226. LCLint 2.0 --- 28 Feb 96
  5227.  
  5228. ignore.c: (in function ignore)
  5229. ignore.c:8,3: Return value (type int) ignored: fi()
  5230.   Result returned by function call is not used.  If
  5231.   this is intended, can cast result to (void) to
  5232.   eliminate message.  Use -retvalint to suppress
  5233.   message.
  5234. ignore.c:10,3: Return value (type bool) ignored: fb()
  5235.   Result returned by function call is not used.  If
  5236.   this is intended, can cast result to (void) to
  5237.   eliminate message.  Use -retvalbool to suppress
  5238.   message.
  5239.  
  5240. Finished LCLint checking --- 2 code errors found
  5241.  
  5242.  
  5243. ΓòÉΓòÉΓòÉ 1.11. LCLint User's Guide - Appendix A  Availability ΓòÉΓòÉΓòÉ
  5244.  
  5245.  
  5246.  
  5247. Appendix A  Availability 
  5248.  
  5249.  
  5250.  
  5251. The web home page for LCLint is http://www.sds.lcs.mit.edu/lclint/index.html. 
  5252.  
  5253. LCLint can be downloaded from http://www.sds.lcs.mit.edu/lclint/download.html 
  5254. or obtained via anonymous ftp from ftp://ftp.sds.lcs.mit.edu/pub/lclint/ 
  5255.  
  5256. Several UNIX platforms are supported and source code is provided for other 
  5257. platforms. 
  5258.  
  5259. LCLint can also be run remotely using a form at 
  5260. http://www.sds.lcs.mit.edu/lclint/run.html 
  5261.  
  5262. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  5263.  
  5264.  David Evans 
  5265. Software Devices and Systems 
  5266. evs@sds.lcs.mit.edu 
  5267.  
  5268.  
  5269. ΓòÉΓòÉΓòÉ 1.11.1. run.html ΓòÉΓòÉΓòÉ
  5270.  
  5271.  
  5272. ΓòÉΓòÉΓòÉ 1.12. LCLint User's Guide - Appendix B  Communication ΓòÉΓòÉΓòÉ
  5273.  
  5274.  
  5275.  
  5276. Appendix B  Communication 
  5277.  
  5278. LCLint development is largely driven by suggestions and comments from users. 
  5279. We are also very interested in hearing about your experiences using LCLint in 
  5280. developing or maintaining programs, enforcing coding standards, or teaching 
  5281. courses.  For general information, suggestions, and questions on LCLint send 
  5282. mail to lclint@sds.lcs.mit.edu. 
  5283.  
  5284. To report a bug in LCLint send a message to lclint-bug@sds.lcs.mit.edu. 
  5285.  
  5286. There are two mailing lists associated with LCLint: 
  5287.  
  5288. lclint-announce@sds.lcs.mit.edu 
  5289.  
  5290. Reserved for announcements of new releases and bug fixes.  (Everyone who sends 
  5291. mail regarding LCLint is added to this list.)  lclint-interest@sds.lcs.mit.edu 
  5292.  
  5293. Informal discussions on the use and development of LCLint.  To subscribe, send 
  5294. a (human-readable) message to lclint-request@sds.lcs.mit.edu, or use a form. 
  5295.  
  5296. LCLint discussions relating to checks enabled by specifications or annotations 
  5297. are welcome in the comp.specification.larch  usenet group.  Messages more 
  5298. focused on C-specific checking would be more appropriate for the 
  5299. lclint-interest list of one of the C language groups. 
  5300.  
  5301. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  5302.  
  5303.  David Evans 
  5304. Software Devices and Systems 
  5305. evs@sds.lcs.mit.edu 
  5306.  
  5307.  
  5308. ΓòÉΓòÉΓòÉ 1.13. LCLint User's Guide - Appendix C  Flags ΓòÉΓòÉΓòÉ
  5309.  
  5310.  
  5311.  
  5312. Appendix C  Flags 
  5313.  
  5314.  Flags can be grouped into four major categories: 
  5315.  
  5316.      Global flags for controlling initializations and global behavior 
  5317.      Message format flags for controlling how messages are displayed 
  5318.      Mode selectors for coarse control of LCLint checking 
  5319.      Checking flags that control checking and what classes of     messages are 
  5320.       reported 
  5321.   Global flags can be used in initialization files and at the command line; all 
  5322.  other flags may also be used in control comments. 
  5323.  
  5324.  Global Flags 
  5325.  
  5326.  Global flags can be set at the command line or in an options file, but cannot 
  5327.  be set locally using stylized comments.  These flags control on-line help, 
  5328.  initialization files, pre-processor flags, libraries and output. 
  5329.  
  5330.   Help 
  5331.  
  5332.  On-line help provides documentation on LCLint operation and flags.  When a 
  5333.  help flag is used, no checking is done by LCLint.  Help flags may be preceded 
  5334.  by - or +. 
  5335.  
  5336.  help 
  5337.  
  5338.  Display general help overview, including list of additional help topics.  help 
  5339.  <topic> 
  5340.  
  5341.  Display help on <topic>. Available topics: 
  5342.  
  5343.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5344.   Γöéannotations                           Γöédescribe annotations                  Γöé
  5345.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5346.   Γöécomments                              Γöédescribe control comments             Γöé
  5347.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5348.   Γöéflags                                 Γöésummarize flag categories             Γöé
  5349.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5350.   Γöéflags <category>                      Γöéall flags pertaining to <category>    Γöé
  5351.   Γöé                                      Γöé(one of the categories listed by      Γöé
  5352.   Γöé                                      Γöélclint -help flags)                   Γöé
  5353.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5354.   Γöéflags alpha                           Γöéall flags in alphabetical order       Γöé
  5355.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5356.   Γöéflags full                            Γöéprint a full description of all flags Γöé
  5357.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5358.   Γöémail                                  Γöéprint information on mailing lists    Γöé
  5359.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5360.   Γöémodes                                 Γöéflags settings in modes               Γöé
  5361.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5362.   Γöéprefixcodes                           Γöécharacter codes for setting namespace Γöé
  5363.   Γöé                                      Γöéprefixes                              Γöé
  5364.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5365.   Γöéreferences                            Γöéprint references to relevant papers   Γöé
  5366.   Γöé                                      Γöéand web sites                         Γöé
  5367.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5368.   Γöévars                                  Γöédescribe environment variables        Γöé
  5369.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5370.   Γöéversion                               Γöéprint maintainer and version          Γöé
  5371.   Γöé                                      Γöéinformation                           Γöé
  5372.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5373.   help <flag> 
  5374.  
  5375.  Describe flag <flag>.  (May list several flags.)  warnflags 
  5376.  
  5377.  Display a warning when a flag is set in a surprising way.  An error is 
  5378.  reported if an obsolete (LCLint Version 1.4 or earlier) flag is set, a flag is 
  5379.  set to its current value (i.e., the + or - may be wrong), or a mode selector 
  5380.  flag is set after mode checking flags that will be reset by the mode were set. 
  5381.  By default, warnflags is on.  To suppress flag warnings, use -warnflags. 
  5382.  
  5383.  Initialization 
  5384.  
  5385.  These flags control directories and files used by LCLint.  They may be used 
  5386.  from the command line or in an options file, but may not be used as control 
  5387.  comments in the source code.  Except where noted. they have the same meaning 
  5388.  preceded by - or +. 
  5389.  
  5390.   tmpdir <directory> 
  5391.  
  5392.  Set directory for writing temp files.  Default is /tmp/.  I<directory> 
  5393.  
  5394.  Add directory to path searched for C include files.  Note there is no space 
  5395.  after the I, to be consistent with C preprocessor flags.  S<directory> 
  5396.  
  5397.  Add directory to path search for .lcl specification files. 
  5398.  
  5399.   f <file> 
  5400.  
  5401.  Load options file <file>.  If this flag is used from the command line, the 
  5402.  default ~/.lclintrc file is not loaded.  This flag may be used in an options 
  5403.  file to load in another options file.  nof 
  5404.  
  5405.  Prevents the default options files (./.lclintrc and ~/.lclintrc) from being 
  5406.  loaded.  (Setting -nof overrides +nof, causing the options files to be loaded 
  5407.  normally.)  systemdirs 
  5408.  
  5409.  Set directories for system files (default is "/usr/include").  Separate 
  5410.  directories with colons (e.g., "/usr/include:/usr/local/lib").  Flag settings 
  5411.  propagate to files in a system directory.  If -systemdirerrors is set, no 
  5412.  errors are reported for files in system directories. 
  5413.  
  5414.  Pre-processor 
  5415.  
  5416.  These flags are used to define or undefine pre-processor constants.  The 
  5417.  -I<directory> flag is also passed to the C pre-processor. 
  5418.  
  5419.   D<initializer> 
  5420.  
  5421.  Passed to the C pre-processor.  U<initializer> 
  5422.  
  5423.  Passed to the C pre-processor 
  5424.  
  5425.  Libraries 
  5426.  
  5427.  These flags control the creation and use of libraries. 
  5428.  
  5429.  dump <file> 
  5430.  
  5431.  Save state in <file> for loading.  The default extension .lcd is added if 
  5432.  <file> has no extension.  load <file> 
  5433.  
  5434.  Load state from <file> (created by -dump).  The default extension .lcd is 
  5435.  added if <file> has no extension.  Only one library file may be loaded. 
  5436.  
  5437.  By default, the standard library is loaded if the -load flag is not used to 
  5438.  load a user library.  If no user library is loaded, one of the following flags 
  5439.  may be used to select a different standard library.  Precede the flag by + to 
  5440.  load the described library (or prevent a library from being loaded using 
  5441.  nolib).  See Apppendix F for information on the provided libraries. 
  5442.  
  5443.  nolib 
  5444.  
  5445.  Do not load any library.  This prevents the standard library from being 
  5446.  loaded.  ansi-lib 
  5447.  
  5448.  Use the ANSI standard library (selected by default).  strict-lib 
  5449.  
  5450.  Use strict version of the ANSI standard library.  posix-lib 
  5451.  
  5452.  Use the POSIX standard library.  posix-strict-lib 
  5453.  
  5454.  Use the strict version of the POSIX standard library.  unix-lib 
  5455.  
  5456.  Use UNIX version of standard library.  unix-strict-lib 
  5457.  
  5458.  Use the strict version of the UNIX standard library. 
  5459.  
  5460.  Output 
  5461.  
  5462.  These flags control what additional information is printed by LCLint.  Setting 
  5463.  +<flag> causes the described information to be printed;  setting -<flag> 
  5464.  prevents it.  By default, all these flags are off. 
  5465.  
  5466.  usestderr 
  5467.  
  5468.  Send error messages to standard error (instead of standard out).  showsummary 
  5469.  
  5470.  Show a summary of all errors reported and suppressed.  Counts of suppressed 
  5471.  errors are not necessarily correct since turning a flag off may prevent some 
  5472.  checking from being done to save computation, and errors that are not reported 
  5473.  may propagate differently from when they are reported.  showscan 
  5474.  
  5475.  Show file names are they are processed.  showalluses 
  5476.  
  5477.  Show list of uses of all external identifiers sorted by number of uses.  stats 
  5478.  
  5479.  Display number of lines processed and checking time.  timedist 
  5480.  
  5481.  Display distribution of where checking time is spent.  quiet 
  5482.  
  5483.  Suppress herald and error count.  (If quiet is not set, LCLint prints out a 
  5484.  herald with version  information before checking begins, and a line 
  5485.  summarizing the total number of errors reported.)  whichlib 
  5486.  
  5487.  Print out the standard library filename and creation information.  limit 
  5488.  <number> 
  5489.  
  5490.  At most <number> similar errors are reported consecutively. Further errors are 
  5491.  suppressed, and a message showing the number of suppressed messages is 
  5492.  printed. 
  5493.  
  5494.  Expected Errors 
  5495.  
  5496.  Normally, LCLint will expect to report no errors.  The exit status will be 
  5497.  success (0) if no errors are reported, and failure if any errors are reported. 
  5498.  Flags can be used to set the expected number of reported errors. Because of 
  5499.  the provided error suppression mechanisms, these options should probably not 
  5500.  be used for final checking real programs but may be useful in developing 
  5501.  programs using make. 
  5502.  
  5503.  expect <number> 
  5504.  
  5505.  Exactly <number> code errors are expected.  LCLint will exit with failure exit 
  5506.  status unless <number> code errors are detected. 
  5507.  
  5508.  Message Format 
  5509.  
  5510.  These flags control how messages are printed.  They may be set at the command 
  5511.  line, in options files, or locally in syntactic comments.  The linelen and 
  5512.  limit flags may be preceded by + or - with the same meaning; for the other 
  5513.  flags, + turns on the describe printing and - turns it off.  The box to the 
  5514.  left of each flag gives its default value. 
  5515.  
  5516.   showcolumn 
  5517.  
  5518.  Show column number where error is found.  Default: +  showfunc 
  5519.  
  5520.  Show name of function (or macro) definition containing error.  The function 
  5521.  name is printed once before the first message detected in that function. 
  5522.  Default: + 
  5523.  
  5524.   showallconjs 
  5525.  
  5526.  Show all possible alternate types (see Section 8.2.2).  Default: - 
  5527.  paren-file-format 
  5528.  
  5529.  Use file(line) format in messages.  hints 
  5530.  
  5531.  Provide hints describing an error and how a message may be suppressed for the 
  5532.  first error reported in each error class. Default: +  forcehints 
  5533.  
  5534.  Provide hints for all errors reported, even if the hint has already been 
  5535.  displayed for the same error class.  Default: -  linelen <number> 
  5536.  
  5537.  Set length of maximum message line to <number> characters.  LCLint will split 
  5538.  messages longer than <number> characters long into multiple lines.  Default: 
  5539.  80 
  5540.  
  5541.  Mode Selector Flags 
  5542.  
  5543.  Mode selects flags set the mode checking flags to predefined values. They 
  5544.  provide a quick coarse-grain way of controlling what classes of errors are 
  5545.  reported. Specific checking flags may be set after a mode flag to override the 
  5546.  mode settings.  Mode flags may be used locally, however the mode settings will 
  5547.  override specific command line flag settings.  A warning is produced if a mode 
  5548.  flag is used after a mode checking flag has been set. 
  5549.  
  5550.  These are brief descriptions to give a general idea of what each mode does. 
  5551.  To see the complete flag settings in each mode, use lclint -help modes. A mode 
  5552.  flag has the same effect when used with either + or -. 
  5553.  
  5554.  weak 
  5555.  
  5556.  Weak checking, intended for typical unannotated C code.  No modifies checking, 
  5557.  macro checking, rep exposure, or clean interface checking is done.  Return 
  5558.  values of type int may be ignored.  The types bool, int, char and user-defined 
  5559.  enum types are all equivalent.  Old style declarations are unreported. 
  5560.  standard 
  5561.  
  5562.  The default mode.  All checking done by weak, plus modifies checking, global 
  5563.  alias checking, use all parameters, using released storage, ignored return 
  5564.  values or any type, macro checking, unreachable code, infinite loops, and 
  5565.  fall-through cases.  The types bool, int and char are distinct.  Old style 
  5566.  declarations are reported.  checks 
  5567.  
  5568.  Moderately strict checking.  All checking done by standard, plus must 
  5569.  modification checking, rep exposure, return alias, memory management and 
  5570.  complete interfaces.  strict 
  5571.  
  5572.  Absurdly strict checking.  All checking done by checks, plus modifications and 
  5573.  global variables used in unspecified functions, strict standard library, and 
  5574.  strict typing of C operators. A special reward will be presented to the first 
  5575.  person to produce a real program that produces no errors with strict checking. 
  5576.  Checking Flags 
  5577.  
  5578.  These flags control checking done by LCLint.  They may be set locally using 
  5579.  syntactic comments, from the command line, or in an options file.  Some flags 
  5580.  directly control whether a certain class of message is reported. Preceding the 
  5581.  flag by + turns reporting on, and preceding the flag by - turns reporting off. 
  5582.  Other flags control checking less directly by determining default values (what 
  5583.  annotations are implicit), making types equivalent (to prevent certain type 
  5584.  errors), controlling representation access, etc.  For these flags, the effect 
  5585.  of + is described, and the effect of - is the opposite (or explicitly 
  5586.  explained if there is no clear opposite).  The organization of this section 
  5587.  mirrors Sections 3-10. 
  5588.  
  5589.  Key 
  5590.  
  5591.  Under each flag name is a flag descriptor encoding the what kind of flag it is 
  5592.  and its default value.  The descriptions are: 
  5593.  
  5594.   plain: - 
  5595.  
  5596.  A plain flag.  The value after the colon gives the default setting (e.g., this 
  5597.  flag is off.)  m: --++ 
  5598.  
  5599.  A mode checking flag.  The value of the flag is set by the mode selector.  The 
  5600.  four signs give the setting in the weak, standard, checks and strict modes. 
  5601.  (e.g., this flag is off in the weak and standard modes, and on in the checks 
  5602.  and strict modes.)  shortcut 
  5603.  
  5604.  A shortcut flag.  This flag sets other flags, so it has no default value. 
  5605.  
  5606.  Types 
  5607.  
  5608.  Abstract Types 
  5609.  
  5610.  plain: - 
  5611.  impabstract 
  5612.  
  5613.  Implicit abstract annotation for type declarations that do not use concrete. 
  5614.  
  5615.  m: -+++ 
  5616.  mutrep 
  5617.  
  5618.  Representation of mutable type has sharing semantics. 
  5619.  
  5620.  Access (Section 3.1) 
  5621.  
  5622.  plain: + 
  5623.  accessmodule 
  5624.  
  5625.  An abstract type defined in M.h (or specified in M.lcl) is accessible in M.c. 
  5626.  
  5627.  plain: + 
  5628.  accessfile 
  5629.  
  5630.  An abstract type named type is accessible in files named type.<extenstion>. 
  5631.  
  5632.  plain: + 
  5633.  accessczech 
  5634.  
  5635.  An abstract type named type may be accessible in a function named type_name. 
  5636.  (see Section 9.1.1) 
  5637.  
  5638.  plain: - 
  5639.  accessslovak 
  5640.  
  5641.  An abstract type named type may be accessible in a function named typeName. 
  5642.  (see Section.9.1.2) 
  5643.  
  5644.  plain: - 
  5645.  accessczechoslovak 
  5646.  
  5647.  An abstract type named type may be accessible in a function named type_name or 
  5648.  typeName.  (see Section 9.1.3) 
  5649.  
  5650.  shortcut 
  5651.  accessall 
  5652.  
  5653.  Sets accessmodule, accessfile and accessczech. 
  5654.  
  5655.  Boolean Types (Section 3.3) 
  5656.  
  5657.  These flags control the type name used to represent booleans, and whether the 
  5658.  boolean type is abstract. 
  5659.  
  5660.  plain: - 
  5661.  bool 
  5662.  
  5663.  Boolean type is an abstract type. 
  5664.  
  5665.  plain: unset 
  5666.   booltype <name> 
  5667.  
  5668.  Set name of boolean type to <name>. 
  5669.  
  5670.  plain: FALSE 
  5671.   boolfalse <name> 
  5672.  
  5673.  Set name of boolean false to <name>. 
  5674.  
  5675.  plain: TRUE 
  5676.   booltrue <name> 
  5677.  
  5678.  Set name of boolean true to <name>. 
  5679.  
  5680.  Predicates 
  5681.  
  5682.  m: --++ 
  5683.  predboolptr 
  5684.  
  5685.  Type of condition test is a pointer. 
  5686.  
  5687.  m: -+++ 
  5688.  predboolint 
  5689.  
  5690.  Type of condition test is an integral type. 
  5691.  
  5692.  m: ++++ 
  5693.  predboolothers 
  5694.  
  5695.  Type of condition test is not a boolean, pointer or integral type. 
  5696.  
  5697.  shortcut 
  5698.  predbool 
  5699.  
  5700.  Sets predboolint, predboolptr and preboolothers. 
  5701.  
  5702.  plain: + 
  5703.  predassign 
  5704.  
  5705.  The condition test is an assignment expression. If an assignment is intended, 
  5706.  add an extra    parentheses nesting (e.g., if ((a = b)) ...). 
  5707.  
  5708.  Primitive Operations 
  5709.  
  5710.  m: ---+ 
  5711.  ptrarith 
  5712.  
  5713.  Arithmetic involving pointer and integer. 
  5714.  
  5715.  m: ++-- 
  5716.  ptrnegate 
  5717.  
  5718.  Allow the operand of the ! operator to be a pointer. 
  5719.  
  5720.   m: ---+ 
  5721.  bitwisesigned 
  5722.  
  5723.  An operand to a bitwise operator is not an unsigned values.  This may have 
  5724.  unexpected results depending on the signed representations. 
  5725.  
  5726.   m: -+++ 
  5727.  shiftsigned 
  5728.  
  5729.  An operand to a shift operator is not unsigned values.  This may have 
  5730.  unexpected results depending on the signed representations. 
  5731.  
  5732.   m: ---+ 
  5733.  strictops 
  5734.  
  5735.  Primitive operation does not type check strictly. 
  5736.  
  5737.  m: ---+ 
  5738.  sizeoftype 
  5739.  
  5740.  Operand of sizeof operator is a type.  (Safer to use expression, int *x = 
  5741.  sizeof (*x); instead of sizeof (int).) 
  5742.  
  5743.  Format Codes 
  5744.  
  5745.  plain: + 
  5746.  formatcode 
  5747.  
  5748.  Invalid format code in format string for printflike or scanflike function. 
  5749.  
  5750.  plain: + 
  5751.  formattype 
  5752.  
  5753.  Type-mismatch in parameter corresponding to format code in a printflike or 
  5754.  scanflike function. 
  5755.  
  5756.  Main 
  5757.  
  5758.  plain: + 
  5759.  maintype 
  5760.  
  5761.  Type of main does not match expected type (function returning an int, taking 
  5762.  no parameters or two parameters of type int and char **.) 
  5763.  
  5764.  Comparisons 
  5765.  
  5766.   m: -+++ 
  5767.  boolcompare 
  5768.  
  5769.  Comparison between boolean values.  This is dangerous since there may be 
  5770.  multiple TRUE values if any non-zero value is interpreted at TRUE. 
  5771.  
  5772.  m: -+++ 
  5773.  realcompare 
  5774.  
  5775.  Comparison involving float or double values.  This is dangerous since it may 
  5776.  produce unexpected results because floating point representations are inexact. 
  5777.  
  5778.  m: -+++ 
  5779.  ptrcompare 
  5780.  
  5781.  Comparison between pointer and number. 
  5782.  
  5783.  Type Equivalence 
  5784.  
  5785.  m: +--- 
  5786.  voidabstract 
  5787.  
  5788.  Allow void * to match pointers to abstract types.  (Casting a pointer to an 
  5789.  abstract type to a pointer to void is okay if +voidabstract is set.) 
  5790.  
  5791.  plain: + 
  5792.   castfcnptr 
  5793.  
  5794.   A pointer to a function is cast to (or used as) a pointer to void (or vice 
  5795.  versa). 
  5796.  
  5797.  m: +--- 
  5798.  forwarddecl 
  5799.  
  5800.  Forward declarations of pointers to abstract representation match abstract 
  5801.  type. 
  5802.  
  5803.   m: -+++ 
  5804.  imptype 
  5805.  
  5806.  A variable declaration has no explicit type.  The type is implicitly int. 
  5807.  
  5808.   plain: + 
  5809.  incompletetype 
  5810.  
  5811.  A formal parameter is declared with an incomplete type (e.g., int[][]). 
  5812.  
  5813.   m: +--- 
  5814.  charindex 
  5815.  
  5816.  Allow char to index arrays. 
  5817.  
  5818.  m: ---- 
  5819.  enumindex 
  5820.  
  5821.  Allow members of enum type  to index arrays. 
  5822.  
  5823.  m: +--- 
  5824.  boolint 
  5825.  
  5826.  Make bool and int types equivalent.  (No type errors are reported when a 
  5827.  boolean is used where an integral type is expected and vice versa.) 
  5828.  
  5829.  m: +--- 
  5830.  charint 
  5831.  
  5832.  Make char and int types equivalent. 
  5833.  
  5834.  m: ++-- 
  5835.  enumint 
  5836.  
  5837.  Make enum and int types equivalent. 
  5838.  
  5839.  m: +--- 
  5840.  floatdouble 
  5841.  
  5842.  Make float and double types equivalent. 
  5843.  
  5844.  m: ---- 
  5845.  ignorequals 
  5846.  
  5847.  Ignore type qualifiers (long, short, unsigned ). 
  5848.  
  5849.  m: ++-- 
  5850.  relaxquals 
  5851.  
  5852.  Report qualifier mismatches only if dangerous (information may be lost since a 
  5853.  larger type is assigned to (or passed as) a smaller one or a comparison uses 
  5854.  signed and unsigned values.) 
  5855.  
  5856.  m: ---- 
  5857.  ignoresigns 
  5858.  
  5859.  Ignore signs in type comparisons (unsigned matches signed). 
  5860.  
  5861.  plain: - 
  5862.   longintegral 
  5863.  
  5864.  Allow long type to match an arbitrary integral type (e.g., size_t). 
  5865.  
  5866.  m: +--- 
  5867.   longunsignedintegral 
  5868.  
  5869.  Allow long unsigned type to match an arbitrary integral type (e.g., dev_t). 
  5870.  
  5871.  plain: - 
  5872.   matchanyintegral 
  5873.  
  5874.  Allow any integral type to match an arbitrary integral type (e.g., dev_t). 
  5875.  
  5876.   m: +--- 
  5877.   long-unsigned-unsigned-integral 
  5878.  
  5879.  Allow unsigned long type to match an arbitrary unsigned integral type (e.g., 
  5880.  size_t). 
  5881.  
  5882.  m: +--- 
  5883.   long-signed-integral 
  5884.  
  5885.  Allow long type to match an arbitrary signed integral type (e.g., ssize_t). 
  5886.  m: ++++ 
  5887.  num-literal 
  5888.  
  5889.  Integer literals can be used as floats. 
  5890.  
  5891.  plain: + 
  5892.   char-int-literal 
  5893.  
  5894.  A character constant may be used as an int. 
  5895.  
  5896.  m: ++++ 
  5897.  zeroptr 
  5898.  
  5899.  Literal 0 may be used as a pointer. 
  5900.  
  5901.  m: ---- 
  5902.  relaxtypes 
  5903.  
  5904.  Allow all numeric types to match. 
  5905.  
  5906.  plain: + 
  5907.  fullinitblock 
  5908.  
  5909.  Initializer does not set every field in the structure. 
  5910.  
  5911.  Function Interfaces 
  5912.  
  5913.  Modification (Section 4.1) 
  5914.  
  5915.  m: ++++ 
  5916.  modifies 
  5917.  
  5918.  Undocumented modification of caller-visible state.  Without +moduncon, 
  5919.  modification errors are only reported in the definitions of functions declared 
  5920.  with a modifies clause (or specified). 
  5921.  
  5922.  m: --++ 
  5923.  mustmod 
  5924.  
  5925.  Documented modification is not detected.  An object listed in the modifies 
  5926.  clause for a function, is not modified by the implementation. 
  5927.  
  5928.  shortcut 
  5929.  mod-uncon 
  5930.  
  5931.  Report modification errors in functions declared without a modifies 
  5932.  clause.(Sets modnomods, mod-globs-nomods and mod-strict-globs-nomods.) 
  5933.  
  5934.  m: ---+ 
  5935.  mod-nomods 
  5936.  
  5937.  Report modification errors (not involving global variables) in functions 
  5938.  declared without a modifies clause. 
  5939.  
  5940.  m: ---+ 
  5941.  mod-uncon-nomods 
  5942.  
  5943.  An unconstrained function is called in a function body where  modifications 
  5944.  are checked.  Since the unconstrained function may modify anything, there may 
  5945.  be undetected modifications in the checked function. 
  5946.  
  5947.  m: ---+ 
  5948.  mod-internal-strict 
  5949.  
  5950.  A function that modifies internalState is called from a function that does not 
  5951.  list internalState in its modifies clause. 
  5952.  
  5953.  m: ---+ 
  5954.  mod-file-sys 
  5955.  
  5956.   A function modifies the file system but does not list fileSystem in its 
  5957.  modifies clause. 
  5958.  
  5959.   Global Variables (Section 4.2) 
  5960.  
  5961.  Errors involving the use and modification of global and file static variables 
  5962.  are reported depending on flag settings, annotations where the global variable 
  5963.  is declared, and whether or not the function where the global is used was 
  5964.  declared with a globals clause. 
  5965.  
  5966.  m: ++++ 
  5967.  globs 
  5968.  
  5969.  Undocumented use of a checked global variable in a function with a globals 
  5970.  list. 
  5971.  
  5972.  m: ++++ 
  5973.  globuse 
  5974.  
  5975.  A global listed in the globals list is not used in the implementation. 
  5976.  
  5977.  m: ---+ 
  5978.  globnoglobs 
  5979.  
  5980.  Use of a checked global in a function with no globals list. 
  5981.  
  5982.  m: ---+ 
  5983.  internalglobs 
  5984.  
  5985.  Undocumented use of internal state (should have globals internalState). 
  5986.  
  5987.  m: ---+ 
  5988.  internalglobsnoglobs 
  5989.  
  5990.      Use of internal state in function with no globals list. 
  5991.  
  5992.  m: -+++ 
  5993.  globstate 
  5994.  
  5995.  A function returns with global in inconsistent state (null or undefined) 
  5996.  
  5997.  m: --++ 
  5998.  allglobs 
  5999.  
  6000.  Report use and modification errors for globals not annotated with unchecked. 
  6001.  
  6002.  m: ++++ 
  6003.  checkstrictglobs 
  6004.  
  6005.  Report use and modification errors for checkedstrict globals. 
  6006.  
  6007.  Modification of Global Variables 
  6008.  
  6009.  m: -+++ 
  6010.  modglobs 
  6011.  
  6012.  Undocumented modification of a checked global variable. 
  6013.  
  6014.  m: ---+ 
  6015.  modglobsunchecked 
  6016.  
  6017.  Undocumented modification of an unchecked global variable. 
  6018.  
  6019.  m: ---+ 
  6020.  modglobsnomods 
  6021.  
  6022.  Undocumented modification of a checked global variable in a function with no 
  6023.  modifies clause. 
  6024.  
  6025.  m: ---+ 
  6026.  modstrictglobsnomods 
  6027.  
  6028.  Undocumented modification of a checkedstrict global variable in a function 
  6029.  declared with no modifies clause. 
  6030.  
  6031.  Globals Lists and Modifies Clauses 
  6032.  
  6033.  m: ---+ 
  6034.  warnmissingglobs 
  6035.  
  6036.  Global variable used in modifies clause is not listed in globals list.  (The 
  6037.  global is added to the globals list.) 
  6038.  
  6039.  m: ---+ 
  6040.  warnmissingglobsnoglobs 
  6041.  
  6042.  Global variable used in modifies clause of a function with no globals list. 
  6043.  
  6044.  m: --++ 
  6045.  globsimpmodsnothing 
  6046.  
  6047.  A function declared with a globals list but no modifies clause is assumed to 
  6048.  modify nothing. 
  6049.  
  6050.  m: ---- 
  6051.  modsimpnoglobs 
  6052.  
  6053.  A function declared with a modifies clause but no globals list is assumed to 
  6054.  use no globals. 
  6055.  
  6056.  Implicit Checking Qualifiers 
  6057.  
  6058.  m: ---- 
  6059.  impcheckedglobs 
  6060.  
  6061.  Implicit checked qualifier on global variables with no checking annotation. 
  6062.  
  6063.  m: ---- 
  6064.  impcheckedstatics 
  6065.  
  6066.  Implicit checked qualifier file static scope variables with no checking 
  6067.  annotation. 
  6068.  
  6069.  m: ---- 
  6070.  impcheckmodglobs 
  6071.  
  6072.  Implicit checkmod qualifier on global variables with no checking annotation. 
  6073.  
  6074.  m: ---- 
  6075.  impcheckmodstatics 
  6076.  
  6077.  Implicit checkmod qualifier file static scope variables with no checking 
  6078.  annotation. 
  6079.  
  6080.  m: ---+ 
  6081.  impcheckedstrictglobs 
  6082.  
  6083.  Implicit checked qualifier on global variables with no checking annotation. 
  6084.  
  6085.  m: ---+ 
  6086.  impcheckedstrictstatics 
  6087.  
  6088.  Implicit checked qualifier file static scope variables with no checking 
  6089.  annotation. 
  6090.  
  6091.  m: --++ 
  6092.  impcheckmodinternals 
  6093.  
  6094.  Implicit checkmod qualifier on function scope static variables with no 
  6095.  checking annotation. 
  6096.  
  6097.  m: -+++ 
  6098.  impglobsweak 
  6099.  
  6100.  Global Aliasing 
  6101.  
  6102.  shortcut 
  6103.  globalias 
  6104.  
  6105.  Function returns with global aliasing external state (sets 
  6106.  checkstrictglobalias, checkedglobalias, checkmodglobalias and 
  6107.  uncheckedglobalias). 
  6108.  
  6109.  m: -+++ 
  6110.  checkstrictglobalias 
  6111.  
  6112.  Function returns with a checkstrict global aliasing external state. 
  6113.  
  6114.  m: -+++ 
  6115.  checkedglobalias 
  6116.  
  6117.  Function returns with a checked global aliasing external state. 
  6118.  
  6119.  m: -+++ 
  6120.  checkmodglobalias 
  6121.  
  6122.  Function returns with a checkmod global aliasing external state. 
  6123.  
  6124.  m: --++ 
  6125.  uncheckedglobalias 
  6126.  
  6127.  Function returns with an unchecked global aliasing external state. 
  6128.  
  6129.  Declaration Consistency (Section 4.3) 
  6130.  
  6131.  m: -+++ 
  6132.  incondefs 
  6133.  
  6134.  Identifier redeclared or redefined with inconsistent type. 
  6135.  
  6136.  m: -+++ 
  6137.  incondefslib 
  6138.  
  6139.  Identifier defined in a library is redefined with inconsistent type 
  6140.  
  6141.  m: ---- 
  6142.  overload 
  6143.  
  6144.  Standard library function overloaded. 
  6145.  
  6146.  m: -+++ 
  6147.  matchfields 
  6148.  
  6149.  A struct or enum type is redefined with inconsistent fields or members. 
  6150.  
  6151.  Memory Management 
  6152.  
  6153.  Reporting of memory management errors is controlled by flags setting checking 
  6154.  and implicit annotations and code annotations. 
  6155.  
  6156.  Deallocation Errors (Section 5.2) 
  6157.  
  6158.  m: -+++ 
  6159.  usereleased 
  6160.  
  6161.  Storage used after it may have been released. 
  6162.  
  6163.  m: ---+ 
  6164.  strictusereleased 
  6165.  
  6166.  An array element used after it may have been released. 
  6167.  
  6168.  Inconsistent Branches 
  6169.  
  6170.  m: -+++ 
  6171.  branchstate 
  6172.  
  6173.  Storage has inconsistent states of alternate paths through a branch (e.g., it 
  6174.  is released in the true branch of an if-statement, but there is no else 
  6175.  branch.) 
  6176.  
  6177.  m: ---+ 
  6178.  strictbranchstate 
  6179.  
  6180.  Storage through array fetch has inconsistent states of alternate paths through 
  6181.  a branch.  Since array elements are not checked accurately, this may lead to 
  6182.  spurious errors. 
  6183.  
  6184.  m: --++ 
  6185.  deparrays 
  6186.  
  6187.  Treat array elements as dependent storage.  Checking of array elements cannot 
  6188.  be done accurately by LCLint.  If deparrays is not set, array elements are 
  6189.  assumed to be independent, so code that releases the same element more than 
  6190.  once will produce no error.  If deparrays is set, array elements are assumed 
  6191.  to be dependent, so code that releases the same element more that once will 
  6192.  produce an error, but so will code that releases different elements correctly 
  6193.  will produce a spurious error. 
  6194.  
  6195.  Memory Leaks 
  6196.  
  6197.  m: -+++ 
  6198.  mustfree 
  6199.  
  6200.  Allocated storage was not released before return or scope exit  Errors are 
  6201.  reported for only, fresh or owned storage. 
  6202.  
  6203.  m: -+++ 
  6204.  compdestroy 
  6205.  
  6206.  All only references derivable from out only parameter of type void * must be 
  6207.  released.  (This is the type of the parameter to free, but may also be used 
  6208.  for user-defined deallocation functions.) 
  6209.  
  6210.  m: ---+ 
  6211.  strictdestroy 
  6212.  
  6213.  Report complete destruction errors for array elements that may have been 
  6214.  released.  (If strictdestroy is not set, LCLint will assume that if any array 
  6215.  element was released, the entire array was correctly released.) 
  6216.  
  6217.  Transfer Errors 
  6218.  
  6219.  A transfer error is reported when storage is transferred (by an assignment, 
  6220.  passing a parameter, or returning) in a way that is inconsistent. 
  6221.  
  6222.  shortcut 
  6223.  memtrans 
  6224.  
  6225.  Sets all memory transfer errors flags. 
  6226.  
  6227.  m: -+++ 
  6228.  onlytrans 
  6229.  
  6230.  Only storage transferred to non-only reference (memory leak). 
  6231.  
  6232.  m: -+++ 
  6233.  ownedtrans 
  6234.  
  6235.  Owned storage transferred to non-owned reference (memory leak). 
  6236.  
  6237.  m: -+++ 
  6238.  freshtrans 
  6239.  
  6240.  Newly-allocated storage transferred to non-only reference (memory leak). 
  6241.  
  6242.  m: -+++ 
  6243.  sharedtrans 
  6244.  
  6245.  Shared storage transferred to non-shared reference. 
  6246.  
  6247.  m: -+++ 
  6248.  dependenttrans 
  6249.  
  6250.  Inconsistent dependent transfer. Dependent storage is transferred to a 
  6251.  non-dependent reference. 
  6252.  
  6253.  m: -+++ 
  6254.  temptrans 
  6255.  
  6256.  Temporary storage (associated with a temp formal parameter) is transferred to 
  6257.  a non-temporary reference.  The storage may be released or new aliases 
  6258.  created. 
  6259.  
  6260.  m: -+++ 
  6261.  kepttrans 
  6262.  
  6263.  Kept storage transferred to non-temporary reference. 
  6264.  
  6265.  m: -+++ 
  6266.  keeptrans 
  6267.  
  6268.  Keep storage is transferred in a way that may add a new alias to it, or 
  6269.  release it. 
  6270.  
  6271.  m: -+++ 
  6272.  refcounttrans 
  6273.  
  6274.  Reference counted storage is transferred in an inconsistent way. 
  6275.  
  6276.  m: -+++ 
  6277.  newreftrans 
  6278.  
  6279.  A new reference transferred to a reference counted reference (reference count 
  6280.  is not set correctly). 
  6281.  
  6282.  m: -+++ 
  6283.  immediatetrans 
  6284.  
  6285.  An immediate address (result of &) is transferred inconsistently. 
  6286.  
  6287.  m: -+++ 
  6288.  statictrans 
  6289.  
  6290.  Static storage is transferred in an inconsistent way. 
  6291.  
  6292.  m: -+++ 
  6293.  exposetrans 
  6294.  
  6295.  Inconsistent exposure transfer. Exposed storage is transferred to a 
  6296.  non-exposed, non-observer reference. 
  6297.  
  6298.  m: -+++ 
  6299.  observertrans 
  6300.  
  6301.  Inconsistent observer transfer. Observer storage is transferred to a 
  6302.  non-observer reference. 
  6303.  
  6304.  m: -+++ 
  6305.  unqualifiedtrans 
  6306.  
  6307.  Unqualified storage is transferred in an inconsistent way. 
  6308.  
  6309.   Initializers 
  6310.  
  6311.  m: --++ 
  6312.   onlyunqglobaltrans 
  6313.  
  6314.   Only storage transferred to an unqualified global or static reference. This 
  6315.  may lead to a memory leak, since the new reference is not necessarily 
  6316.  released. 
  6317.  
  6318.  m: --++ 
  6319.   staticinittrans 
  6320.  
  6321.  Static storage is used as an initial value in an inconsistent way. 
  6322.  
  6323.  m: --++ 
  6324.   unqualifiedinittrans 
  6325.  
  6326.  Unqualified storage is used as an initial value in an inconsistent way. 
  6327.  
  6328.   Derived Storage 
  6329.  
  6330.  m: -+++ 
  6331.  compmempass 
  6332.  
  6333.  Storage derivable from a parameter does not match the alias kind expected for 
  6334.  the formal parameter. 
  6335.  
  6336.  Stack References 
  6337.  
  6338.  m: ++++ 
  6339.  stackref 
  6340.  
  6341.  A stack reference is pointed to by an external reference when the function 
  6342.  returns.  Since the call frame will be destroyed when the function returns the 
  6343.  return value will point to dead storage. (Section 5.2.6) 
  6344.  
  6345.  Implicit Memory Annotations (Section 5.3) 
  6346.  
  6347.  plain: + 
  6348.  globimponly 
  6349.  
  6350.  Assume unannotated global storage is only. 
  6351.  
  6352.  plain: + 
  6353.  paramimptemp 
  6354.  
  6355.  Assume unannotated parameter is temp. 
  6356.  
  6357.  plain: + 
  6358.  retimponly 
  6359.  
  6360.  Assume unannotated returned storage is only. 
  6361.  
  6362.  plain: + 
  6363.  structimponly 
  6364.  
  6365.  Assume unannotated structure or union field is only. 
  6366.  
  6367.  shortcut 
  6368.  codeimponly 
  6369.  
  6370.  Sets globimponly, retimponly and structimponly. 
  6371.  
  6372.  m: -+++ 
  6373.  memimp 
  6374.  
  6375.  Report memory errors for unqualified storage. 
  6376.  
  6377.  m: ---- 
  6378.  passunknown 
  6379.  
  6380.  Passing a value as an unannotated parameter clears its annotation.  This will 
  6381.  prevent many spurious errors from being report for unannotated programs, but 
  6382.  eliminates the possibility of detecting many errors. 
  6383.  
  6384.  Sharing 
  6385.  
  6386.  Aliasing (Section 6) 
  6387.  
  6388.  m: -+++ 
  6389.  aliasunique 
  6390.  
  6391.  A actual parameter that is passed as a unique formal parameter is aliased by 
  6392.  another parameter or global variable. 
  6393.  
  6394.  m: -+++ 
  6395.  mayaliasunique 
  6396.  
  6397.  A actual parameter that is passed as a unique formal parameter may be aliased 
  6398.  by another parameter or global variable. 
  6399.  
  6400.  m: -+++ 
  6401.  mustnotalias 
  6402.  
  6403.  An alias has been added to a temp-qualifier parameter or global that is 
  6404.  visible externally when the function returns. 
  6405.  
  6406.  m: --++ 
  6407.  retalias 
  6408.  
  6409.  A function returns an alias to parameter or global. 
  6410.  
  6411.  Exposure (Section 6.2) 
  6412.  
  6413.  shortcut 
  6414.  repexpose 
  6415.  
  6416.  The internal representation of an abstract type is visible to the caller. 
  6417.  This means clients may have access to a pointer into the abstract 
  6418.  representation. (Sets assignexpose, retexpose, and castexpose.) 
  6419.  
  6420.  m: --++ 
  6421.  assignexpose 
  6422.  
  6423.  Abstract representation is exposed by an assignment or passed parameter. 
  6424.  
  6425.  m: --++ 
  6426.  castexpose 
  6427.  
  6428.  Abstract representation is exposed through a cast. 
  6429.  
  6430.  m: --++ 
  6431.  retexpose 
  6432.  
  6433.  Abstract representation is exposed by a return value. 
  6434.  
  6435.  Observer Modifications 
  6436.  
  6437.  plain: + 
  6438.  modobserver 
  6439.  
  6440.  Possible modification of observer storage. 
  6441.  
  6442.  m: ---+ 
  6443.  modobserveruncon 
  6444.  
  6445.  Storage declared with observer may be modified through a call to an 
  6446.  unconstrained function. 
  6447.  
  6448.  String Literals  (Section 6.2.1) 
  6449.  
  6450.  m: --++ 
  6451.  readonlytrans 
  6452.  
  6453.  Report memory transfer errors for initializations to read-only string literals 
  6454.  
  6455.  m: -+++ 
  6456.  readonlystrings 
  6457.  
  6458.  String literals are read-only (ANSI semantics).  An error is reported if a 
  6459.  string literal may be modified or released. 
  6460.  
  6461.  Use Before Definition (Section 7.1) 
  6462.  
  6463.  m: -+++ 
  6464.  usedef 
  6465.  
  6466.  The value of a location that may not be initialized on some execution path is 
  6467.  used. 
  6468.  
  6469.  m: ---- 
  6470.  impouts 
  6471.  
  6472.  Allow unannotated pointer parameters to functions to be implicit out 
  6473.  parameters. 
  6474.  
  6475.  m: -+++ 
  6476.  compdef 
  6477.  
  6478.  Storage derivable from a parameter, return value or global variable is not 
  6479.  completely defined. 
  6480.  
  6481.  m: -+++ 
  6482.  uniondef 
  6483.  
  6484.  No field of a union is defined.  (No error is reported if at least one union 
  6485.  field is defined.) 
  6486.  
  6487.  m: -+++ 
  6488.  mustdefine 
  6489.  
  6490.  Parameter declared with out is not defined before return or scope exit. 
  6491.  
  6492.  Null Pointers (Section 7.2) 
  6493.  
  6494.   m: -+++ 
  6495.  nullderef 
  6496.  
  6497.  A possibly null pointer may be dereferenced. 
  6498.  
  6499.  m: -+++ 
  6500.  nullpass 
  6501.  
  6502.  A possibly null pointer is passed as a parameter not annotated with null. 
  6503.  
  6504.  m: -+++ 
  6505.  nullret 
  6506.  
  6507.  A possibly null pointer is return as a result not annotated with null. 
  6508.  
  6509.  m: -+++ 
  6510.  nullstate 
  6511.  
  6512.  Possibly null pointer reachable from a reference with no null annotation. 
  6513.  
  6514.  m: -+++ 
  6515.  nullassign 
  6516.  
  6517.  Inconsistent assignment or initialization involving null pointer. 
  6518.  
  6519.  shortcut 
  6520.  null 
  6521.  
  6522.  Sets all null checking flags. 
  6523.  
  6524.  Macros (Section 8) 
  6525.  
  6526.  These flags control expansion and checking of macro definitions and 
  6527.  invocations. 
  6528.  
  6529.  Macro Expansion 
  6530.  
  6531.  These flags control which macros are checked as functions or constants, and 
  6532.  which are expanded in the pre-processing phase.  Macros preceded by 
  6533.  /*@notfunction@*/ are never expanded regardless of these flag settings.  These 
  6534.  flags may be used in source-file control comments. 
  6535.  
  6536.  plain: - 
  6537.  fcnmacros 
  6538.  
  6539.  Macros defined with parameter lists are not expanded and are checked as 
  6540.  functions. 
  6541.  
  6542.  plain: - 
  6543.  constmacros 
  6544.  
  6545.  Macros defined without parameter lists are not expanded and are checked as 
  6546.  constants. 
  6547.  
  6548.  shortcut 
  6549.  allmacros 
  6550.  
  6551.  Sets allfcnmacros and allconstmacros. 
  6552.  
  6553.  plain: - 
  6554.  libmacros 
  6555.  
  6556.  Macros defining identifiers declared in a loaded library are not expanded and 
  6557.  are checked according to the library information. 
  6558.  
  6559.  Macro Definitions 
  6560.  
  6561.  These flags control what errors are reported in macro definitions. 
  6562.  
  6563.  m: -+++ 
  6564.  macrostmt 
  6565.  
  6566.  Macro definition is not syntactically equivalent to function.  This means if 
  6567.  the macro is used as a statement (e.g., if (test) macro();) unexpected 
  6568.  behavior may result.  One fix is to surround the macro body with do { ...; } 
  6569.  while (FALSE). 
  6570.  
  6571.  m: -+++ 
  6572.  macroparams 
  6573.  
  6574.  A macro parameter is not used exactly once in all possible invocations of the 
  6575.  macro. 
  6576.  
  6577.  m: -+++ 
  6578.  macroassign 
  6579.  
  6580.  A macro parameter is used as the left side of an assignment expression. 
  6581.  
  6582.  m: -+++ 
  6583.  macroparens 
  6584.  
  6585.  A macro parameter is used without parentheses (in potentially dangerous 
  6586.  context). 
  6587.  
  6588.  m: ---+ 
  6589.  macroempty 
  6590.  
  6591.  Macro definition of a function is empty. 
  6592.  
  6593.  m: -+++ 
  6594.  macroredef 
  6595.  
  6596.  Macro is redefined.  There is another macro defined with the same name. 
  6597.  
  6598.  m: -+++ 
  6599.  macrounrecog 
  6600.  
  6601.  An unrecognized identifier appears in a macro definition.  Since the 
  6602.  identifier may be defined where the macro is used, this could be okay, but 
  6603.  LCLint will not be able to check the unrecognized identifier appropriately. 
  6604.  
  6605.  Corresponding Declarations 
  6606.  
  6607.  m: ++++ 
  6608.  macromatchname 
  6609.  
  6610.  A iter or constant macro is defined using a different name from the one used 
  6611.  in the previous syntactic comment. 
  6612.  
  6613.  shortcut 
  6614.  macrodecl 
  6615.  
  6616.  A macro definition has no corresponding declaration.  (Sets macrofcndecl and 
  6617.  macroconstdecl.) 
  6618.  
  6619.  m: -+++ 
  6620.  macrofcndecl 
  6621.  
  6622.  Macro definition with parameter list has no corresponding function prototype. 
  6623.  Without a prototype, the types of the macro result and parameters is unknown. 
  6624.  
  6625.  m: -+++ 
  6626.  macroconstdecl 
  6627.  
  6628.  A macro definition without parameter list has no corresponding constant 
  6629.  declaration. 
  6630.  
  6631.  plain: + 
  6632.  nextlinemacros 
  6633.  
  6634.  A constant or iter declaration is not immediately followed by a macro 
  6635.  definition. 
  6636.  
  6637.  Side-Effect Free Parameters (Section 8.2.1) 
  6638.  
  6639.  These flags control error reporting for parameters with inconsistent 
  6640.  side-effects in invocations of checked function macros and function calls. 
  6641.  
  6642.  m: -+++ 
  6643.  sefparams 
  6644.  
  6645.  An actual parameter with side-effects is passed as a formal parameter declared 
  6646.  with sef. 
  6647.  
  6648.  m: --++ 
  6649.  sefuncon 
  6650.  
  6651.  An actual parameter involving a call to an unconstrained function (declared 
  6652.  without modifies clause) that may modify anything is passed as a sef 
  6653.  parameter. 
  6654.  
  6655.  Iterators 
  6656.  
  6657.  plain: - 
  6658.  hasyield 
  6659.  
  6660.  An iterator has been declared with no parameters annotated with yield. 
  6661.  
  6662.  Naming Conventions 
  6663.  
  6664.  plain: + 
  6665.  namechecks 
  6666.  
  6667.   Turns all name checking on or off without changing other settings. 
  6668.  
  6669.  Type-Based Naming Conventions (Section 9.1) 
  6670.  
  6671.  Czech Naming Convention 
  6672.  
  6673.  shortcut 
  6674.  czech 
  6675.  
  6676.  Selects complete Czech naming convention (sets accessczech, czechfcns, 
  6677.  czechvars, czechconsts, czechmacros, and czechtypes). 
  6678.  
  6679.  plain: + 
  6680.  accessczech 
  6681.  
  6682.  Allow access to abstract types following Czech naming convention.  The 
  6683.  representation of an abstract type named t is accessible in the definition of 
  6684.  a function or constant named t_name. 
  6685.  
  6686.  plain: - 
  6687.  czechfcns 
  6688.  
  6689.  Function or iterator name is not consistent with Czech naming convention. 
  6690.  
  6691.  plain: - 
  6692.  czechvars 
  6693.  
  6694.   Variable name is not consistent with Czech naming convention. 
  6695.  
  6696.  plain: - 
  6697.  czechmacros 
  6698.  
  6699.   Expanded macro name is not consistent with Czech naming convention. 
  6700.  
  6701.  plain: - 
  6702.  czechconsts 
  6703.  
  6704.  Constant name is not consistent with Czech naming convention. 
  6705.  
  6706.  plain: - 
  6707.  czechtypes 
  6708.  
  6709.   Type name is not consistent with Czech naming convention.  Czech type names 
  6710.  must not use the underscore character. 
  6711.  
  6712.  Slovak Naming Convention 
  6713.  
  6714.  shortcut 
  6715.  slovak 
  6716.  
  6717.  Selects complete Slovak naming convention (sets accessslovak, slovakfcns, 
  6718.  slovakvars, slovakconsts, slovakmacros,  and slovaktypes). 
  6719.  
  6720.  plain: - 
  6721.  accessslovak 
  6722.  
  6723.  Allow access to abstract types following Slovak naming convention. The 
  6724.  representation of an abstract type named t is accessible in the definition of 
  6725.  a function or constant named tName. 
  6726.  
  6727.  plain: - 
  6728.  slovakfcns 
  6729.  
  6730.  Function or iterator name is not consistent with Slovak naming convention. 
  6731.  
  6732.  plain: - 
  6733.  slovakmacros 
  6734.  
  6735.  Expanded macro name is not consistent with Slovak naming convention. 
  6736.  
  6737.  plain: - 
  6738.  slovakvars 
  6739.  
  6740.   Variable name is not consistent with Slovak naming convention. 
  6741.  
  6742.  plain: - 
  6743.  slovakconsts 
  6744.  
  6745.   Constant name is not consistent with Slovak naming convention. 
  6746.  
  6747.  plain: - 
  6748.  slovaktypes 
  6749.  
  6750.  Type name is not consistent with Slovak naming convention.  Slovak type names 
  6751.  may not include uppercase letters. 
  6752.  
  6753.  Czechoslovak Naming Convention 
  6754.  
  6755.  shortcut 
  6756.  czechoslovak 
  6757.  
  6758.  Selects complete Czechoslovak naming convention (sets accessczechoslovak, 
  6759.  czechoslovakfcns, czechoslovakvars, czechoslovakconsts, czechoslovakmacros, 
  6760.  and czechoslovaktypes). 
  6761.  
  6762.  plain: - 
  6763.  accessczechoslovak 
  6764.  
  6765.  Allow access to abstract types by Czechoslovak naming convention. The 
  6766.  representation of an abstract type named t is accessible in the definition of 
  6767.  a function or constant named t_name or tName. 
  6768.  
  6769.  plain: - 
  6770.  czechoslovakfcns 
  6771.  
  6772.   Function name is not consistent with Czechoslovak naming convention. 
  6773.  
  6774.  plain: - 
  6775.  czechoslovakmacros 
  6776.  
  6777.  Expanded macro name is not consistent with Czechoslovak naming convention. 
  6778.  
  6779.  plain: - 
  6780.  czechoslovakvars 
  6781.  
  6782.   Variable name is not consistent with Czechoslovak naming convention. 
  6783.  
  6784.  plain: - 
  6785.  czechoslovakconsts 
  6786.  
  6787.   Constant name is not consistent with Czechoslovak naming convention. 
  6788.  
  6789.  plain: - 
  6790.  czechoslovaktypes 
  6791.  
  6792.   Type name is not consistent with Czechoslovak naming convention. Czechoslovak 
  6793.  type names may not include uppercase letters or the underscore character. 
  6794.  
  6795.  Namespace Prefixes  (Section 9.2) 
  6796.  
  6797.   macrovarprefix <prefix string> 
  6798.  
  6799.  Set namespace prefix for variables declared in a macro body.  (Default is m_.) 
  6800.  
  6801.  plain: + 
  6802.  macrovarprefixexclude 
  6803.  
  6804.  A variable declared outside a macro body starts with the macrovarprefix. 
  6805.  
  6806.   tagprefix <prefix string> 
  6807.  
  6808.  Set namespace prefix of struct, union or enum tag identifiers. 
  6809.  
  6810.  plain: - 
  6811.  tagprefixexclude 
  6812.  
  6813.   An identifier that is not a tag starts with the tagprefix. 
  6814.  
  6815.   enumprefix <prefix string> 
  6816.  
  6817.  Set namespace prefix for enum members. 
  6818.  
  6819.  plain: - 
  6820.  enumprefixexclude 
  6821.  
  6822.   An identifier that is not an enum member starts with the enumprefix. 
  6823.  
  6824.   filestaticprefix <prefix string> 
  6825.  
  6826.  Set namespace prefix for file static declarations. 
  6827.  
  6828.  plain: - 
  6829.  filestaticprefixexclude 
  6830.  
  6831.  An identifier that is not file static starts with the filestaticprefix. 
  6832.  
  6833.   globalprefix <prefix string> 
  6834.  
  6835.  Set namespace prefix for global variables. 
  6836.  
  6837.  plain: - 
  6838.  globalprefixexclude 
  6839.  
  6840.  An identifier that is not a global variable starts with the globalprefix. 
  6841.  
  6842.   typeprefix <prefix string> 
  6843.  
  6844.  Set namespace prefix for user-defined types. 
  6845.  
  6846.  plain: - 
  6847.  typeprefixexclude 
  6848.  
  6849.  An identifier that is not a type name starts with the typeprefix. 
  6850.  
  6851.   externalprefix <prefix string> 
  6852.  
  6853.  Set namespace prefix for external identifiers. 
  6854.  
  6855.  plain: - 
  6856.  externalprefixexclude 
  6857.  
  6858.  An identifier that is not external starts with the externalprefix. 
  6859.  
  6860.   localprefix <prefix string> 
  6861.  
  6862.  Set namespace prefix for local variables. 
  6863.  
  6864.  plain: - 
  6865.  localprefixexclude 
  6866.  
  6867.   An identifier that is not a local variable starts with the localprefix. 
  6868.  
  6869.   uncheckedmacroprefix <prefix string> 
  6870.  
  6871.  Set namespace prefix for unchecked macros. 
  6872.  
  6873.  plain: - 
  6874.  uncheckedmacroprefixexclude 
  6875.  
  6876.  An identifier that is not the name of an unchecked macro starts with the 
  6877.  uncheckedmacroprefix. 
  6878.  
  6879.   constprefix <prefix string> 
  6880.  
  6881.  Set namespace prefix for constants. 
  6882.  
  6883.  plain: - 
  6884.  constprefixexclude 
  6885.  
  6886.  An identifier that is not a constant starts with the constantprefix. 
  6887.  
  6888.   iterprefix <prefix string> 
  6889.  
  6890.  Set namespace prefix for iterators. 
  6891.  
  6892.  plain: - 
  6893.  iterprefixexclude 
  6894.  
  6895.  An identifier that is not a iter starts with the iterprefix. 
  6896.  
  6897.   proto-param-prefix <prefix string> 
  6898.  
  6899.  Set namespace prefix for parameters in function prototypes. 
  6900.  
  6901.   plain: - 
  6902.  proto-param-prefix-exclude 
  6903.  
  6904.  An identifier that is not a parameter in a function prototype starts with the 
  6905.  protoprarmprefix. 
  6906.  
  6907.   m: --++ 
  6908.   proto-param-name 
  6909.  
  6910.  A parameter in a function prototype has a name (can interfere with macro 
  6911.  definitions). 
  6912.  
  6913.   m: ---+ 
  6914.   proto-param-match 
  6915.  
  6916.   The name of a parameter in a function definition does not match the 
  6917.  corresponding name of the parameter in a function prototype (after removing 
  6918.  the protoparamprefix). 
  6919.  
  6920.   Naming Restrictions  (Section 9.3) 
  6921.  
  6922.  m: -+++ 
  6923.  shadow 
  6924.  
  6925.  Declaration reuses name visible in outer scope. 
  6926.  
  6927.  Reserved Names 
  6928.  
  6929.  m: --++ 
  6930.  ansi-reserved 
  6931.  
  6932.  External name conflicts with name reserved for the compiler or standard 
  6933.  library. 
  6934.  
  6935.  m: ---+ 
  6936.  ansi-reserved-internal 
  6937.  
  6938.   Internal name conflicts with name reserved for the compiler or standard 
  6939.  library. 
  6940.  
  6941.   m: --++ 
  6942.  cpp-names 
  6943.  
  6944.  Internal or external name conflicts with a C++ reserved word.  (Will cause 
  6945.  problems if program is compiled with a C++ compiler.) 
  6946.  
  6947.   Distinct External Names 
  6948.  
  6949.  plain: - 
  6950.  distinct-external-names 
  6951.  
  6952.  An external name is not distinguishable from another external name using 
  6953.  externalnamelen significant characters. 
  6954.  
  6955.   external-name-len<number> 
  6956.  
  6957.  Sets the number of significant characters in an external name (ANSI default 
  6958.  minimum is 6).  Sets +distinctexternalnames. 
  6959.  
  6960.  plain: - 
  6961.  external-name-case-insensitive 
  6962.  
  6963.  Make alphabetic case insignificant in external names.  According to ANSI 
  6964.  standard, case need not be significant in an external name.  If 
  6965.  +distinctexternalnames is not set, sets +distinctexternalnames  with unlimited 
  6966.  external name length. 
  6967.  
  6968.  Distinct Internal Names 
  6969.  
  6970.  m: ---- 
  6971.  distinct-internal-names 
  6972.  
  6973.  An internal name is not distinguishable from another internal name using 
  6974.  internalnamelen significant characters.  (Also effected by 
  6975.  internalnamecaseinsensitive and internalnamelookalike.) 
  6976.  
  6977.   internal-name-len <number> 
  6978.  
  6979.  Set the number of significant characters in an internal name. Sets 
  6980.  +distinctinternalnames. 
  6981.  
  6982.  plain: - 
  6983.  internal-name-case-insensitive 
  6984.  
  6985.  Set whether case is significant an internal names 
  6986.  (-internalnamecaseinsensitive means case is significant).  If 
  6987.  +distinctinternalnames is not set, sets +distinct-internal-names with 
  6988.  unlimited internal name length. 
  6989.  
  6990.  plain: - 
  6991.  internalnamelookalike 
  6992.  
  6993.   Set whether similar looking characters (e.g., "1" and "l") match in internal 
  6994.  names. 
  6995.  
  6996.  Other Checks 
  6997.  
  6998.  Undefined Evaluation Order  (Section 10.1) 
  6999.  
  7000.  m: -+++ 
  7001.  evalorder 
  7002.  
  7003.  Behavior of an expression is undefined because sub-expressions contain 
  7004.  interfering side effects that may be evaluated in any order. 
  7005.  
  7006.  m: ---+ 
  7007.  evalorderuncon 
  7008.  
  7009.  An expression may be undefined because a sub-expression contains a call to an 
  7010.  unconstrained function (no modifies clause) that may modify something that may 
  7011.  be modified or used by another sub-expression. 
  7012.  
  7013.  Problematic Control Structures (Section 10.2) 
  7014.  
  7015.  m: -+++ 
  7016.   infloops 
  7017.  
  7018.  Likely infinite loop is detected (Section 10.2.1). 
  7019.  
  7020.  m: --++ 
  7021.   infloopsuncon 
  7022.  
  7023.  Likely infinite loop is detected.  Loop test or body calls an unconstrained 
  7024.  function, that may produce an undetected modification. 
  7025.  
  7026.  m: ---+ 
  7027.  elseifcomplete 
  7028.  
  7029.  There is no final else following an else if construct (Section 10.2.5). 
  7030.  
  7031.  m: -+++ 
  7032.  casebreak 
  7033.  
  7034.  These is a non-empty case in a switch not followed by a break (Section 
  7035.  10.2.2). 
  7036.  
  7037.  m: -+++ 
  7038.  misscase 
  7039.  
  7040.  A switch on an enum type is missing a case for a member of the enumerator. 
  7041.  
  7042.  m: ---- 
  7043.  loopexec 
  7044.  
  7045.  Assume all loops execute at least once.  This effects use-before-definition 
  7046.  and memory checking.  It should probably not be used globally, but may be used 
  7047.  surrounding a particular loop that is known to always execute to prevent 
  7048.  spurious messages. 
  7049.  
  7050.  Deep Break  (Section 10.2.3) 
  7051.  
  7052.  shortcut 
  7053.  deepbreak 
  7054.  
  7055.  Report errors for break statements inside a nested while, for or switch. 
  7056.  (Sets all nested break and continue flags.) 
  7057.  
  7058.  m: --++ 
  7059.  looploopbreak 
  7060.  
  7061.  There is a break inside a while, for or iterator loop that is inside a while, 
  7062.  for or iterator loop. Mark with /*@innerbreak@*/ to suppress the message. 
  7063.  
  7064.  m: --++ 
  7065.  switchloopbreak 
  7066.  
  7067.  There is a break inside a while, for or iterator loop that is inside a switch 
  7068.  statement.  Mark with /*@loopbreak@*/. 
  7069.  
  7070.  m: ---+ 
  7071.  loopswitchbreak 
  7072.  
  7073.  There is a break inside a switch statement that is inside a while, for or 
  7074.  iterator loop.  Mark with /*@switchbreak@*/. 
  7075.  
  7076.  m: ---+ 
  7077.  switchswitchbreak 
  7078.  
  7079.  There is a break inside a switch statement that is inside another switch 
  7080.  statement.  Mark with  /*@innerbreak@*/. 
  7081.  
  7082.  m: ---+ 
  7083.  looploopcontinue 
  7084.  
  7085.  There is a continue inside a while, for or iterator loop that is inside a 
  7086.  while, for or iterator loop.  Mark with /*@innercontinue@*/. 
  7087.  
  7088.  Loop and if Bodies  (Section 10.2.4) 
  7089.  
  7090.  shortcut 
  7091.  allempty 
  7092.  
  7093.  An if, while or for statement has no body (sets ifempty, whileempty and 
  7094.  forempty.) 
  7095.  
  7096.  shortcut 
  7097.  allblock 
  7098.  
  7099.  The body of an if, while or for statement is not a block (sets ifblock, 
  7100.  whileblock and forblock.) 
  7101.  
  7102.  m: --++ 
  7103.  whileempty 
  7104.  
  7105.  A while statement has no body. 
  7106.  
  7107.  m: ---+ 
  7108.  whileblock 
  7109.  
  7110.   The body of a while statement is not a block 
  7111.  
  7112.  m: ---+ 
  7113.  forempty 
  7114.  
  7115.  A for statement has no body. 
  7116.  
  7117.  m: ---+ 
  7118.  forblock 
  7119.  
  7120.  The body of a for statement is not a block. 
  7121.  
  7122.  m: ++++ 
  7123.  ifempty 
  7124.  
  7125.  An if statement has no body. 
  7126.  
  7127.  m: ---+ 
  7128.  ifblock 
  7129.  
  7130.  The body of an if statement is not a block. 
  7131.  
  7132.  Suspicious Statements  (Section 10.3) 
  7133.  
  7134.  m: -+++ 
  7135.  unreachable 
  7136.  
  7137.  Code is not reached on any possible execution. 
  7138.  
  7139.  m: -+++ 
  7140.  noeffect 
  7141.  
  7142.  Statement has no effect. 
  7143.  
  7144.  m: ---+ 
  7145.  noeffectuncon 
  7146.  
  7147.  Statement involving call to unconstrained function may have no effect. 
  7148.  
  7149.  m: -+++ 
  7150.  noret 
  7151.  
  7152.  There is a path with no return in a function declared to return a non-void 
  7153.  value. 
  7154.  
  7155.  Ignored Return Values  (Section 10.3.2) 
  7156.  
  7157.  These flags control when errors are reported for function calls that do not 
  7158.  use the return value.  Casting the function call to void or declaring the 
  7159.  called function to return /*@alt void@*/. 
  7160.  
  7161.  m: -+++ 
  7162.  retvalbool 
  7163.  
  7164.  Return value of type bool ignored. 
  7165.  
  7166.  m: -+++ 
  7167.  retvalint 
  7168.  
  7169.  Return value of type int ignored. 
  7170.  
  7171.  m: ++++ 
  7172.  retvalother 
  7173.  
  7174.  Return value of type other than bool or int ignored. 
  7175.  
  7176.  shortcut 
  7177.  retval 
  7178.  
  7179.  Return value ignored  (Sets retvalbool, retvalint, retvalother.) 
  7180.  
  7181.  Unused Declarations  (Section 10.4) 
  7182.  
  7183.  These flags control when errors are reported for declarations that are never 
  7184.  used.  The unused annotation can be used to prevent unused errors from being 
  7185.  report for a particular declaration. 
  7186.  
  7187.  m: ---+ 
  7188.  topuse 
  7189.  
  7190.  A external declaration is not used in any file. 
  7191.  
  7192.  m: -+++ 
  7193.  constuse 
  7194.  
  7195.  Constant never used. 
  7196.  
  7197.  m: -+++ 
  7198.  enummemuse 
  7199.  
  7200.  Member of enumerator never used. 
  7201.  
  7202.  m: ++++ 
  7203.  varuse 
  7204.  
  7205.  Variable never used. 
  7206.  
  7207.  m: -+++ 
  7208.  paramuse 
  7209.  
  7210.  Function parameter never used. 
  7211.  
  7212.  m: ++++ 
  7213.  fcnuse 
  7214.  
  7215.  Function is never used. 
  7216.  
  7217.  m: ++++ 
  7218.  typeuse 
  7219.  
  7220.  Defined type never used. 
  7221.  
  7222.  m: -+++ 
  7223.  fielduse 
  7224.  
  7225.  Field of structure or union type is never used. 
  7226.  
  7227.  m: ---+ 
  7228.  unusedspecial 
  7229.  
  7230.  Declaration in a special file (corresponding to .l or .y file) is unused. 
  7231.  
  7232.  Complete Programs  (Section 10.5) 
  7233.  
  7234.  m: --++ 
  7235.  declundef 
  7236.  
  7237.  Function, variable, iterator or constant declared but never defined. 
  7238.  
  7239.  shortcut 
  7240.  partial 
  7241.  
  7242.  Check as partial system (sets -declundef, -exportlocal and prevents checking 
  7243.  of macros in headers without corresponding .c files.) 
  7244.  
  7245.  Exports 
  7246.  
  7247.  m: ---+ 
  7248.  export-local 
  7249.  
  7250.  A declaration is exported but not used outside this module.  (Declaration can 
  7251.  use the static qualifier.) 
  7252.  
  7253.  m: --++ 
  7254.  export-header 
  7255.  
  7256.  A declaration (other than a variable) is exported but does not appear in a 
  7257.  header file. 
  7258.  
  7259.  m: --++ 
  7260.  export-header-var 
  7261.  
  7262.  A variable declaration is exported but does not appear in a header file. 
  7263.  
  7264.  Unrecognized Identifiers 
  7265.  
  7266.  plain: + 
  7267.  unrecog 
  7268.  
  7269.  An unrecognized identifier is used. 
  7270.  
  7271.  plain: + 
  7272.  sys-unrecog 
  7273.  
  7274.  Report unrecognized identifiers that start with the system prefix, __ (two 
  7275.  underscores). 
  7276.  
  7277.  plain: - 
  7278.  repeat-unrecog 
  7279.  
  7280.  Report multiple messages for unrecognized identifiers.  If repeatunrecog is 
  7281.  not set, an error is reported only the first time a particular unrecognized 
  7282.  identifier appears in the file. 
  7283.  
  7284.  Multiple Definition and Declarations 
  7285.  
  7286.  plain: + 
  7287.  redef 
  7288.  
  7289.  A function or variable is defined more than once. 
  7290.  
  7291.  m: --++ 
  7292.  redecl 
  7293.  
  7294.  An identifier is declared more than once. 
  7295.  
  7296.  m: -+++ 
  7297.  nested-extern 
  7298.  
  7299.  An extern declaration is used inside a function body. 
  7300.  
  7301.   ANSI C Conformance 
  7302.  
  7303.    m: --++ 
  7304.  noparams 
  7305.  
  7306.  A function is declared without a parameter list prototype. 
  7307.  
  7308.  m: ---+ 
  7309.  oldstyle 
  7310.  
  7311.  Function definition is in old style syntax.  Standard prototype syntax is 
  7312.  preferred. 
  7313.  
  7314.  m: -+++ 
  7315.  exitarg 
  7316.  
  7317.  Argument to exit has implementation defined behavior.  The only valid 
  7318.  arguments to exit are EXIT_SUCCESS, EXIT_FAILURE and 0.  An error is reported 
  7319.  if LCLint can detect statically that the argument to exit is not one of these. 
  7320.  
  7321.  Limits (Section 10.6) 
  7322.  
  7323.  shortcut 
  7324.  ansilimits 
  7325.  
  7326.  Check for violations of standard limits (Sets controlnestdepth, 
  7327.  stringliterallen, includenest, numstructfields, and numenummembers). 
  7328.  
  7329.  m: ---+ 
  7330.  
  7331.   controlnestdepth <number> 
  7332.  
  7333.  Set maximum nesting depth of compound statements, iteration control 
  7334.  structures, and selection control structures (ANSI minimum is 15). 
  7335.  
  7336.  m: ---+ 
  7337.   stringliterallen <number> 
  7338.  
  7339.  Set maximum length of string literals (ANSI minimum is 509). 
  7340.  
  7341.  m: ---+ 
  7342.   numstructfields <number> 
  7343.  
  7344.  Set maximum number of fields in a struct or union (ANSI minimum is 127). 
  7345.  
  7346.  m: ---+ 
  7347.   numenummembers <number> 
  7348.  
  7349.  Set maximum number of members of an enum type (ANSI minimum is 127). 
  7350.  
  7351.  m: --++ 
  7352.   includenest <number> 
  7353.  
  7354.  Set maximum number of nested #include files (ANSI minimum is 8). 
  7355.  
  7356.  Header Inclusion (Apppendix F) 
  7357.  
  7358.   plain: + 
  7359.   skip-ansi-headers 
  7360.  
  7361.   Prevent inclusion of header files in a system directory with names that match 
  7362.  standard ANSI headers. The symbolic information in the standard library is 
  7363.  used instead.  In effect only if a library that includes the ANSI library is 
  7364.  used.  The ANSI headers are: assert, ctype, errno, float, limits, locale, 
  7365.  math, setjmp, signal, stdarg, stddef, stdio, stdlib, strings, string, time, 
  7366.  and wchar. 
  7367.  
  7368.   plain: + 
  7369.   skip-posix-headers 
  7370.  
  7371.   Prevent inclusion of header files in a system directory with names that match 
  7372.  standard POSIX headers. The symbolic information in the standard library is 
  7373.  used instead.  In effect only if a library that includes the POSIX library is 
  7374.  used.  The POSIX headers are: dirent, fcntl, grp, pwd, termios, sys/stat, 
  7375.  sys/times, sys/types, sys/utsname, sys/wait, unistd, and utime. 
  7376.  
  7377.  plain: + 
  7378.   warn-posix-headers 
  7379.  
  7380.  Report use of a POSIX header when checking a program with a non-POSIX library. 
  7381.  
  7382.  skipsysheaders 
  7383.  
  7384.  Do not include header files in system directories (as set by -sysdirs) 
  7385.  
  7386.  plain: + 
  7387.   sys-dir-expand-macros 
  7388.  
  7389.  Expand macros in system directories regardless of other settings, except for 
  7390.  macros corresponding to names defined in a load library. 
  7391.  
  7392.  m: ---+ 
  7393.  sys-dir-errors 
  7394.  
  7395.  Report errors in files in system directories (set by -systemdirs). 
  7396.  
  7397.   single-include 
  7398.  
  7399.  Optimize header inclusion to only include each header file once. 
  7400.  
  7401.  never-include 
  7402.  
  7403.  Use library information instead of including header files. 
  7404.  
  7405.   Comments 
  7406.  
  7407.  These flags control how syntactic comments are interpreted (see Apppendix E). 
  7408.  
  7409.   commentchar <char> 
  7410.  
  7411.  Set the marker character for syntactic comments.  Comments beginning with 
  7412.  /*<char> are interpreted by LCLint.  Default: @ 
  7413.  
  7414.  plain: - 
  7415.  noaccess 
  7416.  
  7417.  Ignore access comments. 
  7418.  
  7419.  plain: - 
  7420.  nocomments 
  7421.  
  7422.  Ignore all stylized comments. 
  7423.  
  7424.  plain: + 
  7425.  supcounts 
  7426.  
  7427.  Actual number of errors does not match number in /*@i<n>@*/ 
  7428.  
  7429.  plain: + 
  7430.  lintcomments 
  7431.  
  7432.  Interpret traditional lint comments (/*FALLTHROUGH*/, /*NOTREACHED*/, 
  7433.  /*PRINTLIKE*/). 
  7434.  
  7435.  m: -+++ 
  7436.  warnlintcomments 
  7437.  
  7438.  Print a warning and suggest an alternative when a traditional lint comment is 
  7439.  used. 
  7440.  
  7441.  plain: + 
  7442.   unrecogcomments 
  7443.  
  7444.  Stylized comment is unrecognized. 
  7445.  
  7446.  Parsing 
  7447.  
  7448.  plain: - 
  7449.   continue-comment 
  7450.  
  7451.  A line continuation marker (\) appears inside a comment on the same line as 
  7452.  the comment close. Preprocessors should handle this correctly, but it causes 
  7453.  problems for some preprocessors.  plain: + 
  7454.   nest-comment 
  7455.  
  7456.  A comment open sequence (/*) appears inside a comment.  This usually indicates 
  7457.  that an earlier comment was not closed. 
  7458.  
  7459.   plain: + 
  7460.   duplicate-quals 
  7461.  
  7462.   Report duplicate type qualifiers (e.g., long long).  Duplicate type 
  7463.  qualifiers not supported by ANSI, but some compilers (e.g., gcc) do support 
  7464.  duplicate qualifiers. 
  7465.  
  7466.  plain: + 
  7467.   gnu-extensions 
  7468.  
  7469.  Support some GNU (gcc) and Microsoft language extensions. 
  7470.  
  7471.   Array Formal Parameters 
  7472.  
  7473.   These flags control reporting of common errors caused by confusion about the 
  7474.  semantics of array formal parameters. 
  7475.  
  7476.   General Checks 
  7477.  
  7478.   plain: + 
  7479.  sizeof-formal-array 
  7480.  
  7481.  The sizeof operator is used on a parameter declared as an array.  (In many 
  7482.  instances this has unexpected behavior, since the result is the size of a 
  7483.  pointer to the element type, not the number of elements in the array.) 
  7484.  
  7485.   plain: + 
  7486.  fixed-formal-array 
  7487.  
  7488.   An array formal parameter is declared with a fixed size (e.g., int x[20]). 
  7489.  This is likely to be confusing, since the size is ignored. 
  7490.  
  7491.   plain: - 
  7492.  formal-array 
  7493.  
  7494.  A formal parameter is declared as an array.  This is probably not a problem, 
  7495.  but can be confusing since it is treated as a pointer. 
  7496.  
  7497.   These flags should probably not be set globally since the turn off general 
  7498.  checks that should always be done.  They may be used locally to suppress 
  7499.  spurious errors. 
  7500.  
  7501.  plain: + 
  7502.  abstract 
  7503.  
  7504.  A data abstraction barrier is violated. 
  7505.  
  7506.  plain: + 
  7507.  control 
  7508.  
  7509.  A control flow error is detected. 
  7510.  
  7511.  plain: + 
  7512.  syntax 
  7513.  
  7514.  Parse error. 
  7515.  
  7516.  plain: - 
  7517.  trytorecover 
  7518.  
  7519.  Try to recover from a parse error.  If trytorecover is not set, LCLint will 
  7520.  abort checking after a parse error is detected.  If it is set, LCLint will 
  7521.  attempt to recover, but LCLint does performs only minimal error recovery. 
  7522.  
  7523.  plain: + 
  7524.  type 
  7525.  
  7526.  Type mismatch. 
  7527.  
  7528.  Flag Name Abbreviations 
  7529.  
  7530.  Within a flag name, abbreviations may be used. Table 2 shows the flag name 
  7531.  abbreviations.  The expanded and short forms are interchangeable in flag 
  7532.  names. 
  7533.  
  7534.  For example, globsimpmodsnothing and globalsimpliesmodifiesnothing denote the 
  7535.  same flag.  Abbreviations in flag names allow pronounceable, descriptive names 
  7536.  to be used without making flag names excessively long (although one must admit 
  7537.  even globsimpmodsnothing is a bit of a mouthful.) 
  7538.  
  7539.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7540.   ΓöéExpanded Form                         ΓöéShort Form                            Γöé
  7541.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7542.   Γöéconstant                              Γöé                       const          Γöé
  7543.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7544.   Γöédeclaration                           Γöé                   decl               Γöé
  7545.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7546.   Γöéfunction                              Γöé     fcn                              Γöé
  7547.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7548.   Γöéglobal                                Γöé                              glob    Γöé
  7549.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7550.   Γöéimplicit, implied                     Γöé        imp                           Γöé
  7551.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7552.   Γöéiterator                              Γöé       iter                           Γöé
  7553.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7554.   Γöélength                                Γöé   len                                Γöé
  7555.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7556.   Γöémodifies                              Γöé        mods                          Γöé
  7557.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7558.   Γöémodify                                Γöé      mod                             Γöé
  7559.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7560.   Γöémemory                                Γöé   mem                                Γöé
  7561.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7562.   Γöéparameter                             Γöé    param                             Γöé
  7563.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7564.   Γöépointer                               Γöé    ptr                               Γöé
  7565.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7566.   Γöéreturn                                Γöé    ret                               Γöé
  7567.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7568.   Γöévariable                              Γöé   var                                Γöé
  7569.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7570.   Γöéunconstrained, unconst                Γöé    uncon                             Γöé
  7571.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7572.    Table 2.  Flag name abbreviations. 
  7573.  
  7574.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7575.  
  7576.   David Evans 
  7577.  Software Devices and Systems 
  7578.  evs@sds.lcs.mit.edu 
  7579.  
  7580.  
  7581. ΓòÉΓòÉΓòÉ 1.14. LCLint User's Guide - Appendix D  Annotations ΓòÉΓòÉΓòÉ
  7582.  
  7583.  
  7584.  
  7585. Appendix D  Annotations 
  7586.  
  7587. The grammar below is the C syntax from [K&R,A13] modified to show the syntax of 
  7588. syntactic comments.  Only productions effected by LCLint annotations are shown. 
  7589. In the annotations, the @ represents the comment marker char, set by 
  7590. -commentchar (default is @). 
  7591.  
  7592. Functions 
  7593.  
  7594. direct-declarator: 
  7595.  
  7596.           direct-declarator (parameter-type-list_opt) globals_opt modifies_opt
  7597.         | direct-declarator (identifier-list_opt) globals_opt modifies_opt
  7598.  
  7599. globals: (Section 4.2) 
  7600.  
  7601.           /*@globals globitem,+ ;_opt @*/
  7602.         | /*@globals declaration-list_opt ;_opt @*/
  7603. globitem: 
  7604.  
  7605.            globannot* identifier
  7606.         |  internalState
  7607.         |  systemState
  7608.  
  7609. globannot: undef | killed 
  7610.  
  7611. modifies: (Section 4.1) 
  7612.  
  7613.            /*@modifies moditem,+;_opt @*/
  7614.          | /*@modifies nothing ;_opt @*/
  7615.          | /*@*/  (Abbreviation for no globals and modifies nothing.)
  7616.  
  7617. moditem: 
  7618.  
  7619.            expression
  7620.          | internalState
  7621.          | systemState
  7622.  
  7623. Iterators (Section 8.4) 
  7624.  
  7625. The globals and modifies clauses for an iterator are the same as those for a 
  7626. function, except they are not enclosed by a comment, since the iterator is 
  7627. already a comment. 
  7628.  
  7629. direct-declarator: 
  7630.  
  7631.        /*@iter identifier (parameter-type-list_opt) globals_opt
  7632. modifies_opt @*/
  7633.  
  7634. Constants (Section 8.1) 
  7635.  
  7636. external-declaration: 
  7637.  
  7638.        /*@constant declaration ;_opt @*/
  7639.  
  7640. Alternate Types (Section 8.2.2) 
  7641.  
  7642. Alternate types may be used in the type specification of parameters and return 
  7643. values. 
  7644.  
  7645. extended-type: 
  7646.  
  7647.         type-specifier alt-type_opt
  7648.  
  7649. alt-type: 
  7650.  
  7651.         /*@alt basic-type,+ @*/
  7652.  
  7653. Declarator Annotations 
  7654.  
  7655. General annotations appear after storage-class-specifiers and before 
  7656. type-specifiers.  Multiple annotations may be used in any order.  Here, 
  7657. annotations are without the surrounding comment.  In a declaration, the 
  7658. annotation would be surrounded by /*@ and @*/.  In a globals or modifies clause 
  7659. or iterator or constant declaration, no surrounding comment would be used since 
  7660. they are within a comment. 
  7661.  
  7662. Type Definitions  (Section 3) 
  7663.  
  7664. A type definition may use any either abstract or concrete, either mutable or 
  7665. immutable, and refcounted.  Only a pointer to a struct may be declared with 
  7666. refcounted.  Mutability annotations may not be used with concrete types since 
  7667. concrete types inherit their mutability from the actual type. 
  7668.  
  7669. abstract 
  7670.  
  7671. Type is abstract (representation is hidden from clients). 
  7672.  
  7673. concrete 
  7674.  
  7675. Type is concrete (representation is visible to clients). 
  7676.  
  7677. immutable 
  7678.  
  7679. Instances of the type cannot change value.  (Section 3.2) 
  7680.  
  7681. mutable 
  7682.  
  7683. Instances of the type can change value.  (Section 3.2) 
  7684.  
  7685. refcounted 
  7686.  
  7687. Reference counted type.  (Section 5.4) 
  7688.  
  7689. Global Variables  (Section 4.2.1) 
  7690.  
  7691. One check annotation may be used on a global or file-static variable 
  7692. declaration. 
  7693.  
  7694. unchecked 
  7695.  
  7696. Weakest checking for global use. 
  7697.  
  7698. checkmod 
  7699.  
  7700. Check modification by not use of global. 
  7701.  
  7702. checked 
  7703.  
  7704. Check use and modification of global. 
  7705.  
  7706. checkedstrict 
  7707.  
  7708. Check use of global, even in functions with no global list. 
  7709.  
  7710. Memory Management  (Section 5) 
  7711.  
  7712. dependent 
  7713.  
  7714. A reference to externally-owned storage.  (Section 5.2.2) 
  7715.  
  7716. keep 
  7717.  
  7718. A parameter that is kept by the called function.  The caller may use the 
  7719. storage after the call, but the called function is responsible for making sure 
  7720. it is deallocated.  (Section 5.2.4) 
  7721.  
  7722. killref 
  7723.  
  7724. A refcounted parameter.  This reference is killed by the call. (Section 5.4) 
  7725.  
  7726. only 
  7727.  
  7728. A unshared reference.  Associated memory must be released before reference is 
  7729. lost.  (Section 5.2) 
  7730.  
  7731. owned 
  7732.  
  7733. Storage may be shared by dependent references, but associated memory must be 
  7734. released before this reference is lost.  (Section 5.2.2) 
  7735.  
  7736. shared 
  7737.  
  7738. Shared reference that is never deallocated.  (Section 5.2.5) 
  7739.  
  7740. temp 
  7741.  
  7742. A temporary parameter.  May not be released, and new aliases to it may not be 
  7743. created.  (Section 5.2.2) 
  7744.  
  7745. Aliasing  (Section 6) 
  7746.  
  7747. Both alias annotations may be used on a parameter declaration. 
  7748.  
  7749. unique 
  7750.  
  7751. Parameter that may not be aliased by any other reference visible to the 
  7752. function. (Section 6.1.1) 
  7753.  
  7754. returned 
  7755.  
  7756. Parameter that may be aliased by the return value.  (Section 6.1.2) 
  7757.  
  7758. Exposure  (Section 6.2) 
  7759.  
  7760. observer 
  7761.  
  7762. Reference that cannot be modified.  (Section 6.2.1) 
  7763.  
  7764. exposed 
  7765.  
  7766. Exposed reference to storage in another object. (Section 6.2.1) 
  7767.  
  7768. Definition State  (Section 7.1) 
  7769.  
  7770. out 
  7771.  
  7772. Storage reachable from reference need not be defined. 
  7773.  
  7774. in 
  7775.  
  7776. All storage reachable from reference must be defined. 
  7777.  
  7778. partial 
  7779.  
  7780. Partially defined.  A structure may have undefined fields.  No errors reported 
  7781. when fields are used. 
  7782.  
  7783. reldef 
  7784.  
  7785. Relax definition checking.  No errors when reference is not defined, or when it 
  7786. is used. 
  7787.  
  7788. Global State  (Section 7.1.4) 
  7789.  
  7790. These annotations may only be used in globals lists.  Both annotations may be 
  7791. used for the same variable, to mean the variable is undefined before and after 
  7792. the call. 
  7793.  
  7794. undef 
  7795.  
  7796. Variable is undefined before the call. 
  7797.  
  7798. killed 
  7799.  
  7800. Variable is undefined after the call. 
  7801.  
  7802. Null State  (Section 7.2) 
  7803.  
  7804. null 
  7805.  
  7806. Possibly null pointer. 
  7807.  
  7808. notnull 
  7809.  
  7810. Non-null pointer. 
  7811.  
  7812. relnull 
  7813.  
  7814. Relax null checking.  No errors when NULL is assigned to it, or when it is used 
  7815. as a non-null pointer. 
  7816.  
  7817. Null Predicates  (Section 7.2.1) 
  7818.  
  7819. A null predicate annotation may be used of the return value of a function 
  7820. returning a boolean type, taking a possibly-null pointer for its first 
  7821. argument. 
  7822.  
  7823. truenull 
  7824.  
  7825. If result is TRUE, first parameter is NULL. 
  7826.  
  7827. falsenull 
  7828.  
  7829. If result is TRUE, first parameter is not NULL. 
  7830.  
  7831. Execution  (Section 7.3) 
  7832.  
  7833. The exits, mayexit and neverexits annotations may be used on any function.  The 
  7834. trueexit and falseexit annotations may only be used on functions whose first 
  7835. argument is a boolean. 
  7836.  
  7837. exits 
  7838.  
  7839. Function never returns. 
  7840.  
  7841. mayexit 
  7842.  
  7843. Function may or may not return. 
  7844.  
  7845. trueexit 
  7846.  
  7847. Function does not return if first parameter is TRUE. 
  7848.  
  7849. falseexit 
  7850.  
  7851. Function does not return if first parameter if FALSE. 
  7852.  
  7853. neverexit 
  7854.  
  7855. Function always returns. 
  7856.  
  7857. Side-Effects  (Section 8.2.1) 
  7858.  
  7859. sef 
  7860.  
  7861. Corresponding actual parameter has no side effects. 
  7862.  
  7863. Declaration 
  7864.  
  7865. These annotations can be used on a declaration to control unused or undefined 
  7866. error reporting. 
  7867.  
  7868. unused 
  7869.  
  7870. Identifier need not be used (no unused errors reported.)  (Section 10.4) 
  7871.  
  7872. external 
  7873.  
  7874. Identifier is defined externally (no undefined error reported.) (Section 10.5) 
  7875.  
  7876. Case 
  7877.  
  7878. fallthrough 
  7879.  
  7880. Fall-through case.  No message is reported if the previous case may 
  7881. fall-through into the one immediately after the fallthrough. 
  7882.  
  7883. Break  (Section 10.2.3) 
  7884.  
  7885. These annotations are used before a break or continue statement. 
  7886.  
  7887. innerbreak 
  7888.  
  7889. Break is breaking an inner loop or switch. 
  7890.  
  7891. loopbreak 
  7892.  
  7893. Break is breaking a loop. 
  7894.  
  7895. switchbreak 
  7896.  
  7897. Break is breaking a switch. 
  7898.  
  7899. innercontinue 
  7900.  
  7901. Continue is continuing an inner loop. 
  7902.  
  7903. Unreachable Code 
  7904.  
  7905. This annotation is used before a statement to prevent unreachable code errors. 
  7906.  
  7907. notreached 
  7908.  
  7909. Statement may be unreachable. 
  7910.  
  7911. Special Functions (Apppendix E) 
  7912.  
  7913. These annotations are used immediately before a function declaration. 
  7914.  
  7915. printflike 
  7916.  
  7917. Check variable arguments like printf library function. 
  7918.  
  7919. scanflike 
  7920.  
  7921. Check variable arguments like scanf library function. 
  7922.  
  7923. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  7924.  
  7925.  David Evans 
  7926. Software Devices and Systems 
  7927. evs@sds.lcs.mit.edu 
  7928.  
  7929.  
  7930. ΓòÉΓòÉΓòÉ 1.15. LCLint User's Guide - Appendix E  Control Comments ΓòÉΓòÉΓòÉ
  7931.  
  7932.  
  7933.  
  7934. Appendix E  Control Comments 
  7935.  
  7936. Error Suppression 
  7937.  
  7938. Several comments are provided for suppressing messages.  In general, it is 
  7939. usually better to use specific flags to suppress a particular error 
  7940. permanently, but the general error suppression flags may be more convenient for 
  7941. quickly suppressing messages for code that will be corrected or documented 
  7942. later. 
  7943.  
  7944. ignore 
  7945. end 
  7946.  
  7947. No errors will be reported in code regions between /*@ignore@*/ and /*@end@*/. 
  7948. These comments can be used to easily suppress an unlimited number of messages, 
  7949. but are dangerous since if real errors are introduced in the ignore ... end 
  7950. region they will not be reported. The ignore and end comments must be matched - 
  7951. a warning is printed if the file ends in an ignore region or if ignore is used 
  7952. inside ignore region.  i 
  7953.  
  7954. No errors will be reported from an /*@i@*/ comment to the end of the line. 
  7955.  
  7956.  i<n> 
  7957.  
  7958.  No errors will be reported from an /*@i<n>@*/ (e.g., /*@i3@*/) comment to the 
  7959. end of the line. If there are not exactly n errors suppressed from the comment 
  7960. point to the end of the line, LCLint will report an error.  This is more robust 
  7961. than i or ignore since a message is generated if the expected number errors is 
  7962. not present.  Since errors are not necessarily detected until after this file 
  7963. is processed (for example, and unused variable error), suppress count errors 
  7964. are reported after all files have been processed. The -supcounts flag may be 
  7965. used to suppress these errors.  This is useful when a system if being rechecked 
  7966. with different flag settings.  t 
  7967. t<n> 
  7968.  
  7969. Like i and i<n>, except controlled by +tmpcomments flag.  These can be used to 
  7970. temporarily suppress certain errors.  Then, -tmpcomments can be set to find 
  7971. them again. 
  7972.  
  7973. Type Access 
  7974.  
  7975. Control comments may also be used to override type access settings. The syntax 
  7976. /*@access <type>,+@*/ allows the following code to access the representation of 
  7977. <type>.  Similarly, /*@noaccess <type>,+@*/ restricts access to the 
  7978. representation of <type>.  The type in a noaccess comment must have been 
  7979. declared as an abstract type.  Type access applies from the point of the 
  7980. comment to the end of the file or the next access control comment for this 
  7981. type. 
  7982.  
  7983. Macro Expansion 
  7984.  
  7985. The /*@notfunction@*/indicates that the next macro definition is not intended 
  7986. to be a function, and should be expanded in line instead of checked as a macro 
  7987. function definition. 
  7988.  
  7989. Traditional Lint Comments 
  7990.  
  7991. Some of the control comments supported by most standard UNIX lints are 
  7992. supported by LCLint so legacy systems can be checked more easily. These 
  7993. comments are not lexically consistent with LCLint comments, and their meanings 
  7994. are less precise (and may vary between different lint programs), so we 
  7995. recommend that LCLint comments are used instead except for checking legacy 
  7996. systems already containing standard lint comments. 
  7997.  
  7998. These standard lint comments supported by LCLint: 
  7999.  
  8000. /*FALLTHROUGH*/ (alternate misspelling, /*FALLTHRU*/) 
  8001.  
  8002. Prevents errors for fall-through cases.  Same meaning as /*@fallthrough@*/. 
  8003. /*NOTREACHED*/ 
  8004.  
  8005. Prevents errors about unreachable code (until the end of the function).  Same 
  8006. meaning as /*@notreached@*/.  /*PRINTFLIKE*/ 
  8007.  
  8008. Arguments similar to the printf library function (there didn't seem to be much 
  8009. of a consensus among standard lints as to exactly what this means).  LCLint 
  8010. supports: 
  8011.  
  8012. /*@printflike@*/ 
  8013.  
  8014. Function takes zero or more arguments of any type, an unmodified char * format 
  8015. string argument and zero of more arguments of type and number dictated by the 
  8016. format string.  Format codes are interpreted identically to the printf standard 
  8017. library function.  May return a result of any type.  (LCLint interprets 
  8018. /*PRINTFLIKE*/ as /*@printflike@*/.) 
  8019.  
  8020.  /*@scanflike@*/ 
  8021.  
  8022. Like printflike, except format codes are interpreted as in the scanf library 
  8023. function.  /*ARGSUSED*/ 
  8024.  
  8025. Turns off unused parameter messages for this function.  The control comment, 
  8026. /*@-paramuse@*/ can be used to the same effect, or /*@unused@*/ can be used in 
  8027. individual parameter declarations. 
  8028.  
  8029. LCLint will ignore standard lint comments if -lintcomments is used. If 
  8030. +warnlintcomments is used, LCLint generates a message for standard lint 
  8031. comments and suggest replacements, 
  8032.  
  8033. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  8034.  
  8035.  David Evans 
  8036. Software Devices and Systems 
  8037. evs@sds.lcs.mit.edu 
  8038.  
  8039.  
  8040. ΓòÉΓòÉΓòÉ 1.16. LCLint User's Guide - Appendix F  Libraries ΓòÉΓòÉΓòÉ
  8041.  
  8042.  
  8043.  
  8044. Appendix F  Libraries 
  8045.  
  8046. Libraries can be used to record interface information.  A library containing 
  8047. information about the  Standard C Library is used to enable checking of library 
  8048. calls.  Program libraries can be created to enable fast checking of single 
  8049. modules in a large program. 
  8050.  
  8051. Standard Libraries 
  8052.  
  8053. In order to check calls to library functions, LCLint uses an annotated standard 
  8054. library.  This contains more information about function interfaces then is 
  8055. available in the system header files since it uses annotations.  Further, it 
  8056. contains only those functions documented in the ANSI Standard.  Many systems 
  8057. include extra functions in their system libraries; programs that use these 
  8058. functions cannot be compiled on other systems that do not provide them. 
  8059. Certain types defined by the library are treated as abstract types (e.g., a 
  8060. program should not rely on how the FILE type is implemented). When checking 
  8061. source code, LCLint does include system headers according to include directive 
  8062. in the source code, but instead uses the library description of the standard 
  8063. library. 
  8064.  
  8065.  The LCLint distribution includes several different standard libraries: the 
  8066. ANSI standard library, the POSIX standard library , and an ad hoc UNIX library. 
  8067. Each library comes in two versions: the standard version and the strict 
  8068. version. 
  8069.  
  8070. ANSI Library 
  8071.  
  8072.  The default behavior of LCLint is to use the ANSI standard library (loaded 
  8073. from ansi.lcd).  This library is based on the standard library described in the 
  8074. ANSI C Standard.  It includes functions and types added by Amendment 1 to the 
  8075. ANSI C Standard. 
  8076.  
  8077.  POSIX Library 
  8078.  
  8079.  The POSIX library is selected by the +posixlib flag.  The POSIX library is 
  8080. based on the IEEE Std 1003.1-1990. 
  8081.  
  8082.  UNIX Library 
  8083.  
  8084.  The UNIX library is selected by the +unixlib flag.  This library is an ad hoc 
  8085. attempt to capture additional functionality provided by many UNIX platforms. 
  8086. Unfortunately, UNIX systems vary widely and very few are consistent with the 
  8087. ANSI Standard. 
  8088.  
  8089. The differences between the UNIX library and the POSIX library are: 
  8090.  
  8091.      In the UNIX library, free is declared with a non-null parameter.  ANSI C 
  8092.       specifies that free should handle the argument NULL, but several UNIX 
  8093.       platforms crash if NULL is passed to free. 
  8094.      Extra variables, constants and functions are included in the UNIX 
  8095.       library.  Some declarations are not  part of the POSIX library, but are 
  8096.       believed to be available on many UNIX systems.  See lib/unix.h for a list 
  8097.       of the UNIX-only declarations. 
  8098.  
  8099.  Code checked using the UNIX library can probably be ported to some UNIX 
  8100.  systems without difficulty.  To enhance the likelihood that a program is 
  8101.  portable, the POSIX library should be used instead. 
  8102.  
  8103.  Strict Libraries 
  8104.  
  8105.  Stricter versions of the libraries are used if the -ansi-strict, 
  8106.  posix-strict-lib or unix-strct-lib flag is used. These libraries use a 
  8107.  stricter interpretation of the library.  They will detect more errors in some 
  8108.  programs, but may to produce many spurious errors for typical code. 
  8109.  
  8110.  The differences between the standard libraries and the strict libraries are: 
  8111.  
  8112.      The standard libraries declare the printing functions (fprintf, printf, 
  8113.       and sprintf) that may return error codes to return int or void.  This 
  8114.       prevents typical programs from leading to deluge of ignored return value 
  8115.       errors, but may mean some relevant errors are not detected.  In the 
  8116.       strict libraries, they are declared to return int, so ignored return 
  8117.       value errors will be reported (depending on other flag settings). 
  8118.       Programs should check that this return value is non-negative. 
  8119.      The standard libraries declare some parameters and return values to be 
  8120.       alternate types (int or bool, or int or char).  The ANSI standard 
  8121.       specifies these types as int to be compatible with older versions of the 
  8122.       library, but logically they make more sense as bool or char.  In the 
  8123.       strict libraries, the stronger type is used.  The parameter to assert is 
  8124.       int or bool in the standard library, and bool in the strict library.  The 
  8125.       parameter to the character functions isalnum, isalpha, iscntrl, isdigit, 
  8126.       isgraph, islower, isprint, ispunct, isspace, isupper, isxdigit, tolower 
  8127.       and toupper is char or int in the standard library and char in the strict 
  8128.       library.  The type of the return value of the character classification 
  8129.       functions (all of the previous character functions except tolower and 
  8130.       toupper) is bool or int in the standard library and bool in the strict 
  8131.       library.  The type of the first parameter to ungetc is char or int in the 
  8132.       standard library and char in the strict library (EOF should not be passed 
  8133.       to ungetc).  The second parameter to strchr and strrchr is char or int in 
  8134.       the standard library and char in the strict library. 
  8135.      The global variables stdin, stdout and stderr are declared as unchecked 
  8136.       variables (see Section 4.2.1) in the standard libraries.  In the strict 
  8137.       libraries, they are checked.  The global variable errno is declared 
  8138.       unchecked in the standard libraries, but declared checkedstrict in the 
  8139.       strict libraries. 
  8140.  
  8141.   Generating the Standard Libraries 
  8142.  
  8143.   The standard libraries are generated from header files included in the LCLint 
  8144.  distribution.  Some libraries are generated from more than one header file. 
  8145.  Since the POSIX library includes the ANSI library, the headers for the ANSI 
  8146.  and POSIX libraries are combined to produce the POSIX library.  Similarly, the 
  8147.  UNIX library is composed of the ANSI, POSIX and UNIX headers.  The header 
  8148.  files include some sections that are conditionally selected by defining 
  8149.  STRICT. 
  8150.  
  8151.  The commands to generate the standard libraries are: 
  8152.  
  8153.   lclint -nolib ansi.h -dump ansi
  8154.   lclint -nolib -DSTRICT ansi.h -dump ansistrict
  8155.   lclint -nolib ansi.h posix.h -dump posix
  8156.   lclint -nolib -DSTRICT ansi.h posix.h -dump posixstrict
  8157.   lclint -nolib ansi.h posix.h unix.h -dump unix
  8158.   lclint -nolib -DSTRICT ansi.h posix.h unix.h -dump unixstrict
  8159.  
  8160.  User Libraries 
  8161.  
  8162.  To enable running LCLint on large systems, mechanisms are provided for 
  8163.  creating libraries containing necessary information.  This means source files 
  8164.  can be checked independently, after a library has been created. The command 
  8165.  line option -dump library stores information in the file library (the default 
  8166.  extension, .lcd[27], is added). Then, -load library loads the library.  The 
  8167.  library contains interface information from the files checked when the library 
  8168.  was created. 
  8169.  
  8170.   Header File Inclusion 
  8171.  
  8172.  The standard behavior of LCLint on encountering 
  8173.  
  8174.      #include <X.h>
  8175.   is to search for a file named X.h on the include search path (set using -I) 
  8176.  and then the system base include path (usually /usr/include, default is set 
  8177.  when LCLint is compiled).  If X.h is the name of a header file in a loaded 
  8178.  standard library (either ANSI or POSIX) and X.h is found in a directory that 
  8179.  is a system directory (as set by the -sysdirs flag; the default is 
  8180.  /usr/include), X.h will not be included if skip-ansi-headers or 
  8181.  skip-posix-headers (depending on whether X.h is an ANSI or POSIX header file) 
  8182.  is on (both are on by default).  To force all headers to be included normally, 
  8183.  use -skip-ansi-headers and -skip-posix-headers. 
  8184.  
  8185.   Sometimes headers in system directories contain non-standard syntax which 
  8186.  LCLint is unable to parse.  The +skip-sys-headers flag may be used to prevent 
  8187.  any include file in a system directory from being included. 
  8188.  
  8189.  LCLint is fast enough that it can be run on medium-size (10,000 line) programs 
  8190.  without performance concerns.  It takes about one second to process a thousand 
  8191.  source lines on a DEC Alpha.  Libraries can be used to enable efficient 
  8192.  checking of small modules in large programs.  To further improve performance, 
  8193.  header file inclusion can be optimized. 
  8194.  
  8195.  When processing a complete system in which many files include the same 
  8196.  headers, a large fraction of processing time is wasted re-reading header files 
  8197.  unnecessarily.  If you are checking a 100-file program, and every file 
  8198.  includes utils.h, LCLint will have to process utils.h 100 times (as would most 
  8199.  C compilers).  If the +singleinclude flag is used, each header file is 
  8200.  processed only once.  Single header file processing produces a significant 
  8201.  efficiency improvement when checking large programs split into many files, but 
  8202.  is only safe if the same header file included in different contexts always has 
  8203.  the same meaning (i.e., it does not depend on preprocessor variable defined 
  8204.  differently at different inclusion sites). 
  8205.  
  8206.  When processing a single file in a large system, a large fraction of the time 
  8207.  is spent processing included header files.  This can be avoided if the 
  8208.  information in the header files is stored in a library instead.  If 
  8209.  +neverinclude is set, inclusion of files ending in .h is prevented.  Files 
  8210.  with different suffixes are included normally.  To do this the header files 
  8211.  must not include any expanded macros. That is, the header file must be 
  8212.  processed with +allmacros, and there must be no /*@notfunction@*/ control 
  8213.  comments in the header.  Then, the +neverinclude flag may be used to prevent 
  8214.  inclusion of header files.  Alternately, non-function macros can be moved to a 
  8215.  different file with a name that does not end in .h.  Remember, that this file 
  8216.  must be included directly from the .c file, since if it is included from a .h 
  8217.  file indirectly, that .h file is ignored so the other file is never included. 
  8218.  
  8219.  These options can be used for significant performance improvements on large 
  8220.  systems.  The performance depends on how the code is structured, but checking 
  8221.  a single module in a large program is several times faster if libraries and 
  8222.  +neverinclude are used. 
  8223.  
  8224.   ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  8225.  
  8226.   David Evans 
  8227.  Software Devices and Systems 
  8228.  evs@sds.lcs.mit.edu 
  8229.  
  8230.  
  8231. ΓòÉΓòÉΓòÉ 1.17. LCLint User's Guide - Appendix G  Specifications ΓòÉΓòÉΓòÉ
  8232.  
  8233.  
  8234.  
  8235. Appendix G  Specifications 
  8236.  
  8237. Another way of providing more information about programs is to use formal 
  8238. specifications.  Although this document has largely ignored specifications, 
  8239. LCLint was originally designed to use the information in LCL specifications 
  8240. instead of source-code annotations.  This document focuses on annotations since 
  8241. it takes less effort to add annotations to source code than to maintain an 
  8242. additional specification file.  Annotations can express everything that can be 
  8243. expressed in LCL specifications that is relevant to LCLint checking.  However, 
  8244. LCL specifications can provide more precise documentation on program interfaces 
  8245. than is possible with LCLint annotations. This appendix (extracted from 
  8246. [Evans94]) is a very brief introduction to LCL Specifications. For more 
  8247. information, consult [GH93]. 
  8248.  
  8249. The Larch family of languages is a two-tiered approach to formal specification. 
  8250. A specification is built using two languages -- the Larch Shared Language 
  8251. (LSL), which is independent of the implementation language, and a Larch 
  8252. Interface Language designed for the specific implementation language.  An LSL 
  8253. specification defines sorts, analogous to abstract types in a programming 
  8254. language, and operators, analogous to procedures. It expresses the underlying 
  8255. semantics of an abstraction. 
  8256.  
  8257. The interface language specifies an interface to an abstraction in a particular 
  8258. programming language.  It captures the details of the interface needed by a 
  8259. client using the abstraction and places constraints on both correct 
  8260. implementations and uses of the module.  The semantics of the interface are 
  8261. described using primitives and sorts and operators defined in LSL 
  8262. specifications.  Interface languages have been designed for several programming 
  8263. languages. 
  8264.  
  8265. LCL [GH93, Tan94] is a Larch interface language for Standard C.  LCL uses a 
  8266. C-like syntax.  Traditionally, a C module M consists of a source file, M.c, and 
  8267. a header file, M.h.  The header file contains prototype declarations for 
  8268. functions, variables and constants exported by M, as well as those macro 
  8269. definitions that implement exported functions or constants, and definitions of 
  8270. exported types. When using LCL, a module includes two additional files - M.lcl, 
  8271. a formal specification of M, and  M.lh, which is derived by LCLint (if the lh 
  8272. flag is on) from M.lcl.  Clients use M.lcl for documentation, and should not 
  8273. need to look at any implementation file.  The derived file, M.lh, contains 
  8274. include directives (if M depends on other specified modules), prototypes of 
  8275. functions and declarations of variables as specified in M.lcl.  The file M.h 
  8276. should include M.lh and retain the implementation aspects of the old M.h, but 
  8277. is no longer used for client documentation. 
  8278.  
  8279. The LCLint release package includes a grammar for LCL and examples of LCL 
  8280. specifications. 
  8281.  
  8282. Specification Flags 
  8283.  
  8284. These flags are relevant only when LCLint is used with LCL specifications. 
  8285.  
  8286. Global Flags 
  8287.  
  8288. lcs 
  8289.  
  8290. Generate .lcs files containing symbolic state of .lcl files (used for imports). 
  8291. By default .lcs files are generated for each .lcl file processed.  Use -lcs to 
  8292. prevent generation of .lcs files. 
  8293.  
  8294. lh 
  8295.  
  8296. Generate .lh files.  By default, -lh is set and no .lh files are generated. Use 
  8297. +lh to enable .lh file generation. 
  8298.  
  8299.  i <file> 
  8300.  
  8301. Set LCL initialization file to <file>.  The LCL initialization file is read if 
  8302. any .lcl files are listed on the command line.  The default file is 
  8303. lclinit.lci, found on the LARCH_PATH. 
  8304.  
  8305.  lclexpect <number> 
  8306.  
  8307. Exactly <number> specification errors are expected.  Specification errors are 
  8308. errors detected when checking the specifications.  They do not depend on the 
  8309. source code. 
  8310.  
  8311. Implicit Globals Checking Qualifiers 
  8312.  
  8313.  m: -+++ 
  8314. impcheckedspecglobs 
  8315. Implicit checked qualifier on global variables specified in an LCL file with no 
  8316. checking annotation. 
  8317.  
  8318. m: ---- 
  8319. impcheckmodspecglobs 
  8320. Implicit checkmod qualifier on global variables specified in an LCL file with 
  8321. no checking annotation. 
  8322.  
  8323. m: ---+ 
  8324. impcheckedstrictspecglobs 
  8325.  
  8326. Implicit checked qualifier on global variables specified in an LCL file with no 
  8327. checking annotation. 
  8328.  
  8329. Implicit Annotations 
  8330.  
  8331.  plain: - 
  8332. specglobimponly 
  8333.  
  8334. Implicit only annotation on global variable declaration in an LCL file with no 
  8335. allocation annotation. 
  8336.  
  8337.  plain: - 
  8338. specretimponly 
  8339.  
  8340. Implicit only annotation on return value declaration in an LCL file with no 
  8341. allocation annotation. 
  8342.  
  8343. plain: - 
  8344. specstructimponly 
  8345.  
  8346. Implicit only annotation on structure field declarations in an LCL file with no 
  8347. allocation annotation. 
  8348.  
  8349. shortcut 
  8350. specimponly 
  8351.  
  8352. Sets specglobimponly, specretimponly and specstructimponly. 
  8353.  
  8354. Macro Expansion 
  8355.  
  8356. plain: + 
  8357.  specmacros 
  8358.  
  8359. Macros defining specified identifiers are not expanded and are checked 
  8360. according to the specification. 
  8361.  
  8362. Complete Programs and Specifications 
  8363.  
  8364. m: -+++ 
  8365. specundef 
  8366.  
  8367. Function, variable, iterator or constant specified but never defined. 
  8368.  
  8369. plain: - 
  8370.  specundecl 
  8371.  
  8372. Function, variable, iterator or constant specified but never declared. 
  8373.  
  8374. plain: - 
  8375. needspec 
  8376.  
  8377. There is information in the specification that is not duplicated in syntactic 
  8378. comments.  Normally, this is not an error, but it may be useful to detect it to 
  8379. make sure checking incomplete systems without the specifications will still use 
  8380. this information. 
  8381.  
  8382. shortcut 
  8383.  exportany 
  8384.  
  8385. An error is reported for any identifier that is exported but not specified. 
  8386. (Sets all export flags below.) 
  8387.  
  8388. m: ---+ 
  8389. exportconst 
  8390.  
  8391. Constant exported but not specified. 
  8392.  
  8393. m: ---+ 
  8394. exportvar 
  8395.  
  8396. Variable exported but not specified. 
  8397.  
  8398. m: ---+ 
  8399. exportfcn 
  8400.  
  8401. Function exported but not specified. 
  8402.  
  8403. m: ---+ 
  8404. exportiter 
  8405.  
  8406. Iterator exported but not specified. 
  8407.  
  8408. m: ---+ 
  8409.  exportmacro 
  8410.  
  8411. An expanded macro exported but not specified 
  8412.  
  8413. m: ---+ 
  8414. exporttype 
  8415.  
  8416. Type definition exported but not specified 
  8417.  
  8418. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  8419.  
  8420.  David Evans 
  8421. Software Devices and Systems 
  8422. evs@sds.lcs.mit.edu 
  8423.  
  8424.  
  8425. ΓòÉΓòÉΓòÉ 1.18. LCLint User's Guide - Appendix H  Emacs ΓòÉΓòÉΓòÉ
  8426.  
  8427.  
  8428.  
  8429. Appendix H  Emacs 
  8430.  
  8431. LCLint can be used most productively with the emacs text editor.  The release 
  8432. package includes emacs files for running LCLint and editing code with 
  8433. annotations. 
  8434.  
  8435. Editing Abbreviations 
  8436.  
  8437. An additional file, emacs/lclint-abbrevs contains abbreviations for LCLint 
  8438. syntactic comments and annotations.  If it is loaded, the comment surrounding 
  8439. an LCLint annotation will be added automatically.  For example, typing "only" 
  8440. and a space, will produce "/*@only@*/ ". Abbreviations are provided for each 
  8441. LCLint syntactic comment.  The abbreviation of  /*@null@*/ is nll (not null), 
  8442. since it is often necessary to type NULL. 
  8443.  
  8444. Abbreviations are loaded and used when a .c or .h file is edited by adding 
  8445. these lines to your .emacs file: 
  8446.  
  8447. (quietly-read-abbrev-file "<directory>/lclint-abbrevs") 
  8448.  
  8449. (setq c-mode-hook (function (lambda nil (abbrev-mode 1)))) 
  8450.  
  8451. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  8452.  
  8453.  David Evans 
  8454. Software Devices and Systems 
  8455. evs@sds.lcs.mit.edu 
  8456.  
  8457.  
  8458. ΓòÉΓòÉΓòÉ 1.19. Figures ΓòÉΓòÉΓòÉ
  8459.  
  8460.  
  8461.  
  8462. Figures 
  8463.  
  8464.  
  8465. Figure 1.  Effort/benefit curve for LCLint.   (not available in HTML format) 
  8466. Figure 2.  Violations using abstract types. 
  8467. Figure 3.  Boolean checking. 
  8468. Figure 4.  Modifies checking. 
  8469. Figure 5.  Globals checking. 
  8470. Figure 6.  Deallocation errors. 
  8471. Figure 7.  Stack references. 
  8472. Figure 8.  Implicit annotations. 
  8473. Figure 9.  Reference counting. 
  8474. Figure 10.  Unique parameters. 
  8475. Figure 11.  Returned parameters. 
  8476. Figure 12.  Exposure checking. 
  8477. Figure 13.  Use before definition. 
  8478. Figure 14.  Annotated globals lists. 
  8479. Figure 15.  Null checking. 
  8480. Figure 16.  Using notnull. 
  8481. Figure 17.  Special Clauses. 
  8482. Figure 18.  Naming checks. 
  8483. Figure 19.  Evaluation order 
  8484. Figure 20.  Infinite loop checking 
  8485. Figure 21.  Switch checking. 
  8486. Figure 22.  Statements with no effect. 
  8487. Figure 23.  Ignored return values. 
  8488.  
  8489. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  8490.  
  8491.   David Evans 
  8492. Software Devices and Systems 
  8493. evs@sds.lcs.mit.edu 
  8494.  
  8495.  
  8496. ΓòÉΓòÉΓòÉ 1.19.1. Figure 17.  Special Clauses ΓòÉΓòÉΓòÉ
  8497.  
  8498.  
  8499.  
  8500. Figure 17.  Special Clauses 
  8501.  
  8502.      source 
  8503.  
  8504.   David Evans 
  8505.  Software Devices and Systems 
  8506.  evs@sds.lcs.mit.edu 
  8507.  
  8508.  
  8509. ΓòÉΓòÉΓòÉ 1.19.1.1. special.c ΓòÉΓòÉΓòÉ
  8510.  
  8511.  
  8512.  
  8513. special.c 
  8514.  
  8515. typedef struct
  8516. {
  8517.   int id;
  8518.   /*@only@*/ char *name;
  8519. } *record;
  8520.  
  8521. static /*@special@*/ record record_new (void)
  8522.   /*@defines result->id@*/
  8523. {
  8524.   record r = (record) malloc (sizeof (*r));
  8525.  
  8526.   assert (r != NULL);
  8527.   r->id = 3;
  8528.   return r;
  8529. }
  8530.  
  8531. static void record_setName (/*@special@*/ record r, /*@only@*/ char *name)
  8532.    /*@defines r->name@*/
  8533. {
  8534.   r->name = name;
  8535. }
  8536.  
  8537. record record_create (/*@only@*/ char *name)
  8538. {
  8539.   record r = record_new ();
  8540.   record_setName (r, name);
  8541.   return r;
  8542. }
  8543.  
  8544. void record_clearName (/*@special@*/ record r)
  8545.    /*@releases r->name@*/
  8546.    /*@post:isnull r->name@*/
  8547. {
  8548.   free (r->name);
  8549.   r->name = NULL;
  8550. }
  8551.  
  8552. void record_free (/*@only@*/ record r)
  8553. {
  8554.   record_clearName (r);
  8555.   free (r);
  8556. }
  8557.  
  8558.  
  8559.  
  8560.  
  8561.  
  8562. ΓòÉΓòÉΓòÉ 1.19.2. Figure 18.  Naming Checks ΓòÉΓòÉΓòÉ
  8563.  
  8564.  
  8565.  
  8566. Figure 18.  Naming Checks 
  8567.  
  8568.      source 
  8569.      messages 
  8570.  
  8571.   David Evans 
  8572.  Software Devices and Systems 
  8573.  evs@sds.lcs.mit.edu 
  8574.  
  8575.  
  8576. ΓòÉΓòÉΓòÉ 1.19.2.1. names.c ΓòÉΓòÉΓòÉ
  8577.  
  8578.  
  8579.  
  8580. names.c 
  8581.  
  8582. char *stringreverse (char *s);
  8583.  
  8584. int f (int x)
  8585. {
  8586.   int lookalike = 1;
  8587.   int looka1ike = 2;
  8588.  
  8589.   if (x > 3)
  8590. ;    {
  8591.       int x = lookalike;
  8592.       x += looka1ike;
  8593.     }
  8594.  
  8595.   return x;
  8596. }
  8597.  
  8598.  
  8599.  
  8600.  
  8601.  
  8602.  
  8603.  
  8604.  
  8605.  
  8606.  
  8607.  
  8608.  
  8609.  
  8610.  
  8611.  
  8612.  
  8613.  
  8614.  
  8615.  
  8616.  
  8617.  
  8618.  
  8619.  
  8620.  
  8621.  
  8622.  
  8623.  
  8624.  
  8625.  
  8626.  
  8627.  
  8628.  
  8629.  
  8630.  
  8631.  
  8632.  
  8633.  
  8634.  
  8635.  
  8636.  
  8637.  
  8638.  
  8639.  
  8640.  
  8641.  
  8642.  
  8643.  
  8644.  
  8645.  
  8646.  
  8647.  
  8648.  
  8649.  
  8650.  
  8651.  
  8652.  
  8653.  
  8654.  
  8655.  
  8656.  
  8657. ΓòÉΓòÉΓòÉ 1.19.2.2. fig18-out.html ΓòÉΓòÉΓòÉ
  8658.  
  8659.  
  8660.  
  8661. LCLint Output 
  8662.  
  8663. LCLint 2.2 --- 25 Aug 96
  8664.  
  8665. names.c:1,7: Name stringreverse is reserved for future
  8666.     ANSI library extensions.  Functions that begin
  8667.     with "str" and a lowercase letter may be added to
  8668.      or . (See ANSI, Section
  8669.     4.13.7)
  8670.   External name is reserved for system in ANSI
  8671.   standard. (-ansireserved will suppress message)
  8672. names.c: (in function f)
  8673. names.c:6,7: Internal identifier looka1ike is not
  8674.     distinguishable from lookalike except by lookalike
  8675.     characters
  8676.   An internal name is not distinguishable from another
  8677.   internal name using the number of significant
  8678.   characters. According to ANSI Standard (3.1), an
  8679.   implementation may only consider the first 31
  8680.   characters significant. The +internalnamelen
  8681.   flag changes the number of significant characters,
  8682.   -internalnamecaseinsensitive to makes alphabetical
  8683.   case significant, and +internalnamelookalike to make
  8684.   similar-looking characters non-distinct.
  8685.   (-distinctinternalnames will suppress message)
  8686.    names.c:5,7: Declaration of lookalike
  8687. names.c:10,11: Variable x shadows outer declaration
  8688.   An outer declaration is shadowed by the local
  8689.   declaration. (-shadow will suppress message)
  8690.    names.c:3,12: Previous declaration of x: int
  8691.  
  8692. Finished LCLint checking --- 3 code errors found
  8693.  
  8694.  
  8695. ΓòÉΓòÉΓòÉ 1.20. Footnotes ΓòÉΓòÉΓòÉ
  8696.  
  8697.  
  8698.  
  8699. Footnotes 
  8700.  
  8701.  1 Lint is a common programming tool for detecting anomalies in C programs. 
  8702. The original lint was developed by S. C. Johnson in the late seventies, mainly 
  8703. because early versions of C did not support function prototypes. 
  8704.  
  8705.  2 Another way to provide extra information about code is to use formal 
  8706. specifications (Appendix G). 
  8707.  
  8708.  3 Unlike regular C comments, control comments should not be used within a 
  8709. single token.  They may introduce new separators in the code during parsing. 
  8710.  
  8711.  4 For abstract types whose instances can change value, a client does need to 
  8712. know if assignment has copy or sharing semantics (see Section 3.2). 
  8713.  
  8714.  5 Does not apply to HTML version. italics. 
  8715.  
  8716.  6 The meta-notation, item,+ is used to denote a comma separated list of items. 
  8717. For example, /*@access mstring, intSet@*/ provides access to the 
  8718. representations of both mstring and intSet.) 
  8719.  
  8720.  7 Through the parameter.  Modifications using some other variable that has a 
  8721. pointer to the location of this parameter are not considered. 
  8722.  
  8723.  8 To change the names of TRUE and FALSE, use -booltrue  and -boolfalse.  The 
  8724. LCLint distribution includes an implementation of bool, in lib/bool.h. However, 
  8725. it isn't necessary to use this implementation to get the benefits of boolean 
  8726. checking. 
  8727.  
  8728.  9 This means that theoreticians can prove that no algorithm exists that solves 
  8729. the problem correctly for all possible programs. 
  8730.  
  8731.  10 This section is largely based on [Evans96].  It semi-formally defines some 
  8732. of the terms needed to describe memory management checking;  if you are 
  8733. satisfied with an intuitive understanding of these terms, this section may be 
  8734. skipped. 
  8735.  
  8736.  11 This is similar to the LISP storage model, except that objects are typed. 
  8737.  
  8738.  12 Except sizeof, which does not need the value of its argument. 
  8739.  
  8740.  13 If the storage is not assigned to a reference, an internal reference is 
  8741. created to track the storage. 
  8742.  
  8743.  14 The full declaration of malloc also includes a null annotation (Section 
  8744. 7.2) to indicate that the result may be NULL (as it is when the requested 
  8745. storage cannot be allocated) and an out annotation (Section 7.1) to indicate 
  8746. that the result points to undefined storage. 
  8747.  
  8748.  15 The full declaration of free also has out and null annotations on the 
  8749. parameter to indicate that the argument may be NULL and need not point to 
  8750. defined storage.  According to [ANSI, 4.10.3.2], NULL may be passed to free 
  8751. without an error.  On some UNIX platforms, passing NULL to free causes a 
  8752. program crash so the UNIX version of the standard library (Appendix F) 
  8753. specifies free without the null annotation on its parameter. To check that 
  8754. allocated objects are completely destroyed (e.g., all unshared objects inside a 
  8755. structure are deallocated before the structure is deallocated), LCLint checks 
  8756. that any parameter passed as an out only void * does not contain references to 
  8757. live, unshared objects.  This makes sense, since such a parameter could not be 
  8758. used sensibly in any way other than deallocating its storage. 
  8759.  
  8760.  16 If an exposure qualifier is used (see Section 6.2), the implied dependent 
  8761. annotation is used instead of the more generally implied only annotation. 
  8762.  
  8763.  17 Strictly, we should also check that the returned observer storage is not 
  8764. used again after any other calls to the abstract type module using the same 
  8765. parameter.  LCLint does not attempt to check this, and in practice it is not 
  8766. usually a problem. 
  8767.  
  8768.  18 Note that if the parameter is annotated with only, it is not an error to 
  8769. assign it to part of an abstract representation, since the caller may not use 
  8770. the storage after the call returns. 
  8771.  
  8772.  19 That is, the return type is bool, or int if +boolint is used. 
  8773.  
  8774.  20 The sef annotation denotes a parameter as side-effect free (see Section 
  8775. 8.2.1). By declaring the argument to assert to be side-effect free, LCLint will 
  8776. report errors if the parameter to assert produces a side-effect.  This is 
  8777. especially pertinent if assertions are turned off when the production version 
  8778. is compiled. The bool /*@alt int@*/ type specifier for the parameter means the 
  8779. parameter type must match either bool or int. Alternate types are described in 
  8780. Section 8.2.2. 
  8781.  
  8782.  21 To be completely correct, all the macro parameters should be evaluated 
  8783. before the macro has any side-effects.  Since checking this would require 
  8784. extensive analysis for occasional modest gain, it was not considered worth 
  8785. implementing. 
  8786.  
  8787.  22 Note that functions which do not produce to the same result each time they 
  8788. are called with the same arguments should be declared to modify internalState 
  8789. so they  will lead to errors if they are passed as sef parameters. 
  8790.  
  8791.  23 The most renown C naming convention is the Hungarian naming convention, 
  8792. introduced by Charles Simonyi [Simonyi, Charles, and Martin Heller.  "The 
  8793. Hungarian Revolution."  BYTE, August 1991, p. 131-38].  The names for LCLint 
  8794. naming conventions follow the tradition of using Central European nationalities 
  8795. as mnemonics for naming conventions.  The LCLint conventions are similar to the 
  8796. Hungarian naming convention in that they encode type information in names, 
  8797. except that the LCLint conventions encode the names of accessible abstract 
  8798. types instead of the type of the declaration of return value. Prefixes used in 
  8799. the Hungarian naming convention are not supported by LCLint. 
  8800.  
  8801.  24 Namespace prefixes should probably be described by regular expressions. 
  8802. LCLint uses a simpler, more limited means for describing names, which is 
  8803. believed to be adequate for describing most useful naming conventions.  If 
  8804. there is sufficient interest, regular expressions may be supported in a future 
  8805. version of LCLint. 
  8806.  
  8807.  25 Peter van der Linden estimates that default fall through is the wrong 
  8808. behavior 97% of the time.  [vdL95, p. 37] 
  8809.  
  8810.  26 "Software Glitch Cripples AT&T Network", Telephony, 22 January 1990. 
  8811.  
  8812.  27 In earlier versions of LCLint, the default extension .lldmp was used.  This 
  8813. has been shortened to .lcd. 
  8814.  
  8815. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  8816.  
  8817.  
  8818.  
  8819. ΓòÉΓòÉΓòÉ 1.21. LCLint User's Guide - References ΓòÉΓòÉΓòÉ
  8820.  
  8821.  
  8822.  
  8823. References 
  8824.  
  8825.  
  8826.  
  8827. LCLint 
  8828.  
  8829.  [Evans94] David Evans. Using specifications to check source code. MIT/LCS/TR 
  8830. 628, Laboratory for Computer Science, MIT, June 1994. 
  8831.  
  8832. SM Thesis.  Describes research behind LCLint, focusing on how specifications 
  8833. can be exploited to do lightweight checking.  Includes case studies using 
  8834. LCLint. 
  8835.  
  8836.  [EGHT94] David Evans, John Guttag, Jim Horning and Yang Meng Tan. LCLint: A 
  8837. tool for using specifications to check code.  SIGSOFT Symposium on the 
  8838. Foundations of Software Engineering, December 1994. 
  8839.  
  8840. Introduction to LCLint.  Shows how LCLint is used to find errors in a sample 
  8841. program. 
  8842.  
  8843.  [Evans96] David Evans. Static Detection of Dynamic Memory Errors.  In SIGPLAN 
  8844. Conference on Programming Language Design and Implementation (PLDI '96), 
  8845. Philadelphia, PA., May 1996. 
  8846.  
  8847. Describes approach for exploiting annotations added to code to detect a wide 
  8848. class of errors.  Focuses on checks described in Sections 5-7 of this guide. 
  8849.  
  8850. Larch 
  8851.  
  8852.  [GH93] Guttag, John V. and Horning, James J., with Stephen J. Garland, Kevin 
  8853. D. Jones, AndrΓòös Modet, and Jeannette M. Wing, Larch: Languages and Tools for 
  8854. Formal Specification, Springer-Verlag, Texts and Monographs in Computer 
  8855. Science, 1993. 
  8856.  
  8857. Overview of the Larch family of specification languages and related tools. 
  8858. Includes a chapter on LCL, the Larch C interface language, on which LCLint is 
  8859. based. 
  8860.  
  8861.  [Tan95] Tan, Yang Meng.  Formal Specification Techniques for Engineering 
  8862. Modular C, Kluwer International Series in Software Engineering, Volume 1, 
  8863. Kluwer Academic Publishers, Boston, 1995. 
  8864.  
  8865. Modified and updated version of MIT Ph. D. dissertation, previously published 
  8866. as MIT/LCS/TR-619, 1994.  Includes presentation of the semantics of LCL and a 
  8867. case study using LCL. 
  8868.  
  8869.  
  8870.  [ANSI] American National Standard for Information Systems, Programming 
  8871. Language, C.  ANSI X3.159-1989.  (Believed to be identical to ISO/IEC 
  8872. 9899:1990). 
  8873.  
  8874. Specification for C programming language.  LCLint aims to be consistent with 
  8875. this document.   [Hat95] Hatton, Les.  Safer C: Developing Software for 
  8876. High-integrity and Safety-critical Systems. McGraw-Hill International Series in 
  8877. Software Engineering, 1995. 
  8878.  
  8879. A broad work on all aspects of developing safety-critical software, focusing on 
  8880. the C language.  Provides good justification for the use of C in 
  8881. safety-critical systems, and the necessity of tool-supported programming 
  8882. standards.  LCLint users will be interested to see how many of the errors 
  8883. listed as only being dynamically detectable can be detected statically by 
  8884. LCLint.   [KR88] Kernighan, Brian W. and Ritchie, Dennis M.  The C Programming 
  8885. Language, second edition.  Prentice Hall, New Jersey, 1988. 
  8886.  
  8887. Standard reference for ANSI C.  If you haven't heard of this one, you probably 
  8888. didn't get this far (unless you started at the back).  [vdL94] Van der Linden, 
  8889. Peter.  Expert C Programming:  Deep C Secrets. SunSoft Press, Prentice Hall, 
  8890. New Jersey,  1994. 
  8891.  
  8892. Filled with useful information on the darker corners of C, as well as lots of 
  8893. industry anecdotes and humor.  LCLint's reserved name checking is loosely based 
  8894. on the list of reserved names in this book. 
  8895.  
  8896. Abstract Types 
  8897.  
  8898.  [LG86] Liskov, Barbara. and Guttag, John V.  Abstraction and Specification in 
  8899. Program Development, MIT Press, Cambridge, MA, 1986. 
  8900.  
  8901. Describes a programming methodology using abstract types and specified 
  8902. interfaces.  Much of the methodology upon which LCLint is based comes from this 
  8903. book. Uses the CLU programming language. 
  8904.  
  8905. ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  8906.  
  8907.   David Evans 
  8908. Software Devices and Systems 
  8909. evs@sds.lcs.mit.edu 
  8910.  
  8911.  
  8912. ΓòÉΓòÉΓòÉ 2. External links ΓòÉΓòÉΓòÉ
  8913.  
  8914. This chapter contains all external links referenced in this book - either link 
  8915. is an Unified Resource Locator (URL) or simply to a local file which is not a 
  8916. part of this book. 
  8917.  
  8918.  
  8919. ΓòÉΓòÉΓòÉ 2.1. http://www.sds.lcs.mit.edu/~evs ΓòÉΓòÉΓòÉ
  8920.  
  8921.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       The link you selected points to an external resource. Click the URL below to launch IBM Web Explorer
  8922.  
  8923.                          http://www.sds.lcs.mit.edu/~evs
  8924.  
  8925.  
  8926. ΓòÉΓòÉΓòÉ 2.2. http://www.sds.lcs.mit.edu/ ΓòÉΓòÉΓòÉ
  8927.  
  8928.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       The link you selected points to an external resource. Click the URL below to launch IBM Web Explorer
  8929.  
  8930.                            http://www.sds.lcs.mit.edu/
  8931.  
  8932.  
  8933. ΓòÉΓòÉΓòÉ 2.3. http://www.lcs.mit.edu/ ΓòÉΓòÉΓòÉ
  8934.  
  8935.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       The link you selected points to an external resource. Click the URL below to launch IBM Web Explorer
  8936.  
  8937.                              http://www.lcs.mit.edu/
  8938.  
  8939.  
  8940. ΓòÉΓòÉΓòÉ 2.4. http://www.sds.lcs.mit.edu/lclint/acknowledgements.html ΓòÉΓòÉΓòÉ
  8941.  
  8942.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       The link you selected points to an external resource. Click the URL below to launch IBM Web Explorer
  8943.  
  8944.              http://www.sds.lcs.mit.edu/lclint/acknowledgements.html
  8945.  
  8946.  
  8947. ΓòÉΓòÉΓòÉ 2.5. http://www.sds.lcs.mit.edu/lclint/index.html ΓòÉΓòÉΓòÉ
  8948.  
  8949.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       The link you selected points to an external resource. Click the URL below to launch IBM Web Explorer
  8950.  
  8951.                   http://www.sds.lcs.mit.edu/lclint/index.html
  8952.  
  8953.  
  8954. ΓòÉΓòÉΓòÉ 2.6. mailto:evs@sds.lcs.mit.edu ΓòÉΓòÉΓòÉ
  8955.  
  8956.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       The link you selected points to an external resource. Click the URL below to launch IBM Web Explorer
  8957.  
  8958.                            mailto:evs@sds.lcs.mit.edu
  8959.  
  8960.  
  8961. ΓòÉΓòÉΓòÉ 2.7. mailto:lclint@sds.lcs.mit.edu ΓòÉΓòÉΓòÉ
  8962.  
  8963.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       The link you selected points to an external resource. Click the URL below to launch IBM Web Explorer
  8964.  
  8965.                           mailto:lclint@sds.lcs.mit.edu
  8966.  
  8967.  
  8968. ΓòÉΓòÉΓòÉ 2.8. mailto:lclint-bug@sds.lcs.mit.edu ΓòÉΓòÉΓòÉ
  8969.  
  8970.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       The link you selected points to an external resource. Click the URL below to launch IBM Web Explorer
  8971.  
  8972.                         mailto:lclint-bug@sds.lcs.mit.edu
  8973.  
  8974.  
  8975. ΓòÉΓòÉΓòÉ 2.9. news:comp.specification.larch ΓòÉΓòÉΓòÉ
  8976.  
  8977.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       The link you selected points to an external resource. Click the URL below to launch IBM Web Explorer
  8978.  
  8979.                           news:comp.specification.larch
  8980.  
  8981.  
  8982. ΓòÉΓòÉΓòÉ 2.10. http://www.sds.lcs.mit.edu/~evs/tr-628.html ΓòÉΓòÉΓòÉ
  8983.  
  8984.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       The link you selected points to an external resource. Click the URL below to launch IBM Web Explorer
  8985.  
  8986.                    http://www.sds.lcs.mit.edu/~evs/tr-628.html
  8987.  
  8988.  
  8989. ΓòÉΓòÉΓòÉ 2.11. http://www.sds.lcs.mit.edu/~evs/sigsoft94.html ΓòÉΓòÉΓòÉ
  8990.  
  8991.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       The link you selected points to an external resource. Click the URL below to launch IBM Web Explorer
  8992.  
  8993.                  http://www.sds.lcs.mit.edu/~evs/sigsoft94.html
  8994.  
  8995.  
  8996. ΓòÉΓòÉΓòÉ 2.12. http://www.sds.lcs.mit.edu/~evs/pldi96-abstract.html ΓòÉΓòÉΓòÉ
  8997.  
  8998.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       The link you selected points to an external resource. Click the URL below to launch IBM Web Explorer
  8999.  
  9000.               http://www.sds.lcs.mit.edu/~evs/pldi96-abstract.html
  9001.