home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lclint.zip / lclintguide-os2.zip / lclint.ipf < prev    next >
Text File  |  1997-08-29  |  449KB  |  10,540 lines

  1. .*----------------------------------------------------------------------------*
  2. .*       Converted by HTML2IPF from guide.html at 28 Aug 1997, 11:58pm        *
  3. .*----------------------------------------------------------------------------*
  4. :userdoc.
  5. :docprof toc=12345.
  6. :title.LCLint User's Guide
  7. .* Source filename: guide.html
  8. :h1 res=1.LCLint User's Guide
  9. :font facename=default size=0x0.
  10. :p.
  11.  
  12. .br
  13. :font facename='Helv' size=32x20.
  14. .br
  15. :lines align=center.
  16. LCLint User's Guide
  17. .br
  18. :elines.
  19. :font facename=default size=0x0.
  20. .br
  21. .br
  22. :p.
  23. .br
  24. :font facename='Helv' size=20x12.
  25. .br
  26. :lines align=center.
  27. Version 2&per.3
  28. .br
  29. August 1997
  30. .br
  31. :elines.
  32. :font facename=default size=0x0.
  33. .br
  34. .br
  35. :p.
  36. .br
  37. :font facename='Tms Rmn' size=16x8.
  38. .br
  39. :lines align=center.:link reftype=hd res=2.David Evans:elink.
  40. .br
  41. :link reftype=hd res=3.Systematic Program Development Group:elink.
  42. .br
  43. :link reftype=hd res=4.MIT Laboratory for Computer Science:elink.
  44. .br
  45. Converted from guide&per.html using HTML2IIPF by Herbert at 28 Aug 1997, 01&colon.10am
  46. .br
  47. :elines.
  48. :font facename=default size=0x0.
  49. .br
  50. .br
  51. :p.
  52.  
  53. LCLint is a tool for statically checking C programs&per.  With minimal effort,
  54. LCLint can be used as a better lint&per.:link reftype=hd res=5.[1]:elink.  If
  55. additional effort is invested adding annotations to programs, LCLint can
  56. perform stronger checks than can be done by any standard lint&per.
  57. :p.
  58. :p.
  59. Some problems detected by LCLint include&colon.
  60. :p.
  61. :ul compact.
  62. :li.Violations of information hiding&per.  A user-defined type can be declared
  63. as :hp1.abstract:ehp1., and a message is reported where code inappropriately
  64. depends on the representation of the type&per.  (:link reftype=hd res=6.Section 3:elink.) 
  65. :p.
  66. :li.Inconsistent modification of caller-visible state&per.  Functions can be
  67. annotated with information on what caller-visible state may be modified by the
  68. function, and an error is reported if the modifications produced by the
  69. function contradict its declaration&per.  (:link reftype=hd res=7.Section 4&per.1:elink.)
  70. :p.
  71. :li.Inconsistent use of global variables&per.  Information on what global and
  72. file scope variables a function may use can be added to function declarations,
  73. and a message is reported if the implementation of the function uses other
  74. global variables or does not uses every global variable listed in its
  75. declaration&per.  (:link reftype=hd res=7.Section 4&per.2:elink.)
  76. :p.
  77. :li.Memory management errors&per.  Instances where storage that has been
  78. deallocated is used, or where storage is not deallocated (memory leaks)&per.
  79. (:link reftype=hd res=8.Section 5:elink.)
  80. :p.
  81. :li.Dangerous data sharing or unexpected aliasing&per.  Parameters to a function
  82. share storage in a way that may lead to undefined or undesired behavior, or a
  83. reference to storage within the representation of an abstract type is created&per.
  84. (:link reftype=hd res=9.Section 6:elink.)
  85. :p.
  86. :li.Using possibly undefined storage or returning storage that is not
  87. completely defined (except as documented)&per.  (:link reftype=hd res=10.Section 7&per.1:elink.)
  88. :p.
  89. :li.Dereferencing a possibly null pointer&per.  (:link reftype=hd res=10.Section 7&per.2:elink.)
  90. :p.
  91. :li.Dangerous macro implementations or invocations&per. (:link reftype=hd res=11.Section 8:elink.)
  92. :p.
  93. :li.Violations of customizable naming conventions&per. (:link reftype=hd res=12.Section 9:elink.)
  94. :p.
  95. :li.Program behavior that is undefined because it depends on order of
  96. evaluation, likely infinite loops, fall-through cases, incomplete logic,
  97. statements with no effect, ignored return values, unused declarations, and
  98. exceeding certain standard limits&per.  (:link reftype=hd res=13.Section 10:elink.)
  99. :p.
  100. :eul.
  101.  
  102. :p.
  103. LCLint checking can be customized to select what classes of errors are reported
  104. using command line flags and stylized comments in the code&per.
  105. :p.
  106. :p.
  107. This document is a guide to using LCLint&per.  :link reftype=hd res=14.Section 1:elink. is a brief overview of the
  108. design goals of LCLint&per. :link reftype=hd res=15.Section 2:elink. explains how to run LCLint, interpret
  109. messages produce, and control checking&per. Sections 3-10 describe particular
  110. checks done by LCLint&per.
  111.  
  112. .br
  113. :font facename='Helv' size=32x20.
  114. .br
  115.  
  116. Contents
  117. .br
  118.  
  119. :font facename=default size=0x0.
  120. .br
  121. .br
  122. :p.
  123. :ol compact.
  124. :li.:link reftype=hd res=14.Overview:elink.
  125. :li.:link reftype=hd res=15.Operation:elink.
  126. :ul compact.
  127. :li.:link reftype=hd res=15.Messages:elink.
  128. :li.:link reftype=hd res=15.Flags:elink.
  129. :li.:link reftype=hd res=15.Stylized Comments:elink.
  130. :ul compact.
  131. :li.:link reftype=hd res=15.Annotations:elink.
  132. :li.:link reftype=hd res=15.Control Comments:elink.
  133. :eul.
  134. :eul.
  135.  
  136. :li.:link reftype=hd res=6.Abstract Types:elink.
  137. :ul compact.
  138. :li.:link reftype=hd res=6.Access:elink.
  139. :li.:link reftype=hd res=6.Mutability:elink.
  140. :li.:link reftype=hd res=6.Boulean Types:elink.
  141. :li.:link reftype=hd res=6.Primitive C Types:elink.
  142. :ul compact.
  143. :li.:link reftype=hd res=6.Characters:elink.
  144. :li.:link reftype=hd res=6.Enumerators:elink.
  145. :li.:link reftype=hd res=6.Numeric Types:elink.
  146. :li.:link reftype=hd res=6.Arbitrary Integral Types:elink.
  147. :eul.
  148. :eul.
  149.  
  150. :li.:link reftype=hd res=7.Function Interfaces:elink.
  151. :ul compact.
  152. :li.:link reftype=hd res=7.Modifications:elink.
  153. :ul compact.
  154. :li.:link reftype=hd res=7.Special Modifications:elink.
  155. :li.:link reftype=hd res=7.Missing Modifies Clauses:elink.
  156. :li.:link reftype=hd res=7.Limitations:elink.
  157. :eul.
  158.  
  159. :li.:link reftype=hd res=7.Global Variables:elink.
  160. :ul compact.
  161. :li.:link reftype=hd res=7.Controlling Globals Checking:elink.
  162. :eul.
  163.  
  164. :li.:link reftype=hd res=7.Declaration Consistency:elink.
  165. :eul.
  166.  
  167. :li.:link reftype=hd res=8.Memory Management:elink.
  168. :ul compact.
  169. :li.:link reftype=hd res=8.Storage Model:elink.
  170. :li.:link reftype=hd res=8.Deallocation Errors:elink.
  171. :ul compact.
  172. :li.:link reftype=hd res=8.Unshared References:elink.
  173. :li.:link reftype=hd res=8.Temporary Parameters:elink.
  174. :li.:link reftype=hd res=8.Owned and Dependent References:elink.
  175. :li.:link reftype=hd res=8.Kept Parameters:elink.
  176. :li.:link reftype=hd res=8.
  177. :li.:elink.:link reftype=hd res=8.Stack References:elink.
  178. :li.:link reftype=hd res=8.Inner Storage:elink.
  179. :eul.
  180.  
  181. :li.:link reftype=hd res=8.Implicit Memory Annotations:elink.
  182. :li.:link reftype=hd res=8.Reference Counting:elink.
  183. :eul.
  184.  
  185. :li.:link reftype=hd res=9.Sharing:elink.
  186. :ul compact.
  187. :li.:link reftype=hd res=9.Aliasing:elink.
  188. :ul compact.
  189. :li.:link reftype=hd res=9.Unique Parameters:elink.
  190. :li.:link reftype=hd res=9.Returned Parameters:elink.
  191. :eul.
  192.  
  193. :li.:link reftype=hd res=9.Exposure:elink.
  194. :ul compact.
  195. :li.:link reftype=hd res=9.Read-Only Storage:elink.
  196. :li.:link reftype=hd res=9.Exposed Storage:elink.
  197. :eul.
  198. :eul.
  199.  
  200. :li.:link reftype=hd res=10.Value Constraints:elink.
  201. :ul compact.
  202. :li.:link reftype=hd res=10.Use Before Definition:elink.
  203. :ul compact.
  204. :li.:link reftype=hd res=10.Undefined Parameters:elink.
  205. :li.:link reftype=hd res=10.Relaxing Checking:elink.
  206. :li.:link reftype=hd res=10.Partially Defined Structures:elink.
  207. :li.:link reftype=hd res=10.Global Variables:elink.
  208. :eul.
  209.  
  210. :li.:link reftype=hd res=10.Null Pointers:elink.
  211. :ul compact.
  212. :li.:link reftype=hd res=10.Predicate Functions:elink.
  213. :li.:link reftype=hd res=10.Overriding Null Types:elink.
  214. :li.:link reftype=hd res=10.Relaxing Null Checking:elink.
  215. :eul.
  216.  
  217. :li.:link reftype=hd res=10.Execution:elink.
  218. :li.:link reftype=hd res=10.Special Clauses:elink.
  219. :eul.
  220.  
  221. :li.:link reftype=hd res=11.Macros:elink.
  222. :ul compact.
  223. :li.:link reftype=hd res=11.Constant Macros:elink.
  224. :li.:link reftype=hd res=11.Function-like Macros:elink.
  225. :ul compact.
  226. :li.:link reftype=hd res=11.Side-Effect Free Parameters:elink.
  227. :li.:link reftype=hd res=11.Polymorphism:elink.
  228. :eul.
  229.  
  230. :li.:link reftype=hd res=11.Controlling Macro Checking:elink.
  231. :li.:link reftype=hd res=11.Iterators:elink.
  232. :eul.
  233.  
  234. :li.:link reftype=hd res=12.Naming Conventions:elink.
  235. :ul compact.
  236. :li.:link reftype=hd res=12.Type-Based Naming Conventions:elink.
  237. :ul compact.
  238. :li.:link reftype=hd res=12.Czech Names:elink.
  239. :li.:link reftype=hd res=12.Slovak Names:elink.
  240. :li.:link reftype=hd res=12.Czechoslovak Names:elink.
  241. :eul.
  242.  
  243. :li.:link reftype=hd res=12.Namespace Prefixes:elink.
  244. :li.:link reftype=hd res=12.Naming Restrictions:elink.
  245. :ul compact.
  246. :li.:link reftype=hd res=12.Reserved Names:elink.
  247. :li.:link reftype=hd res=12.Distinct Identifiers:elink.
  248. :eul.
  249. :eul.
  250.  
  251. :li.:link reftype=hd res=13.Other Checks:elink.
  252. :ul compact.
  253. :li.:link reftype=hd res=13.Undefined Evaluation Order:elink.
  254. :li.:link reftype=hd res=13.Problematic Control Structures:elink.
  255. :ul compact.
  256. :li.:link reftype=hd res=13.Likely Infinite Loops:elink.
  257. :li.:link reftype=hd res=13.Switches:elink.
  258. :li.:link reftype=hd res=13.Deep Breaks:elink.
  259. :li.:link reftype=hd res=13.Loop and If Bodies:elink.
  260. :li.:link reftype=hd res=13.Complete if-else Logic:elink.
  261. :eul.
  262.  
  263. :li.:link reftype=hd res=13.Suspicious Statements:elink.
  264. :ul compact.
  265. :li.:link reftype=hd res=13.Statements with No Effects:elink.
  266. :li.:link reftype=hd res=13.Ignored Return Values:elink.
  267. :eul.
  268.  
  269. :li.:link reftype=hd res=13.Unused Declarations:elink.
  270. :li.:link reftype=hd res=13.Complete Programs:elink.
  271. :ul compact.
  272. :li.:link reftype=hd res=13.Unnecessary External Names:elink.
  273. :li.:link reftype=hd res=13.Declarations Missing from Headers:elink.
  274. :eul.
  275.  
  276. :li.:link reftype=hd res=13.Compiler Limits:elink.
  277. :ul compact.
  278. :ul compact.
  279. :ul compact.
  280. :eul.
  281. :eul.
  282. :eul.
  283. :eul.
  284. :eol.
  285.  
  286.  
  287. .br
  288. :font facename='Tms Rmn' size=18x10.
  289. .br
  290. Appendices
  291. :font facename=default size=0x0.
  292. .br
  293. .br
  294. :p.
  295. :link reftype=hd res=16.Appendix A&per.  Availability:elink.
  296. .br
  297. :link reftype=hd res=17.Appendix B&per.  Communication:elink.
  298. .br
  299. :link reftype=hd res=18.Appendix C&per.  Flags:elink.
  300. .br
  301. :link reftype=hd res=19.Appendix D&per.  Annotations:elink.
  302. .br
  303. :link reftype=hd res=20.Appendix E&per.  Control Comments:elink.
  304. .br
  305. :link reftype=hd res=21.Appendix F&per.  Libraries:elink.
  306. .br
  307. :link reftype=hd res=22.Appendix G&per.  Specifications:elink.
  308. .br
  309. :link reftype=hd res=23.Appendix H&per.  Emacs:elink.
  310. .br
  311.  
  312. :p.
  313. .br
  314. :font facename='Helv' size=20x12.
  315. .br
  316. :link reftype=hd res=24.Figures:elink.
  317. .br
  318. :font facename=default size=0x0.
  319. .br
  320. .br
  321. :p.
  322. :link reftype=hd res=25.References:elink.
  323. .br
  324. :link reftype=hd res=26.Acknowledgements:elink.
  325. .br
  326. :p.
  327.  
  328. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  329. .br
  330. :link reftype=hd res=14.
  331. :elink.
  332. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=14.:eartlink.:link reftype=hd res=14.:elink.
  333. :link reftype=hd res=27.
  334. :elink.
  335. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  336.  
  337. :link reftype=hd res=2.David Evans:elink. 
  338. .br
  339. :link reftype=hd res=3.Systematic Program Development:elink.
  340. .br
  341. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  342.  
  343.  
  344. .* Source filename: sec1.html
  345. :h2 res=14.LCLint User's Guide - 1&per. Overview
  346. :font facename=default size=0x0.
  347. :p.
  348.  
  349.  
  350. .br
  351. :font facename='Helv' size=32x20.
  352. .br
  353. 1&per. Overview
  354. :font facename=default size=0x0.
  355. .br
  356. .br
  357. The main goals for LCLint are to&colon.
  358. :p.
  359. :ul compact.
  360. :li.Detect a large number of bugs in typical C programs, without producing
  361. an unacceptable number of spurious messages&per.  We are willing to accept the
  362. possibility that a few spurious messages are produced as long as it enables
  363. significantly more powerful checking and the spurious messages can be
  364. suppressed easily&per.
  365. :p.
  366. :li.Support a programming methodology involving abstract types and clean,
  367. documented interfaces in standard C programs&per.
  368. :p.
  369. :li.Provide a gradual transition for programmers&per.  LCLint can be used like a
  370. better standard lint with minimal effort&per.  Adding a few annotations to programs
  371. enables significantly better checking&per.  As more effort is put into annotating
  372. programs, better checking results&per. A representational effort/benefit curve for
  373. using LCLint is shown in Figure 1 (not available in HTML format)&per.  As
  374. different checks are turned on and more information is given in code
  375. annotations the number of bugs that can be detected increases dramatically&per. 
  376. :p.
  377. :li.Provide enough flexibility so that LCLint can be used effectively with a
  378. wide range of coding styles&per.  Especially important is making it easy to use
  379. LCLint effectively to maintain and modify legacy code&per.
  380. :p.
  381. :li.Check programs quickly and with no user interaction&per.  LCLint
  382. runs faster than most compilers&per.  Libraries can be used to enable fast
  383. checking of a few modules in a large program&per.
  384. :eul.
  385.  
  386. :p.
  387.  
  388. LCLint does many of the traditional lint checks including unused declarations,
  389. type inconsistencies, use-before-definition, unreachable code, ignored return
  390. values, execution paths with no return, likely infinite loops, and fall-through
  391. cases&per.  This document focuses on more powerful checks that are made
  392. possible by additional information given in source code annotations&per. [2]  Annotations are stylized comments that
  393. document certain assumptions about functions, variables, parameters, and types&per.
  394. They may be used to indicate where the representation of a user-defined type is
  395. hidden, to limit where a global variable may be used or modified, to constrain
  396. what a function implementation may do to its parameters, and to express checked
  397. assumptions about variables, types, structure fields, function parameters, and
  398. function results&per.  In addition to the checks specifically enabled by
  399. annotations, many of the traditional lint checks are improved by exploiting
  400. this additional information&per.
  401.  
  402. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  403. .br
  404. :link reftype=hd res=15.
  405. :elink.
  406. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=15.:eartlink.:link reftype=hd res=15.:elink.
  407. :link reftype=hd res=1.
  408. :elink.
  409. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  410. :link reftype=hd res=27.
  411. :elink.
  412. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  413.  
  414. :link reftype=hd res=2.David Evans:elink. 
  415. .br
  416. :link reftype=hd res=3.Systematic Program Development:elink.
  417. .br
  418. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  419.  
  420. .* Source filename: sec2.html
  421. :h2 res=15.LCLint User's Guide - 2&per. Operation
  422. :font facename=default size=0x0.
  423. :p.
  424.  
  425. .br
  426. :font facename='Helv' size=32x20.
  427. .br
  428.  
  429. 2&per. Operation
  430. :font facename=default size=0x0.
  431. .br
  432. .br
  433. LCLint is invoked by listing files to be checked&per.  Initialization files,
  434. command line flags, and stylized comments may be used to customize checking
  435. globally and locally&per.
  436. :p.
  437. :p.
  438. The best way to learn to use LCLint, of course, is to actually use it (if you
  439. don't already have LCLint installed on your system, download it)&per.  Before you
  440. read much further in this document, I recommend finding a small C program&per.
  441. Then, try running&colon.
  442. :p.
  443. :font facename='System VIO' size=14x8.lclint *&per.c:font facename=default size=0x0.
  444. :p.
  445. For the most C programs, this will produce a large number of messages&per.  To turn
  446. off reporting for some of the messages, try&colon.
  447. :p.
  448. :font facename='System VIO' size=14x8.lclint -weak *&per.c:font facename=default size=0x0.
  449. :p.
  450. The :link reftype=hd res=18.:font facename='System VIO' size=14x8.-weak:font facename=default size=0x0.:elink. flag is a mode
  451. flag that sets many checking parameters to select weaker checking than
  452. is done in the default mode&per.  Other LCLint flags will be introduced in the following sections;  a complete list is given in :link reftype=hd res=18.Appendix C:elink.&per.
  453. .br
  454. :font facename='Helv' size=20x12.
  455. .br
  456. 2&per.1 Messages
  457. :font facename=default size=0x0.
  458. .br
  459. .br
  460. The format and content of messages printed by LCLint can be customized by the
  461. user&per. A typical message is&colon.
  462. :p.
  463. :p.
  464. :cgraphic.
  465. sample&per.c&colon. (in function faucet)
  466. sample&per.c&colon.11,12&colon. Fresh storage x not released before return
  467.   A memory leak has been detected&per.  Newly-allocated or only-qualified storage
  468.   is not released before the last reference to is it lost&per.  Use -mustfree to
  469.   suppress message&per.
  470.    sample&per.c&colon.5,47&colon. Fresh storage x allocated
  471. :ecgraphic.
  472.  
  473. The first line gives the name of the function in which the error is found&per.
  474. This is printed before the first message reported for a function&per.  (The
  475. function context is not printed if :font facename='System VIO' size=14x8.-showfunc:font facename=default size=0x0. is used&per.) 
  476. :p. 
  477. :p.
  478. The second line is the text of the message&per.  This message reports a memory leak
  479. - storage allocated in a function is not deallocated before the function
  480. returns&per. The text is preceded by the file name, line and column number where
  481. the error is located&per.  The column numbers are used by the emacs mode (see
  482. :link reftype=hd res=23.Appendix H:elink.) to jump to the
  483. appropriate line and column location&per.  (Column numbers are not printed
  484. if :link reftype=hd res=18.:font facename='System VIO' size=14x8.-showcolumn:font facename=default size=0x0.:elink. is used&per.)  
  485. :p.
  486. :p.
  487. The next line is a hint giving more information about the suspected error&per.
  488. Most hints also include information on how the message may be suppressed&per.   For
  489. this message, setting the :font facename='System VIO' size=14x8.-mustfree:font facename=default size=0x0. flag would
  490. prevent the message from being reported&per.  Hints may be turned off by
  491. using :link reftype=hd res=18.:font facename='System VIO' size=14x8.-hints:font facename=default size=0x0.:elink.&per.  Normally, a hint is given only the first time a class of error is reported&per.
  492. To have LCLint print a hint for every message regardless, use :link reftype=hd res=18.:font facename='System VIO' size=14x8.+forcehints:font facename=default size=0x0.:elink.&per.
  493. :p.
  494. :p.
  495. The final line of the message gives additional location information&per.  For this
  496. message, it tells where the leaking storage is allocated&per.
  497. :p.
  498. :p.
  499. The generic message format is (parts enclosed in square brackets are
  500. optional)&colon.
  501. :p.
  502. :cgraphic.
  503.   [<file>&colon.<line> (in <context>)]
  504.   <file>&colon.<line>[,<column>]&colon. :hp1.message:ehp1.
  505.      [:hp1.hint:ehp1.]
  506.       <file>&colon.<line>,<column>&colon. :hp1.extra location information, if appopriate:ehp1.
  507. :p.
  508. :ecgraphic.
  509. The text of messages and hints may be longer than one line&per.  They are split
  510. into lines of length less than the value set using :link reftype=hd res=18.:font facename='System VIO' size=14x8.-linelen:font facename=default size=0x0.:elink.
  511. :hp1.<number>:ehp1.&per.  The default line length is 80 characters&per.  LCLint
  512. attempts to split lines in a sensible place as near to the line length limit as
  513. possible&per.  
  514.  
  515. .br
  516. :font facename='Helv' size=20x12.
  517. .br
  518.  
  519. 2&per.2 Flags
  520. :font facename=default size=0x0.
  521. .br
  522. .br
  523. So that many programming styles can be supported, LCLint provides over 300
  524. flags for controlling checking and message reporting&per.  Some of the flags are
  525. introduced in the body of this document&per.  :link reftype=hd res=18.Apppendix C:elink. describes every flag&per.
  526. Modes and shortcut flags are provided for setting many flags at once&per.
  527. Individual flags can override the mode settings&per.
  528. :p.
  529. :p.
  530. Flags are preceded by + or -&per.  When a flag is preceded by + we say it is
  531. :hp1.on:ehp1.; when it is preceded by - it is :hp1.off:ehp1.&per. The precise meaning of on
  532. and off depends on the type of flag&per.  
  533. :p.
  534. :p.
  535. The +/- flag settings are used for consistency and clarity, but contradict
  536. standard UNIX usage and is easy to accidentally use the wrong one&per.  To reduce
  537. the likelihood of using the wrong flag, LCLint issues warnings when a flag is
  538. set in an unusual way&per.  Warnings are issued when a flag is redundantly set to
  539. the value it already had (these errors are not reported if the flag is set
  540. using a stylized comment), if a mode flag or special flag is set after a more
  541. specific flag that will be set by the general flag was already set, if value
  542. flags are given unreasonable values, of if flags are set in an inconsistent
  543. way&per.  The :link reftype=hd res=18.:font facename='System VIO' size=14x8.-warnflags:font facename=default size=0x0.:elink. flag suppresses these warnings&per.
  544. :p.
  545. :p.
  546. Default flag settings will be read from :font facename='System VIO' size=14x8.~/&per.lclintrc:font facename=default size=0x0. if it is readable&per.  If
  547. there is a :font facename='System VIO' size=14x8.&per.lclintrc:font facename=default size=0x0. file in the working directory, settings in this file will
  548. be read next and its settings will override those in :font facename='System VIO' size=14x8.~/&per.lclintrc:font facename=default size=0x0.&per.  Command-line
  549. flags override settings in either file&per.  The syntax of the :font facename='System VIO' size=14x8.&per.lclintrc:font facename=default size=0x0. file is
  550. the same as that of command-line flags, except that flags may be on separate
  551. lines and the :font facename='System VIO' size=14x8.#:font facename=default size=0x0. character may be used to indicate that the remainder of the
  552. line is a comment&per. The :link reftype=hd res=18.:font facename='System VIO' size=14x8.-nof:font facename=default size=0x0.:elink.
  553. flag prevents the  :font facename='System VIO' size=14x8.~/&per.lclintrc:font facename=default size=0x0. file from being
  554. loaded&per.  The :link reftype=hd res=18.:font facename='System VIO' size=14x8.-f:font facename=default size=0x0.:elink. :hp1.<filename>:ehp1. flag loads options from :hp1.filename:ehp1.&per.
  555.  
  556. .br
  557. :font facename='Helv' size=20x12.
  558. .br
  559.  
  560. 2&per.3 Stylized Comments
  561. :font facename=default size=0x0.
  562. .br
  563. .br
  564. Stylized comments are used to provide extra information about a type, variable
  565. or function interface to improve checking, or to control flag settings
  566. locally&per.
  567. :p.
  568. :p.
  569. All stylized comments begin with :font facename='System VIO' size=14x8./*@:font facename=default size=0x0. and are closed by the end of the comment&per.
  570. The role of the :font facename='System VIO' size=14x8.@:font facename=default size=0x0. may be played by any printable character&per.  Use :link reftype=hd res=18.:font facename='System VIO' size=14x8.-commentchar:font facename=default size=0x0.:elink.
  571. :hp1.<char>:ehp1. to select a different stylized comment marker&per.
  572. .br
  573. :font facename='Tms Rmn' size=18x10.
  574. .br
  575. 2&per.3&per.1 Annotations
  576. :font facename=default size=0x0.
  577. .br
  578. .br
  579. Annotations are stylized comments that follow a definite syntax&per.  Although they
  580. are comments, they may only be used in fixed grammatical contexts (e&per.g&per., like a
  581. type qualifier)&per.
  582. :p.
  583. :p.
  584. Syntactic comments for function interfaces are described in Section 4; comments for declaring constants
  585. in :link reftype=hd res=11.Section 8&per.1&per.:elink. and comments for
  586. declaring iterators in :link reftype=hd res=11.Section 8&per.4&per.:elink.
  587. Sections 3-8 include descriptions of annotations for expressing
  588. assumptions about variables, parameters, return values, structure fields
  589. and type definitions&per.  A summary of annotations is found in Apppendix D&per.  
  590.  
  591. .br
  592. :font facename='Tms Rmn' size=18x10.
  593. .br
  594. 2&per.3&per.2 Control Comments
  595. :font facename=default size=0x0.
  596. .br
  597. .br
  598. Unlike annotations, control comments may appear between any two tokens in a C
  599. program&per.:link reftype=hd res=5.[3]:elink.  Syntactically, they are no
  600. different from standard comments&per.  Control comments are used to provide
  601. source-level control of LCLint checking&per.  They may be used to suppress spurious
  602. messages, set flags, and control checking locally in other ways&per.  A complete
  603. description of control comments is found in :link reftype=hd res=20.Apppendix E:elink.&per.
  604. :p.
  605. :p.
  606. Most flags (all except those characterized as "global" in :link reftype=hd res=18.Apppendix C:elink.) can be
  607. set locally using control comments&per.  A control comment can set flags locally to
  608. override the command line settings&per.  The original flag settings are restored
  609. before processing the next file&per. The syntax for setting flags in control
  610. comments is the same as that of the command line, except that flags may also be
  611. preceded by = to restore their setting to the original command-line value&per.  For
  612. instance,
  613. :cgraphic.
  614. /*@+boolint -modifies =showfunc@*/
  615. :ecgraphic.
  616. sets :link reftype=hd res=18.:font facename='System VIO' size=14x8.boolint:font facename=default size=0x0.:elink. on (this
  617. makes bool and int indistinguishable types), 
  618. sets :link reftype=hd res=18.:font facename='System VIO' size=14x8.modifies:font facename=default size=0x0.:elink. off (this prevents reporting of modification errors), and sets 
  619. showfunc to its original setting (this controls  whether or not the name of a function is
  620. displayed before a message)&per. 
  621.  
  622. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  623. .br
  624. :link reftype=hd res=6.
  625. :elink.
  626. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=6.:eartlink.:link reftype=hd res=6.:elink.
  627. :link reftype=hd res=1.
  628. :elink.
  629. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  630. :link reftype=hd res=27.
  631. :elink.
  632. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  633.  
  634. :link reftype=hd res=2.David Evans:elink. 
  635. .br
  636. :link reftype=hd res=3.Systematic Program Development:elink.
  637. .br
  638. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  639.  
  640.  
  641. .* Source filename: sec3.html
  642. :h2 res=6.LCLint User's Guide - 3&per. Abstract Types
  643. :font facename=default size=0x0.
  644. :p.
  645.  
  646. .br
  647. :font facename='Helv' size=32x20.
  648. .br
  649.  
  650. 3&per. Abstract Types
  651. :font facename=default size=0x0.
  652. .br
  653. .br
  654. :p.
  655. :hp3.
  656. Traditionally, programming books wax mathematical when they arrive at the topic
  657. of abstract data typesà Such books make it seem as if you'd never actually
  658. use an abstract data type except as a sleep aid&per. :ehp3.
  659. :p.
  660. - Steve McConnell
  661.  
  662. :p.
  663. Information hiding is a technique for handling complexity&per.  By hiding
  664. implementation details, programs can be understood and developed in distinct
  665. modules and the effects of a change can be localized&per.  One technique for
  666. information hiding is data abstraction&per.  An abstract type is used to represent
  667. some natural program abstraction&per.  It provides functions for manipulating
  668. instances of the type&per.  The module that implements these functions is called
  669. the :hp1.implementation:ehp1. module&per.  We call the functions that are part of the
  670. implementation of an abstract type the :hp1.operations:ehp1. of the type&per.  Other
  671. modules that use the abstract type are called :hp1.clients:ehp1.&per.
  672. :p.
  673. :p.
  674. Clients may use the type name and operations, but should not manipulate or rely
  675. on the actual representation of the type&per.  Only the implementation module may
  676. manipulate the representation of an abstract type&per.  This hides information,
  677. since implementers and maintainers of client modules should not need to know
  678. anything about how the abstract type is implemented&per. It provides modularity,
  679. since the representation of an abstract type can be changed without having to
  680. change any client code&per.
  681. :p.
  682. :p.
  683. LCLint supports abstract types by detecting places where client code depends on
  684. the concrete representation of an abstract type&per.  
  685. :p.
  686. To declare an abstract type, the abstract annotation is added to a typedef&per.
  687. For example (in :font facename='System VIO' size=14x8.mstring&per.h:font facename=default size=0x0.),
  688. :cgraphic.
  689. typedef /*@abstract@*/ char *mstring;
  690. :ecgraphic.
  691. declares :font facename='System VIO' size=14x8.mstring:font facename=default size=0x0. as an abstract type&per.  It is implemented using a :font facename='System VIO' size=14x8.char *:font facename=default size=0x0., but
  692. clients of the type should not depend on or need to be aware of this&per.  If it
  693. later becomes apparent that a better representation such as a string table
  694. should be used, we should be able to change the implementation of mstring
  695. without having to change or inspect any client code&per.
  696. :p.
  697. :p.
  698. In a client module, abstract types are checked by name, not structure&per.  LCLint
  699. reports an error if an instance of mstring is passed as a char * (for instance,
  700. as an argument to strlen), since the correctness of this call depends on the
  701. representation of the abstract type&per.  LCLint also reports errors if any C
  702. operator except assignment (=) or sizeof is used on an abstract type&per.  The
  703. assignment operator is allowed since its semantics do not depend on the
  704. representation of the type&per.:link reftype=hd res=5.[4]:elink.
  705.  
  706. The use of :font facename='System VIO' size=14x8.sizeof:font facename=default size=0x0. is also permitted, since this is the only way for clients
  707. to allocate pointers to the abstract type&per.  Type casting objects to or from
  708. abstract types in a client module is an abstraction violation and will generate
  709. a warning message&per.
  710. :p.
  711. :p.
  712. Normally, LCLint will assume a type definition is not abstract unless the
  713. :font facename='System VIO' size=14x8./*@abstract@*/:font facename=default size=0x0. qualifier is used&per.  If instead you want all user-defined types
  714. to be abstract types unless they are marked as concrete, the :link reftype=hd res=18.:font facename='System VIO' size=14x8.+impabstract:font facename=default size=0x0.:elink. flag
  715. can be used&per.  This adds an implicit abstract annotation to any typedef that is
  716. not marked with :font facename='System VIO' size=14x8./*@concrete@*/:font facename=default size=0x0.&per.
  717. :p.
  718. :p.
  719. Some examples of abstraction violations detected by LCLint are shown in
  720. :link reftype=hd res=44.Figure 2:elink.&per.
  721. :p.
  722.  
  723. .br
  724. :font facename='Helv' size=20x12.
  725. .br
  726.  
  727. 3&per.1 Access
  728. :font facename=default size=0x0.
  729. .br
  730. .br
  731. Where code may manipulate the representation of an abstract type, we say the
  732. code has :hp1.access:ehp1. to that type&per.  If code has access to an abstract type,
  733. the representation of the type and the abstract type are indistinguishable&per.
  734. Usually, an abstract type is implemented by a single program module that is the
  735. only code that has access to the type representation&per.  Sometimes, more
  736. complicated access control is desired if the implementation of an abstract type
  737. is split across program files, or particular client code needs to access the
  738. representation&per.
  739. :p.
  740. :p.
  741. There are a several ways of selecting what code has access the representation
  742. of an abstract type&colon.
  743. :p.
  744. :ul compact.
  745. :li.Modules&per.  An abstract type defined in :hp1.M:ehp1.&per.h is accessible in
  746. :hp1.M:ehp1.&per.c&per.  Controlled by the accessmodule flag&per.  This means when accessmodule
  747. is on, as it is by default, the module access rule is in effect&per.  If
  748. accessmodule is off (when :link reftype=hd res=18.:font facename='System VIO' size=14x8.-accessmodule:font facename=default size=0x0.:elink. is used), the module access rule is not
  749. in effect and an abstract type defined in :hp1.M:ehp1.&per.h is not necessarily
  750. accessible in :hp1.M:ehp1.&per.c
  751. :p.
  752. :li.File names&per.  An abstract type named :hp1.type:ehp1. is accessible in files
  753. named :hp1.type:ehp1.&per.:hp1.<extenstion>:ehp1.&per.  For example, the representation
  754. of mstring is be accessible in mstring&per.h and mstring&per.c&per.  Controlled by the
  755. :link reftype=hd res=18.:font facename='System VIO' size=14x8.accessfile:font facename=default size=0x0.:elink. flag&per.
  756. :p.
  757. :li.Function names&per.  An abstract type named :hp1.type:ehp1. may be accessible in
  758. a function named :hp1.type:ehp1._:hp1.name:ehp1. or :hp1.typeName:ehp1.&per.  For example,
  759. mstring_length and mstringLength would have access to the mstring abstract
  760. type&per.  Controlled by the naming convention (see Section 9)&per.
  761. :p.
  762. :li.Access control comments&per. The syntax /*@access :hp1.type:ehp1.,+@*/[6] allows the following code to access the
  763. representation of :hp1.type:ehp1.&per.  Similarly, /*@noaccess :hp1.type:ehp1.,+@*/
  764. restricts access to the representation of :hp1.type:ehp1.&per.  The type in a noaccess
  765. comment must have been declared as an abstract type&per.
  766.  
  767. :eul.
  768.  
  769. .br
  770. :font facename='Helv' size=20x12.
  771. .br
  772.  
  773. 3&per.2 Mutability
  774. :font facename=default size=0x0.
  775. .br
  776. .br
  777. We can view types as being :hp1.mutable:ehp1. or :hp1.immutable:ehp1.&per.  A type is
  778. mutable if the value of an instance of the type can be changed by passing it as
  779. a parameter to a function call&per.:link reftype=hd res=5.[7]:elink.  For example, the
  780. primitive type :font facename='System VIO' size=14x8.int:font facename=default size=0x0. is immutable&per.  If i is a local variable of type int and
  781. no variables point to the location where i is stored, the value of i must be
  782. the same before and after the call f(i)&per.  Structure and union types are also
  783. immutable, since they are copied when they are passed as arguments&per.  On the
  784. other hand, pointer types are mutable&per.  If x is a local variable of type int *,
  785. the value of *x (and hence, the value of the object x) can be changed by the
  786. function call g(x)&per.  
  787. :p.
  788. :p.
  789. The mutability of a concrete type is determined by its type definition&per. For
  790. abstract types, mutability does not depend on the type representation but on
  791. what operations the type provides&per. If an abstract type has operations that may
  792. change the value of instances of the type, the type is mutable&per.  If not, it is
  793. immutable&per.  The value of an instance of an immutable type never changes&per.  Since
  794. object sharing is noticeable only for mutable types, they are checked
  795. differently from immutable types&per.
  796. :p.
  797. The :font facename='System VIO' size=14x8./*@mutable@*/:font facename=default size=0x0. and :font facename='System VIO' size=14x8./*@immutable@*/:font facename=default size=0x0. annotations are used to declare an
  798. abstract type as mutable or immutable&per.  (If neither is used, the abstract type
  799. is assumed to be mutable&per.)  For example,
  800. :p.
  801. :font facename='System VIO' size=14x8.
  802.    typedef /*@abstract@*/ /*@mutable@*/ char *mstring;
  803.    typedef /*@abstract@*/ /*@immutable@*/ int weekDay;
  804. :font facename=default size=0x0.
  805. declares mstring as a mutable abstract type and weekDay as  an immutable
  806. abstract type&per.
  807. :p.
  808. :p.
  809. Clients of  a mutable abstract type need to know the semantics of assignment&per.
  810. After the assignment expression s = t, do s and t refer to the same object
  811. (that is, will changes to the value of s also change the value of t)?
  812. :p.
  813. :p.
  814. LCLint prescribes that all abstract types have sharing semantics, so s and t
  815. would indeed be the same object&per.  LCLint will report an error if a mutable type
  816. is implemented with a representation (e&per.g&per., a struct) that does not provide
  817. sharing semantics (controlled by mutrep flag)&per.  
  818. :p.
  819. :p.
  820. The mutability of an abstract type is not necessarily the same as the
  821. mutability of its representation&per. We could use the immutable concrete type int
  822. to represent mutable strings using an index into a string table, or declare
  823. mstring as immutable as long as no operations are provided that modify the
  824. value of an mstring&per.
  825.  
  826. .br
  827. :font facename='Helv' size=20x12.
  828. .br
  829.  
  830. 3&per.3 Boolean Types
  831. :font facename=default size=0x0.
  832. .br
  833. .br
  834. Standard C has no boolean representation - the result of a comparison operator
  835. is an integer, and no type checking is done for test expressions&per.  Many common
  836. errors can be detected by introducing a distinct boolean type and stronger type
  837. checking&per.
  838. :p.
  839. :p.
  840. By convention, the bool type is used to represent boolean values&per.[8]  Relations,
  841. comparisons and certain standard library functions are declared to return bool
  842. types&per.
  843. :p.
  844.  
  845. LCLint checks that the test expression in an if, while, or for statement
  846. or an operand to &.&., || or ! is a boolean&per.  If the type of a test
  847. expression is not a boolean, LCLint will report an error depending on the type
  848. of the test expression and flag settings&per.  If the test expression has pointer
  849. type, LCLint reports an error if predboolptr is on (this can be used to prevent
  850. messages for the idiom of  testing if a pointer is not null without a
  851. comparison)&per.  If it is type int, an error is reported if predboolint is on&per.
  852. For all other types, LCLint reports an error if predboolothers is on&per.
  853. :p.
  854. :p.
  855. Since using = instead of == is such a common bug, reporting of test expressions
  856. that are assignments is controlled by the separate predassign flag&per.  The
  857. message can be suppressed by adding extra parentheses around the test
  858. expression&per.
  859. :p.
  860. :p.
  861. :link reftype=hd res=18.Apppendix C:elink. (page 
  862. 50)
  863. describes other flags for controlling boolean checking&per.
  864.  
  865. :p.
  866. :link reftype=hd res=45.Figure 3&per.  Boolean Checking:elink.
  867. .br
  868. :font facename='Helv' size=20x12.
  869. .br
  870.  
  871. 3&per.4 Primitive C Types
  872. :font facename=default size=0x0.
  873. .br
  874. .br
  875. :p.
  876. :hp3.Two types have :hp1.compatible type:ehp1. if their types are the same&per.:ehp3.
  877. .br
  878. - ANSI C, 3&per.1&per.2&per.6&per.
  879. .br
  880. :p.
  881. :hp3.Two types need not be identical to be compatible&per.:ehp3.
  882. .br
  883. - ANSI C, footnote to 3&per.1&per.2&per.6&per.
  884.  
  885. LCLint supports stricter checking of primitive C types&per.  The char and enum
  886. types can be checked as distinct types, and the different numeric types can be
  887. type-checked strictly&per.
  888.  
  889. .br
  890. :font facename='Tms Rmn' size=18x10.
  891. .br
  892.  
  893. 3&per.4&per.1 Characters
  894. :font facename=default size=0x0.
  895. .br
  896. .br
  897. The primitive char type can be type-checked as a distinct type&per.  If char is
  898. used as a distinct type, common errors involving assigning ints to chars are
  899. detected&per.
  900. :p.
  901. :p.
  902. The :link reftype=hd res=18.:font facename='System VIO' size=14x8.+charint:font facename=default size=0x0.:elink. flag can be used for checking legacy programs where char and int
  903. are used interchangeably&per.  If charint is on, char types indistinguishable from
  904. ints&per.  To keep char and int as distinct types, but allow chars to be used to
  905. index arrays, use :link reftype=hd res=18.:font facename='System VIO' size=14x8.+charindex:font facename=default size=0x0.:elink.&per.
  906.  
  907. .br
  908. :font facename='Tms Rmn' size=18x10.
  909. .br
  910. 3&per.4&per.2 Enumerators
  911. :font facename=default size=0x0.
  912. .br
  913. .br
  914. Standard C treats user-declared enum types just like integers&per.  An arbitrary
  915. integral value may be assigned to an enum type, whether or not it was listed as
  916. an enumerator member&per.  LCLint checks each user-defined enum type as distinct
  917. type&per.  An error is reported if a value that is not an enumerator member is
  918. assigned to the enum type, or if an enum type is used as an operand to an
  919. arithmetic operator&per.
  920. :p.
  921. :p.
  922. If the enumint flag is on, enum and int types may be used interchangeably&per.
  923. Like charindex, if  the enumindex flag is on, enum types may be used to index
  924. arrays&per.
  925. .br
  926. :font facename='Tms Rmn' size=18x10.
  927. .br
  928. 3&per.4&per.3 Numeric Types
  929. :font facename=default size=0x0.
  930. .br
  931. .br
  932. LCLint reports where numeric types are used in dangerous or inconsistent ways&per.
  933. With the strictest checking, LCLint will report an error anytime numeric types
  934. do not match exactly&per.  If the relaxquals flag is on, only those
  935. inconsistencies which may corrupt values are reported&per.  For example, if an int
  936. is assigned to a variable of type long (or passed as a long formal parameter),
  937. LCLint will not report an error if relaxquals is on since a long must have
  938. at least enough bits to store an int without data loss&per.  On the other hand, an
  939. error would be reported if the long were assigned to an int, since the int type
  940. may not have enough bits to store the long value&per.
  941. :p.
  942. :p.
  943. Similarly, if a signed value is assigned to an unsigned, LCLint will report an
  944. error since an unsigned type cannot represent all signed values correctly&per.  If
  945. the ignoresigns flag is on, checking is relaxed to ignore all sign qualifiers
  946. in type comparisons (this is not recommended, since it will suppress reporting
  947. of real bugs, but may be necessary for quickly checking certain legacy code)&per.  
  948.  
  949. .br
  950. :font facename='Tms Rmn' size=18x10.
  951. .br
  952. 3&per.4&per.4 Arbitrary Integral Types
  953. :font facename=default size=0x0.
  954. .br
  955. .br
  956.  
  957. LCLint supports three different kinds of arbitrary integral types&colon.
  958. :p.
  959. :p.
  960. :font facename='System VIO' size=14x8./*@integraltype@*/:font facename=default size=0x0.
  961. :p.
  962. An arbitrary integral type&per.  The actual type may be any one of
  963. :font facename='System VIO' size=14x8.short:font facename=default size=0x0., :font facename='System VIO' size=14x8.int:font facename=default size=0x0., :font facename='System VIO' size=14x8.long:font facename=default size=0x0., 
  964. :font facename='System VIO' size=14x8.unsigned short:font facename=default size=0x0., :font facename='System VIO' size=14x8.unsigned:font facename=default size=0x0., or :font facename='System VIO' size=14x8.unsigned long:font facename=default size=0x0.
  965. &per. 
  966.  
  967. :p.
  968. :font facename='System VIO' size=14x8./*@unsignedintegraltype@*/:font facename=default size=0x0.
  969. :p.
  970. An arbitrary unsigned integral type&per.  The actual type may be any one of
  971. :font facename='System VIO' size=14x8.unsigned short:font facename=default size=0x0., :font facename='System VIO' size=14x8.unsigned:font facename=default size=0x0., or :font facename='System VIO' size=14x8.unsigned long:font facename=default size=0x0.
  972. &per.
  973.  
  974.  
  975. :p.
  976. :font facename='System VIO' size=14x8./*@signedintegraltype@*/:font facename=default size=0x0.
  977. :p.
  978. An arbitrary signed integral type&per.  The actual type may be any one of
  979. :font facename='System VIO' size=14x8.short:font facename=default size=0x0., :font facename='System VIO' size=14x8.int:font facename=default size=0x0., or :font facename='System VIO' size=14x8.long:font facename=default size=0x0.&per. 
  980.  
  981.  
  982. :p.
  983. LCLint reports an error if the code depends on the actual representation
  984. of a type declared as an arbitrary integral&per.  The :font facename='System VIO' size=14x8.match-any-integral:font facename=default size=0x0.
  985. flag relaxes checking and allows an arbitrary integral type is allowed
  986. to match any integral type&per. 
  987.  
  988. :p.
  989.  
  990. Other flags set the arbitrary integral types to a concrete type&per.  These
  991. should only be used if portability to platforms that may use different
  992. representations is not important&per.  The :font facename='System VIO' size=14x8.long-integral:font facename=default size=0x0. and
  993. :font facename='System VIO' size=14x8.long-unsigned-integral:font facename=default size=0x0. flags set the type corresponding to
  994. :font facename='System VIO' size=14x8./*@integraltype@*/:font facename=default size=0x0. to be :font facename='System VIO' size=14x8.unsigned long:font facename=default size=0x0. and
  995. :font facename='System VIO' size=14x8.long:font facename=default size=0x0. respectively&per. The :font facename='System VIO' size=14x8.long-unsigned-unsigned-integral:font facename=default size=0x0.
  996. flag sets the type corresponding to :font facename='System VIO' size=14x8./*@unsignedintegraltype@*/:font facename=default size=0x0.
  997. to be :font facename='System VIO' size=14x8.unsigned long:font facename=default size=0x0.&per. The :font facename='System VIO' size=14x8.long-signed-integral:font facename=default size=0x0.
  998. flag sets the type corresponding to :font facename='System VIO' size=14x8./*@signedintegraltype@*/:font facename=default size=0x0. to
  999. be :font facename='System VIO' size=14x8.long:font facename=default size=0x0.&per.
  1000.  
  1001. :p.
  1002. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  1003. .br
  1004. :link reftype=hd res=7.
  1005. :elink.
  1006. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=7.:eartlink.:link reftype=hd res=7.:elink.
  1007. :link reftype=hd res=1.
  1008. :elink.
  1009. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  1010. :link reftype=hd res=27.
  1011. :elink.
  1012. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  1013.  
  1014. :link reftype=hd res=2.David Evans:elink. 
  1015. .br
  1016. :link reftype=hd res=3.Systematic Program Development:elink.
  1017. .br
  1018. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  1019.  
  1020.  
  1021. .* Source filename: sec4.html
  1022. :h2 res=7.LCLint User's Guide - 4&per. Function Interfaces
  1023. :font facename=default size=0x0.
  1024. :p.
  1025.  
  1026. .br
  1027. :font facename='Helv' size=32x20.
  1028. .br
  1029.  
  1030. 4&per. Function Interfaces
  1031. :font facename=default size=0x0.
  1032. .br
  1033. .br
  1034. Functions communicate with their calling environment through an interface&per.  The
  1035. caller communicates the values of actual parameters and global variables to the
  1036. function, and the function communicates to the caller through the return value,
  1037. global variables and storage reachable from the actual parameters&per.  By keeping
  1038. interfaces narrow (i&per.e&per., restricting the amount of information visible across a
  1039. function interface), we can understand and implement functions independently&per.
  1040. :p.
  1041. :p.
  1042. A function prototype documents the interface to a function&per.  It serves as a
  1043. contract between the function and its caller&per.  In early versions of C, the
  1044. function "prototype" was very limited&per.  It described the type returned by the
  1045. function but nothing about its parameters&per.  The main improvement provided by
  1046. ANSI C was the ability to add information on the number and types of parameter
  1047. to a function&per.  LCLint provides the means to express much more about a function
  1048. interface&colon. what global variable the function may use, what values visible to
  1049. the caller it may modify, if a pointer parameter may be a null pointer or point
  1050. to undefined storage, if storage pointed to by a parameter is deallocated
  1051. before the function returns, if the function may create new aliases to a
  1052. parameter, can the caller modify or deallocate the return value, etc&per.  
  1053. :p.
  1054. :p.
  1055. The extra interface information places constraints on both how the function may
  1056. be called and how it may be implemented&per.  LCLint reports places where these
  1057. constrains are not satisfied&per.  Typically, these indicate bugs in the code or
  1058. errors in the interface documentation&per.
  1059. :p.
  1060. :p.
  1061. This section describes syntactic comments may be added to a function
  1062. declaration to document what global variables the function implementation may
  1063. use and what values visible to its caller it may modify&per.  Sections 5-7 describe
  1064. annotations may be added to parameters to constrain valid arguments to a
  1065. function and how these arguments may be used after the call and to the return
  1066. value to constrain results&per. 
  1067.  
  1068. .br
  1069. :font facename='Helv' size=20x12.
  1070. .br
  1071.  
  1072. 4&per.1 Modifications
  1073. :font facename=default size=0x0.
  1074. .br
  1075. .br
  1076. The modifies clause lists what values visible to the caller may be modified by
  1077. a function&per.  Modifies clauses limit what values a function may modify, but they
  1078. do not require that listed values are always modified&per.  The declaration,
  1079. :cgraphic.
  1080. int f (int *p, int *q) /*@modifies *p@*/;
  1081. :ecgraphic.
  1082. declares a function f that may modify the value pointed to by its first
  1083. argument but may not modify the value of its second argument or any global
  1084. state&per.
  1085. :p.
  1086. :p.
  1087. LCLint checks that a function does not modify any caller-visible value not
  1088. encompassed by its  modifies clause and does modify all values listed in its
  1089. modifies clause on some possible execution of the function&per.  Figure 4 shows an
  1090. example of modifies checking done by LCLint&per.
  1091.  
  1092. .br
  1093. :font facename='Tms Rmn' size=18x10.
  1094. .br
  1095.  
  1096. 4&per.1&per.1 Special Modifications
  1097. :font facename=default size=0x0.
  1098. .br
  1099. .br
  1100. A few special names are provided for describing function modifications&colon.
  1101. :p.
  1102. :font facename='System VIO' size=14x8.internalState:font facename=default size=0x0.
  1103. :p.
  1104. The function modifies some internal state (that is, the value of a static
  1105. variable)&per.  Even though a client cannot access the internal state directly, it
  1106. is important to know that something may be modified by the function call
  1107. both for clear documentation and for checking undefined order of
  1108. evaluation (:link reftype=hd res=13.Section 10&per.1:elink.) and
  1109. side-effect free parameters (Section 8&per.2&per.1)&per.
  1110. :p. 
  1111.  
  1112. :font facename='System VIO' size=14x8.fileSystem:font facename=default size=0x0.
  1113. :p.
  1114. The function modifies the file system&per.  Any modification that may change
  1115. the system state is considered a file system modification&per.  All
  1116. functions that modify an object of type pointer to :font facename='System VIO' size=14x8.FILE:font facename=default size=0x0. also
  1117. modify the file system&per.  In addition, functions that do not modify a
  1118. :font facename='System VIO' size=14x8.FILE:font facename=default size=0x0. pointer but modify some state that is visible outside this
  1119. process also modify the file system (e&per.g&per., :font facename='System VIO' size=14x8.rename:font facename=default size=0x0.)&per.  The flag
  1120. :link reftype=hd res=18.:font facename='System VIO' size=14x8.mod-file-system:font facename=default size=0x0.:elink.
  1121. controls reporting of undocumented file system modifications&per.
  1122.  
  1123.  
  1124. :font facename='System VIO' size=14x8.nothing:font facename=default size=0x0.
  1125. :p.
  1126. The function modifies nothing (i&per.e&per., it is side-effect free)&per. 
  1127.  
  1128. :p.
  1129. The syntactic comment, :font facename='System VIO' size=14x8./*@*/:font facename=default size=0x0. in a function declaration or definition (after the
  1130. parameter list, before the semi-colon or function body) denotes a function that
  1131. modifies nothing and does not use any global variables (see :link reftype=hd res=7.Section 4&per.2:elink.)&per.
  1132.  
  1133. :p.
  1134. :link reftype=hd res=46.Figure 4&per.  Modifies checking&per.:elink.
  1135. :p.
  1136.  
  1137. .br
  1138. :font facename='Tms Rmn' size=18x10.
  1139. .br
  1140.  
  1141. 4&per.1&per.2 Missing Modifies Clauses
  1142. :font facename=default size=0x0.
  1143. .br
  1144. .br
  1145. LCLint is designed so programs with many functions that are declared without
  1146. modifies clauses can be checked effectively&per.  Unless modnomods is in on, no
  1147. modification errors are reported checking a function declared with no modifies
  1148. clause&per.  
  1149. :p.
  1150. :p.
  1151. A function with no modifies clause is an :hp1.unconstrained:ehp1. function since
  1152. there are no documented constraints on what it may modify&per.  When an
  1153. unconstrained function is called, it is checked differently from a function
  1154. declared with a modifies clause&per.  To prevent spurious errors, no modification
  1155. error is reported at the call site unless the moduncon flag is on&per.  Flags
  1156. control whether errors involving unconstrained functions are reported for other
  1157. checks that depend on modifications (side-effect free macro parameters
  1158. (:link reftype=hd res=11.Section 8&per.2&per.1:elink.), undefined evaluation order (:link reftype=hd res=13.Section 10&per.1:elink.), and likely infinite loops
  1159. (:link reftype=hd res=13.Section 10&per.2&per.1:elink.)&per.)
  1160.  
  1161. .br
  1162. :font facename='Tms Rmn' size=18x10.
  1163. .br
  1164.  
  1165. 4&per.1&per.3 Limitations
  1166. :font facename=default size=0x0.
  1167. .br
  1168. .br
  1169. Determining whether a function modifies a particular parameter or global is in
  1170. general an undecidable:link reftype=hd res=5.[9]:elink. problem&per.  To enable useful
  1171. checking, certain simplifying assumptions are necessary&per.  LCLint assumes an
  1172. object is modified when it appears on the left hand side of an assignment or it
  1173. is passed to a function as a parameter which may be modified by that function
  1174. (according to the called function's modifies clause)&per. Hence, LCLint will report
  1175. spurious modification errors for assignments that do not change the value
  1176. of an object or modifications that are always reversed before a procedure
  1177. returns&per.  The :font facename='System VIO' size=14x8./*@-mods@*/:font facename=default size=0x0. and :font facename='System VIO' size=14x8./*@=mods@*/:font facename=default size=0x0. control comments can be used around
  1178. these modifications to suppress the message&per. 
  1179.  
  1180. .br
  1181. :font facename='Helv' size=20x12.
  1182. .br
  1183.  
  1184. 4&per.2 Global Variables
  1185. :font facename=default size=0x0.
  1186. .br
  1187. .br
  1188. Another aspect of a function's interface, is the global variables it uses&per.  A
  1189. globals list in a function declaration lists external variables that may be
  1190. used in the function body&per. LCLint checks that global variables used in a
  1191. procedure match those listed in its globals list&per. A global is used in a
  1192. function if it appears in the body directly, or it is in the globals list of a
  1193. function called in the body&per. LCLint reports if a global that is used in a
  1194. procedure is not listed in its globals list, and if a listed global is not used
  1195. in the function implementation&per.  
  1196. :p.
  1197.  
  1198. :link reftype=hd res=47.Figure 5:elink. shows an example function definition with a globals list and associated checking done by LCLint&per.
  1199.  
  1200. .br
  1201. :font facename='Tms Rmn' size=18x10.
  1202. .br
  1203.  
  1204. 4&per.2&per.1 Controlling Globals Checking
  1205. :font facename=default size=0x0.
  1206. .br
  1207. .br
  1208. Whether on not an error is reported for a use of a global variable in a given
  1209. function depends on the scope of the variable (file static or external), the
  1210. checking annotation used in the variable declaration or the implicit annotation
  1211. if no checking annotation is used, whether or not the function is declared with
  1212. a globals list, and flag settings&per. 
  1213. :p.
  1214. :p.
  1215. A global or file static variable declaration may be preceded by an annotation
  1216. to indicate how the variable should be checked&per.  In order of decreasing checks,
  1217. the annotations are&colon.
  1218. :p.
  1219. :font facename='System VIO' size=14x8./*@checkedstrict@*/:font facename=default size=0x0.
  1220. :p.
  1221. Strictest checking&per.  Undocumented uses and modifications of the variable are
  1222. reported in all functions whether or not they have a globals list (unless
  1223. :link reftype=hd res=18.:font facename='System VIO' size=14x8.checkstrictglobs:font facename=default size=0x0.:elink. is off)&per.
  1224.  
  1225. :font facename='System VIO' size=14x8./*@checked@*/:font facename=default size=0x0.
  1226. :p.
  1227. Undocumented use of the variable is reported in a function with a globals list,
  1228. but not in a function declared with no globals (unless :link reftype=hd res=18.:font facename='System VIO' size=14x8.globnoglobs:font facename=default size=0x0.:elink. is on)&per.
  1229. :p.
  1230.  
  1231. :font facename='System VIO' size=14x8./*@checkmod@*/:font facename=default size=0x0.
  1232. :p.
  1233. Undocumented uses of the variable are not reported, but undocumented
  1234. modifications are reported&per.   (If :link reftype=hd res=18.:font facename='System VIO' size=14x8.modglobsnomods:font facename=default size=0x0.:elink. is on, errors are reported even
  1235. in functions declared with no modifies clause or globals list&per.)
  1236.  
  1237. :font facename='System VIO' size=14x8./*@unchecked@*/:font facename=default size=0x0.
  1238. :p.
  1239. No messages are reported for undocumented use or modification of this global
  1240. variable&per.  If a variable has none of these annotations, an implicit
  1241. annotation is determined by the flag settings&per.  
  1242.  
  1243. :p.
  1244. Different flags control the implicit annotation for variables declared with
  1245. global scope and variables declared with file scope (i&per.e&per., using the static
  1246. storage qualifier)&per. To set the implicit annotation for global variables
  1247. declared in :hp1.context:ehp1. (globs for external variables or statics for file
  1248. static variable) to be :hp1.annotation:ehp1. (:font facename='System VIO' size=14x8.checked:font facename=default size=0x0., :font facename='System VIO' size=14x8.checkmod:font facename=default size=0x0., :font facename='System VIO' size=14x8.checkedstrict
  1249. :font facename=default size=0x0.) use
  1250. imp:hp1.<annotation><context>:ehp1.&per.  For example,
  1251. :link reftype=hd res=18.:font facename='System VIO' size=14x8.+impcheckedstrictstatics:font facename=default size=0x0.:elink. makes the implicit checking on unqualified file static
  1252. variables checkedstrict&per.  (See :link reftype=hd res=18.Apppendix C:elink., page 51, for a complete list of
  1253. globals checking flags&per.)
  1254.  
  1255. .br
  1256. :font facename='Helv' size=20x12.
  1257. .br
  1258.  
  1259. 4&per.3 Declaration Consistency
  1260. :font facename=default size=0x0.
  1261. .br
  1262. .br
  1263. LCLint checks that function declarations and definitions are consistent&per.  The
  1264. general rule is that the :hp1.first:ehp1. declaration of a function imply all later
  1265. declarations and definitions&per.  If a function is declared in a header file, the
  1266. first declaration processed is its first declaration (if it is declared in more
  1267. than one header file an error is reported if redecl is set)&per.  Otherwise, the
  1268. first declaration in the file defining the function is its first declaration&per.
  1269. :p.
  1270. :p.
  1271. Later declarations may not include variables in the globals list that were not
  1272. included in the first declaration&per.  The exception to this is when the first
  1273. declaration is in a header file and the later declaration or definition
  1274. includes file static variables&per.  Since these are not visible in the header
  1275. file, they can not be included in the header file declaration&per.  Similarly, the
  1276. modifies clause of a later declaration may not include objects that are not
  1277. modifiable in the first declaration&per.  The later declaration may be more
  1278. specific&per.  For example, if the header declaration is&colon.
  1279. :cgraphic.
  1280. extern void setName (employee e, char *s) /*@modifies e@*/;
  1281. :ecgraphic.
  1282. the later declaration could be,
  1283. :cgraphic.
  1284.    void setName (employee e, char *) /*@modifies e->name@*/;
  1285. :ecgraphic.
  1286. If employee is an abstract type, the declaration in the header should not refer
  1287. to a particular implementation (i&per.e&per., it shouldn't rely on there being a name
  1288. field), but the implementation declaration can be more specific&per.  
  1289. :p.
  1290. :p.
  1291. This rule also applies to file static variables&per.  The header declaration for a
  1292. function that modifies a file static variable should use modifies internalState
  1293. since file static variables are not visible to clients&per.  The implementation
  1294. declaration should list the actual file static variables that may be modified&per.
  1295.  
  1296. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  1297. .br
  1298. :link reftype=hd res=8.
  1299. :elink.
  1300. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=8.:eartlink.:link reftype=hd res=8.:elink.
  1301. :link reftype=hd res=1.
  1302. :elink.
  1303. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  1304. :link reftype=hd res=27.
  1305. :elink.
  1306. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  1307.  
  1308. :link reftype=hd res=2.David Evans:elink. 
  1309. .br
  1310. :link reftype=hd res=3.Systematic Program Development:elink.
  1311. .br
  1312. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  1313.  
  1314.  
  1315. .* Source filename: sec5.html
  1316. :h2 res=8.LCLint User's Guide - 5&per. Memory Management
  1317. :font facename=default size=0x0.
  1318. :p.
  1319.  
  1320. .br
  1321. :font facename='Helv' size=32x20.
  1322. .br
  1323.  
  1324. 5&per. Memory Management
  1325. :font facename=default size=0x0.
  1326. .br
  1327. .br
  1328. About half the bugs in typical C programs can be attributed to memory
  1329. management problems&per.  Memory management bugs are notoriously difficult to
  1330. detect through traditional techniques&per.  Often, the symptom of the bug is far
  1331. removed from its actual source&per.  Memory management bug often only appear
  1332. sporadically and some bugs may only be apparent when compiler optimizations are
  1333. turned on or the code is compiled on a different platform&per.  Run-time tools
  1334. offer some help, but are cumbersome to use and limited to detecting errors that
  1335. occur when test cases are run&per.  By detecting these errors statically, we can be
  1336. confident that certain types of errors will never occur and provide verified
  1337. documentation on the memory management behavior of a program&per.  
  1338. :p.
  1339. :p.
  1340. LCLint can detect many memory management errors at compile time including&colon.
  1341. :p.
  1342. :ul compact.
  1343. :li.using storage that may have been freed (:link reftype=hd res=8.Section 5&per.2:elink.)
  1344. :p.
  1345. :li.failing to deallocate memory (:link reftype=hd res=8.Section 5&per.2:elink.)
  1346. :p.
  1347. :li.returning a pointer to stack-allocated storage (:link reftype=hd res=8.Section 5&per.2&per.6:elink.)
  1348. :p.
  1349. :li.undocumented or dangerous aliasing or storage sharing (:link reftype=hd res=9.Section 6:elink.)
  1350. :p.
  1351. :li.passing or returning storage that is not completely defined (Section 7&per.1)
  1352. :p.
  1353. :li.dereferencing a null pointers (:link reftype=hd res=10.Section 7&per.2:elink.)
  1354. :p.
  1355. :eul.
  1356.  
  1357.  
  1358. Most of these checks rely heavily on annotations added to programs to document
  1359. assumptions related to memory management and pointer values&per.  By documenting
  1360. these assumptions for function interfaces, variables, type definitions and
  1361. structure fields, memory management bugs can be detected at their source --
  1362. where an assumption is violated&per.  In addition, precise documentation about
  1363. memory management decisions makes its easier to change code&per.
  1364.  
  1365. .br
  1366. :font facename='Helv' size=20x12.
  1367. .br
  1368.  
  1369. 5&per.1 Storage Model:link reftype=hd res=5.[10]:elink.
  1370. :font facename=default size=0x0.
  1371. .br
  1372. .br
  1373. :p.
  1374. :hp3. Yea, from the table of my memory I'll wipe away all trivial fond records, all
  1375. saws of books, all forms, all pressures past, that youth and observation copied
  1376. there&per.:ehp3.
  1377. .br
  1378. - Hamlet prefers garbage collection (Shakespeare, Hamlet&per. Act I, Scene
  1379. v)
  1380.  
  1381.  
  1382. This section describes execution-time concepts for describing the state of
  1383. storage more precisely than can be done using standard C terminology&per.  Certain
  1384. uses of storage are likely to indicate program bugs, and are reported as
  1385. anomalies&per.
  1386. :p.
  1387. :p.
  1388. LCL assumes a CLU-like object storage model&per.[11]  An :hp1.object:ehp1. is a typed region
  1389. of storage&per.  Some objects use a fixed amount of storage that is allocated and deallocated automatically by the
  1390. compiler&per.
  1391. :p.
  1392. Other objects use dynamic storage that must be managed by the program&per.
  1393. :p.
  1394. :p.
  1395. Storage is :hp1.undefined:ehp1. if it has not been assigned a value, and
  1396. :hp1.defined:ehp1. after it has been assigned a value&per.  An object is :hp1.completely
  1397. defined:ehp1. if all storage that may be reached from it is defined&per.  What
  1398. storage is reachable from an object depends on the type and value of the
  1399. object&per.  For example, if p is a pointer to a structure, p is completely defined
  1400. if the value of p is NULL, or if every field of the structure p points to is
  1401. completely defined&per.
  1402. :p.
  1403. :p.
  1404. When an expression is used as the left side of an assignment expression we say
  1405. it is :hp1.used as an lvalue:ehp1.&per.  Its location in memory is used, but not its
  1406. value&per.  Undefined storage may be used as an lvalue since only its location is
  1407. needed&per.  When storage is used in any other way, such as on the right side of an
  1408. assignment, as an operand to a primitive operator (including the indirection
  1409. operator, *),:link reftype=hd res=5.[12]:elink. or as a
  1410. :p.
  1411. function parameter, we say it is :hp1.used as an rvalue:ehp1.&per.  It is an
  1412. anomaly to use undefined storage as an rvalue&per.
  1413. :p.
  1414. :p.
  1415. A :hp1.pointer:ehp1. is a typed memory address&per.  A pointer is either :hp1.live:ehp1. or
  1416. :hp1.dead:ehp1.&per.  A live pointer is either NULL or an address within allocated
  1417. storage&per.  A pointer that points to an object is an :hp1.object:ehp1. pointer&per.  A
  1418. pointer that points inside an object (e&per.g&per., to the third element of an
  1419. allocated block) is an :hp1.offset:ehp1. pointer&per.  A pointer that points to
  1420. allocated storage that is not defined is an :hp1.allocated:ehp1. pointer&per.  The
  1421. result of dereferencing an allocated pointer is undefined storage&per.  Hence, it
  1422. is an anomaly to use it as an rvalue&per.  A dead (or "dangling") pointer does not
  1423. point to allocated storage&per.  A pointer becomes dead if the storage it points to
  1424. is deallocated (e&per.g&per., the pointer is passed to the free library function&per.)  It
  1425. is an anomaly to use a dead pointer as an rvalue&per.
  1426. :p.
  1427. :p.
  1428. There is a special object :hp1.null:ehp1. corresponding to the NULL pointer in a C
  1429. program&per.  A pointer that may have the value NULL is a :hp1.possibly-null:ehp1.
  1430. pointer&per.  It is an anomaly to use a possibly-null pointer where a non-null
  1431. pointer is expected (e&per.g&per., certain function arguments or the indirection
  1432. operator)&per.
  1433.  
  1434. .br
  1435. :font facename='Helv' size=20x12.
  1436. .br
  1437.  
  1438. 5&per.2 Deallocation Errors
  1439. :font facename=default size=0x0.
  1440. .br
  1441. .br
  1442. There are two kinds of deallocation errors with which we are concerned&colon.
  1443. deallocating storage when there are other live references to the same storage,
  1444. or failing to deallocate storage before the last  reference to it is lost&per.  To
  1445. handle these deallocation errors, we introduce a concept of an obligation to
  1446. release storage&per.  Every time storage is allocated, it creates an obligation to
  1447. release the storage&per.  This obligation is attached to the reference to which the
  1448. storage is assigned&per.:link reftype=hd res=5.[13]:elink.  Before the scope of the
  1449. reference is exited or it is assigned to a new value, the storage to which it
  1450. points must be released&per.  Annotations can be used to indicate that this
  1451. obligation is transferred through a return value, function parameter or
  1452. assignment to an external reference&per.
  1453.  
  1454. .br
  1455. :font facename='Tms Rmn' size=18x10.
  1456. .br
  1457.  
  1458. 5&per.2&per.1 Unshared References
  1459. :font facename=default size=0x0.
  1460. .br
  1461. .br
  1462.  
  1463. :p.
  1464. :hp3.`Tis in my memory lock'd, and you yourself shall keep the key of it&per.:ehp3.
  1465. .br
  1466. - Ophelia prefers explicit deallocation (Hamlet&per.  Act I, Scene iii)
  1467.  
  1468.  
  1469. The only annotation is used to indicate a reference is the only pointer to the
  1470. object it points to&per.  We can view the reference as having an obligation to
  1471. release this storage&per.  This obligation is satisfied by transferring it to some other reference in one of three ways&colon.
  1472. :p.
  1473. :ul compact.
  1474. :li.pass it as an actual parameter corresponding to a formal parameter
  1475. declared with an only annotation               
  1476. :li.assign it to an external reference declared with an only annotation
  1477. :li.return it as a result declared with an only annotation
  1478. :eul.
  1479.  
  1480.  
  1481. After the release obligation is transferred, the original reference is a dead
  1482. pointer and the storage it points to may not be used&per. 
  1483. :p.
  1484.  
  1485. :p.
  1486. All obligations to release storage stem from primitive allocation routines
  1487. (e&per.g&per., malloc), and are ultimately satisfied by calls to free&per.  The standard
  1488. library declared the primitive allocation and deallocation routines&per.
  1489. :p.
  1490. The basic memory allocator, malloc, is declared&colon.[14]
  1491. :p.
  1492. :cgraphic.
  1493. /*@only@*/ void *malloc (size_t size);
  1494. :ecgraphic.
  1495. It returns an object that is referenced only by the function return value&per.  
  1496. :p.
  1497. :p.
  1498. The deallocator, free, is declared&colon.:link reftype=hd res=5.[15]:elink.
  1499. :p.
  1500. :cgraphic.
  1501. void free (/*@only@*/ void *ptr);
  1502. :ecgraphic.
  1503. :p.
  1504. The parameter to free must reference an unshared object&per.  Since the parameter
  1505. is declared using only, the caller may not use the referenced object after the
  1506. call, and may not pass in a reference to a shared object&per.  There is nothing
  1507. special about malloc and free -- their behavior can be described entirely in
  1508. terms of the provided annotations&per.
  1509.  
  1510. :p.
  1511. :link reftype=hd res=48.Figure 6&per.  Deallocation errors&per.:elink.
  1512. :p.
  1513. .br
  1514. :font facename='Tms Rmn' size=18x10.
  1515. .br
  1516.  
  1517. 5&per.2&per.2 Temporary Parameters
  1518. :font facename=default size=0x0.
  1519. .br
  1520. .br
  1521. The temp annotation is used to declare a function parameter that is used
  1522. temporarily by the function&per.  An error is reported if the function releases the
  1523. storage associated with a temp formal parameter or creates new aliases it that
  1524. are visible after the function returns&per.  Any storage may be passed as a temp
  1525. parameter, and it satisfies its original memory constraints after the function
  1526. returns&per.
  1527.  
  1528. .br
  1529. :font facename='Tms Rmn' size=18x10.
  1530. .br
  1531.  
  1532. 5&per.2&per.3 Owned and Dependent References
  1533. :font facename=default size=0x0.
  1534. .br
  1535. .br
  1536. In real programs it is sometimes necessary to have storage that is shared
  1537. between several possibly references&per.  The owned and dependent annotations
  1538. provide a more flexible way of managing storage, at the cost of less checking&per.
  1539. The owned annotation denotes a reference with an obligation to release storage&per.
  1540. Unlike only, however, other external references marked with dependent
  1541. annotations may share this object&per.  It is up to the programmer to ensure that
  1542. the lifetime of a dependent reference is contained within the lifetime of the
  1543. corresponding owned reference&per.
  1544.  
  1545. .br
  1546. :font facename='Tms Rmn' size=18x10.
  1547. .br
  1548.  
  1549. 5&per.2&per.4 Kept Parameters
  1550. :font facename=default size=0x0.
  1551. .br
  1552. .br
  1553. The keep annotation is similar to only, except the caller may use the reference
  1554. after the call&per.  The called function must assign the keep parameter to an only
  1555. reference, or pass it as a keep parameter to another function&per.  It is up to the
  1556. programmer to make sure that the calling function does not use this reference
  1557. after it is released&per.  The keep annotation is useful for adding an object to a
  1558. collection (e&per.g&per., a symbol table), where it is known that it will not be
  1559. deallocated until the collection is&per. 
  1560.  
  1561. .br
  1562. :font facename='Tms Rmn' size=18x10.
  1563. .br
  1564.  
  1565. 5&per.2&per.5 Shared References
  1566. :font facename=default size=0x0.
  1567. .br
  1568. .br
  1569. If LCLint is used to check a program designed to be used in a garbage-collected
  1570. environment, there may be storage that is shared by one or more references and
  1571. never explicitly released&per.  The shared annotation declares storage that may be
  1572. shared arbitrarily, but never released&per.
  1573.  
  1574. .br
  1575. :font facename='Tms Rmn' size=18x10.
  1576. .br
  1577.  
  1578. 5&per.2&per.6 Stack References
  1579. :font facename=default size=0x0.
  1580. .br
  1581. .br
  1582. Local variables that are not allocated dynamically are store on a call stack&per.
  1583. When a function returns, its stack frame is deallocated, destroying the storage
  1584. associated with the function's local variables&per.  A memory error occurs if a
  1585. pointer into this storage is live after the function returns&per.  LCLint detects
  1586. errors involving stack references exported from a function through return
  1587. values or assignments to references reachable from global variables or actual
  1588. parameters&per.  No annotations are needed to detect stack reference errors, since
  1589. it is clear from a declaration if storage is allocated on the function stack&per.
  1590. :p.
  1591. :link reftype=hd res=49.Figure 7&per.  Stack references&per.:elink.
  1592. :p.
  1593.  
  1594. .br
  1595. :font facename='Tms Rmn' size=18x10.
  1596. .br
  1597.  
  1598. 5&per.2&per.7 Inner Storage
  1599. :font facename=default size=0x0.
  1600. .br
  1601. .br
  1602. An annotation always applies to the outermost level of storage&per.  For example,
  1603. :cgraphic.
  1604. /*@only@*/ int **x;
  1605. :ecgraphic.
  1606. declares x as an unshared pointer to a pointer to an int&per.  The only annotation
  1607. applies to x, but not to *x&per.  To apply annotations to inner storage a type
  1608. definition may be used&colon.
  1609. :cgraphic.
  1610.   typedef /*@only@*/ int *oip;
  1611.   /*@only@*/ oip *x;
  1612. :ecgraphic.
  1613. Now, x is an only pointer to an oip, which is an only pointer to an int&per.
  1614. :p.
  1615. :p.
  1616. When annotations are use in type definitions, they may be overridden in
  1617. instance declarations&per.  For example,
  1618. :cgraphic.
  1619. /*@dependent@*/ oip x;
  1620. :ecgraphic.
  1621. makes x a dependent pointer to an int&per.
  1622.  
  1623. .br
  1624. :font facename='Helv' size=20x12.
  1625. .br
  1626.  
  1627. 5&per.3 Implicit Memory Annotations
  1628. :font facename=default size=0x0.
  1629. .br
  1630. .br
  1631. Since it is important that LCLint can check unannotated programs effectively,
  1632. the meaning of declarations with no memory annotations is chosen to minimize
  1633. the number of annotations needed to get useful checking on an unannotated
  1634. program&per. 
  1635. :p.
  1636. :p.
  1637. An implicit memory management annotation may be assumed for declarations with
  1638. no explicit memory management annotation&per.  Implicit annotations are checked
  1639. identically to the corresponding explicit annotation, except error messages
  1640. indicate that they result from an implicit annotation&per.
  1641. :p.
  1642. :p.
  1643. Unannotated function parameters are assumed to be temp&per.  This means if memory
  1644. checking is turned on for an unannotated program, all functions that release
  1645. storage referenced by a parameter or assign a global variable to alias the
  1646. storage will produce error messages&per.  (Controlled by paramimptemp&per.)
  1647. :p.
  1648. :p.
  1649. Unannotated return values, structure fields and global variables are assumed to
  1650. be only&per.  With implicit annotations (on by default), turning on memory checking
  1651. for an unannotated program will produce errors for any function that does not
  1652. return unshared storage or assignment of shared storage to a global variable or
  1653. structure field&per.:link reftype=hd res=5.[16]:elink.  (Controlled by
  1654. :link reftype=hd res=18.:font facename='System VIO' size=14x8.retimponly:font facename=default size=0x0.:elink., :font facename='System VIO' size=14x8.structimponly:font facename=default size=0x0. and :font facename='System VIO' size=14x8.globimponly
  1655. :font facename=default size=0x0.&per.  The :font facename='System VIO' size=14x8.codeimponly:font facename=default size=0x0. flag sets all of the implicit only flags&per.)   
  1656. :p.
  1657. :link reftype=hd res=50.Figure 8&per.  Implicit annotations:elink.
  1658. :p.
  1659. .br
  1660. :font facename='Helv' size=20x12.
  1661. .br
  1662.  
  1663. 5&per.4 Reference Counting
  1664. :font facename=default size=0x0.
  1665. .br
  1666. .br
  1667. Another approach to memory management is to add a field to a type to explicitly
  1668. keep track of the number of references to that storage&per.  Every time a reference
  1669. is added or lost the reference count is adjusted accordingly;  if it would
  1670. become zero, the storage is released&per.  Reference counting it difficult to do
  1671. without automatic checking since it is easy to forget to increment or decrement
  1672. the reference count, and exceedingly difficult to track down these errors&per.
  1673. :p.
  1674. :p.
  1675. LCLint supports reference counting by using annotations to constrain the use of
  1676. reference counted storage in a manner similar to other memory management
  1677. annotations&per.
  1678. :p.
  1679. :p.
  1680. A reference counted type is declared using the refcounted annotation&per.  Only
  1681. pointer to struct types may be declared as reference counted, since reference
  1682. counted storage must have a field to count the references&per.  One field in the
  1683. structure (or integral type) is preceded by the refs annotation to indicate
  1684. that the value of this field is the number of live references to the structure&per.
  1685. :p.
  1686.  
  1687. :p.
  1688. For example (in :font facename='System VIO' size=14x8.rstring&per.h:font facename=default size=0x0.),
  1689. :cgraphic.
  1690.      typedef /*@abstract@*/ /*@refcounted@*/ struct {
  1691.           /*@refs@*/ int refs;
  1692.         char *contents;
  1693.       } *rstring;
  1694. :ecgraphic.
  1695. declares rstring as an abstract, reference-counted type&per.  The refs field counts
  1696. the number of references and the contents field holds the contents of a
  1697. string&per.
  1698. :p.
  1699. :p.
  1700. All functions that return refcounted storage must increase the reference count
  1701. before returning&per.  LCLint cannot determine if the reference count was
  1702. increased, so any function that directly returns a reference to refcounted
  1703. storage will produce an error&per.  This is avoided, by using a function to return
  1704. a new reference (e&per.g&per., rstring_ref in Figure 9)&per.
  1705. :p.
  1706. :p.
  1707. A reference counted type may be passed as a temp or dependent parameter&per.  It
  1708. may not be passed as an only parameter&per.  Instead, the killref annotation is
  1709. used to denote a parameter whose reference is eliminated by the function call&per.
  1710. Like only parameters, an actual parameter corresponding to a killref formal
  1711. parameter may not be used in the calling function after the call&per.  LCLint
  1712. checks that the implementation of a function releases all killref parameters,
  1713. either by passing them as killref parameters, or assigning or returning them
  1714. without increasing the reference count&per.
  1715. :p.
  1716.  
  1717. :p.
  1718. :link reftype=hd res=51.Figure 9&per.  Reference counting&per.:elink.
  1719.  
  1720.  
  1721.  
  1722. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  1723. .br
  1724. :link reftype=hd res=9.
  1725. :elink.:artwork name='right-arrow.bmp' align=left.:artlink.:link reftype=hd res=9.:eartlink.:link reftype=hd res=9.:elink.
  1726. :link reftype=hd res=1.
  1727. :elink.:artwork name='up-arrow.bmp' align=left.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  1728. :link reftype=hd res=27.
  1729. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  1730.  
  1731. :link reftype=hd res=2.David Evans:elink. 
  1732. .br
  1733. :link reftype=hd res=3.Systematic Program Development:elink.
  1734. .br
  1735. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  1736.  
  1737.  
  1738. .* Source filename: sec6.html
  1739. :h2 res=9.LCLint User's Guide - 6&per. Sharing
  1740. :font facename=default size=0x0.
  1741. :p.
  1742.  
  1743. .br
  1744. :font facename='Helv' size=32x20.
  1745. .br
  1746.  
  1747. 6&per. Sharing
  1748. :font facename=default size=0x0.
  1749. .br
  1750. .br
  1751.  
  1752. Errors involving unexpected sharing of storage can cause serious problems&per.
  1753. Undocumented sharing may lead to unpredictable modifications, and some library
  1754. calls (e&per.g&per., strcpy) have undefined behavior if parameters share storage&per.
  1755. Another class of sharing errors occurs when clients of an abstract type may
  1756. obtain a reference to mutable storage that is part of the abstract
  1757. representation&per.  This exposes the representation of the abstract type, since
  1758. clients may modify an instance of the abstract type indirectly through this
  1759. shared storage&per.
  1760. :p.
  1761.  
  1762. .br
  1763. :font facename='Helv' size=20x12.
  1764. .br
  1765.  
  1766. 6&per.1 Aliasing
  1767. :font facename=default size=0x0.
  1768. .br
  1769. .br
  1770. LCLint detects errors involving dangerous aliasing of parameters&per.  Some of
  1771. these errors are already detected through the standard memory annotations
  1772. (e&per.g&per., only parameters may not be aliases&per.)   Two additional annotations are
  1773. provided for constraining aliasing of parameters and return values&per.
  1774.  
  1775. .br
  1776. :font facename='Tms Rmn' size=18x10.
  1777. .br
  1778.  
  1779. 6&per.1&per.1 Unique Parameters
  1780. :font facename=default size=0x0.
  1781. .br
  1782. .br
  1783. The unique annotation denotes a parameter that may not be aliased by any other
  1784. storage reachable from the function implementation -- that is, any storage
  1785. reachable through the other parameters or global variables used by the
  1786. function&per.  The unique annotation places similar constraints on function
  1787. parameters as the only annotation, but it does not transfer the obligation to
  1788. release storage&per.
  1789. :p.
  1790. LCLint will report an error if a unique parameter may be aliased by another
  1791. parameter or global variable&per.
  1792. :p.
  1793.  
  1794. :link reftype=hd res=52.Figure 10&per.  Unique parameters&per.:elink.
  1795.  
  1796. .br
  1797. :font facename='Tms Rmn' size=18x10.
  1798. .br
  1799.  
  1800. 6&per.1&per.2 Returned Parameters
  1801. :font facename=default size=0x0.
  1802. .br
  1803. .br
  1804. LCLint reports an error if a function returns a reference to storage reachable
  1805. from one of its parameters (if retalias is on) since this may introduce
  1806. unexpected aliases in the body of the calling function when the result is
  1807. assigned&per.
  1808. :p.
  1809. :p.
  1810. The returned annotation denotes a parameter that may be aliased by the return
  1811. value&per.  LCLint checks the call assuming the result may be an alias to the
  1812. returned parameter&per. :link reftype=hd res=53.Figure 11:elink. shows an example use of a returned annotation&per.
  1813.  
  1814. .br
  1815. :font facename='Helv' size=20x12.
  1816. .br
  1817.  
  1818. 6&per.2 Exposure
  1819. :font facename=default size=0x0.
  1820. .br
  1821. .br
  1822. LCLint detects places where the representation of an abstract type is exposed&per.
  1823. This occurs if a client has a pointer to storage that is part of the
  1824. representation of an instance of the abstract type&per.  The client can then modify
  1825. or examine the storage this points to, and manipulate the value of the abstract
  1826. type instance without using its operations&per.
  1827. :p.
  1828. :hp2.:ehp2.There are three ways a representation may be exposed&colon.
  1829. :ol compact.
  1830. :li.Returning (or assigning to a global variable) an object that includes a
  1831. pointer to a mutable component of an abstract type representation&per.  (Controlled
  1832. by :link reftype=hd res=18.:font facename='System VIO' size=14x8.retexpose:font facename=default size=0x0.:elink.)&per.
  1833. :li.Assigning a mutable component of an abstract object to storage reachable
  1834. from an actual parameter or a global variable that may be used after the call&per.
  1835. This means the client may manipulate the abstract object using the actual
  1836. parameter after the call&per.  Note that if the corresponding formal parameter is
  1837. declared only, the caller may not use the actual parameter after the call so
  1838. the representation is not exposed&per.  (Controlled by :link reftype=hd res=18.:font facename='System VIO' size=14x8.assignexpose:font facename=default size=0x0.:elink.)&per.
  1839. :li.Casting mutable storage to or from an abstract type&per.  (Controlled by
  1840. :link reftype=hd res=18.:font facename='System VIO' size=14x8.castexpose:font facename=default size=0x0.:elink.)&per.
  1841. :eol.
  1842.  
  1843.  
  1844. Annotations may be used to allow exposed storage to be returned safely by
  1845. restricting how the caller may use the returned storage&per.
  1846.  
  1847. .br
  1848. :font facename='Tms Rmn' size=18x10.
  1849. .br
  1850.  
  1851. 6&per.2&per.1 Read-Only Storage
  1852. :font facename=default size=0x0.
  1853. .br
  1854. .br
  1855. It is often useful for a function to return a pointer to internal storage (or a
  1856. instance of a mutable abstract type) that is intended only as an
  1857. :hp1.observer:ehp1.&per.  The caller may use the result, but should not modify the
  1858. storage it points to&per.  For example, consider an na╧ve implementation of
  1859. the employee_getName operation for the abstract employee type&colon.
  1860. :cgraphic.
  1861.    typedef /*@abstract@*/ struct {
  1862.       char *name;
  1863.       int id;
  1864.    } *employee;
  1865.    &per.&per.&per.
  1866.    char *employee_getName (employee e) { return e->name; }
  1867. :ecgraphic.
  1868. LCLint produces a message to indicate that the return value exposes the
  1869. representation&per.  One solution would be to return a fresh copy of e->name&per.
  1870. This is expensive, though, especially if we expect employee_getName is used
  1871. mainly just to get a string for searching or printing&per.  Instead, we could
  1872. change the declaration of employee_getName to&colon.
  1873. :cgraphic.
  1874. extern /*@observer@*/ char *employee_getName (employee e);
  1875. :ecgraphic.
  1876. Now, the original implementation is correct&per.  The declaration indicates that
  1877. the result may not be modified by the caller, so it is acceptable to return
  1878. shared storage&per.:link reftype=hd res=5.[17]:elink.  LCLint checks that the
  1879. return value is not modified by the caller&per.  An error is reported if observer
  1880. storage is modified directly, passed as a function parameter that may be
  1881. modified, assigned to a global variable or reference derivable from a global
  1882. variable that is not declared with an observer annotation, or returned as a
  1883. function result or a reference derivable from the function result that is not
  1884. annotation with an observer annotation&per.
  1885.  
  1886. .br
  1887. :font facename='Tms Rmn' size=16x8.
  1888. .br
  1889. String
  1890. Literals
  1891. :font facename=default size=0x0.
  1892. .br
  1893. .br
  1894. A program that attempts to modify a string literal has undefined behavior
  1895. [ANSI, Section 3&per.1&per.4]&per. This is not enforced by most C compilers, and can lead
  1896. to particularly pernicious bugs that only appear when optimizations are turned
  1897. on and the compiler attempts to minimize storage for string literals&per.  LCLint
  1898. can be used to check that string literals are not modified, by treating them as
  1899. observer storage&per.  If readonlystrings is on (default in standard mode), LCLint
  1900. will report an error if a string literal is modified&per. 
  1901.  
  1902. .br
  1903. :font facename='Tms Rmn' size=18x10.
  1904. .br
  1905.  
  1906. 6&per.2&per.2 Exposed Storage
  1907. :font facename=default size=0x0.
  1908. .br
  1909. .br
  1910. Sometimes it is necessary to expose the representation of an abstract type&per.
  1911. This may be evidence of a design flaw, but in some cases is justified for
  1912. efficiency reasons&per.  The exposed annotation denotes storage that is exposed&per.
  1913. It may be used on a return value for results that reference storage internal to
  1914. an abstract representation, on a parameter value to indicate a parameter that
  1915. may be assigned directly to part of an abstract representation,[18] or on a field of an abstract representation
  1916. to indicate that external references to the storage may exist&per.  
  1917. An
  1918. error is reported if exposed storage is released, but unlike an observer, no
  1919. error is reported if it is modified&per.
  1920. :p.
  1921. :p.
  1922. :link reftype=hd res=54.Figure 12:elink. shows examples of exposure problems detected by LCLint&per.
  1923.  
  1924.  
  1925. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  1926. .br
  1927. :link reftype=hd res=10.
  1928. :elink.
  1929. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=10.:eartlink.:link reftype=hd res=10.:elink.
  1930. :link reftype=hd res=1.
  1931. :elink.
  1932. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  1933. :link reftype=hd res=27.
  1934. :elink.
  1935. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  1936.  
  1937. :link reftype=hd res=2.David Evans:elink. 
  1938. .br
  1939. :link reftype=hd res=3.Systematic Program Development:elink.
  1940. .br
  1941. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  1942.  
  1943.  
  1944. .* Source filename: sec7.html
  1945. :h2 res=10.LCLint User's Guide - 7&per. Value Constraints
  1946. :font facename=default size=0x0.
  1947. :p.
  1948.  
  1949. .br
  1950. :font facename='Helv' size=32x20.
  1951. .br
  1952.  
  1953. 7&per. Value Constraints
  1954. :font facename=default size=0x0.
  1955. .br
  1956. .br
  1957. LCLint can be used to constrain values of parameters, function results, global
  1958. variables, and derived storage such as structure fields&per.  These constraints are
  1959. checked at :hp1.interface points:ehp1. -- where a function is called or returns&per.
  1960. :link reftype=hd res=10.Section 7&per.1:elink. describes how to constrain parameters, return values and structures
  1961. to detect use before definition errors&per.  A similar approach is used for
  1962. restricting the use of possibly null pointers in Section 7&per.2&per.  To do both well, and avoid spurious errors, information about when and if a function returns if
  1963. useful&per.  Annotations for documenting execution control are described in
  1964. :link reftype=hd res=10.Section 7&per.3:elink.&per.
  1965. :p.
  1966. :p.
  1967.  
  1968. .br
  1969. :font facename='Helv' size=20x12.
  1970. .br
  1971.  
  1972. 7&per.1 Use Before Definition
  1973. :font facename=default size=0x0.
  1974. .br
  1975. .br
  1976. Like many static checkers, LCLint detects instances where the value of a
  1977. location is used before it is defined&per.  This analysis is done at the procedural
  1978. level&per.  If there is a path through the procedure that  
  1979. :p.
  1980. uses a local variable before it is defined, a use before definition error is
  1981. reported&per.  Use before definition checking is controlled by the :link reftype=hd res=18.:font facename='System VIO' size=14x8.usedef:font facename=default size=0x0.:elink. flag&per.
  1982. :p.
  1983. :p.
  1984. LCLint can do more checking than standard checkers though, because the
  1985. annotations can be used to describe what storage must be defined and what
  1986. storage may be undefined at interface points&per. Unannotated references are
  1987. expected to be completely defined at interface points&per.  This means all storage
  1988. reachable from a global variable, parameter to a function, or function return
  1989. value is defined before and after a function call&per.
  1990.  
  1991. .br
  1992. :font facename='Tms Rmn' size=18x10.
  1993. .br
  1994.  
  1995. 7&per.1&per.1 Undefined Parameters
  1996. :font facename=default size=0x0.
  1997. .br
  1998. .br
  1999. Sometimes, function parameters or return values are expected to reference
  2000. undefined or partially defined storage&per.  For example, a pointer parameter may
  2001. be intended only as an address to store a result, or a memory allocator may
  2002. return allocated but undefined storage&per.  The :font facename='System VIO' size=14x8.out:font facename=default size=0x0. annotation denotes a pointer
  2003. to storage that may be undefined&per.
  2004. :p.
  2005. :p.
  2006. LCLint does not report an error when a pointer to allocated but undefined
  2007. storage is passed as an :font facename='System VIO' size=14x8.out:font facename=default size=0x0. parameter&per.  Within the body of a function, LCLint
  2008. will assume an :font facename='System VIO' size=14x8.out:font facename=default size=0x0. parameter is allocated but not necessarily bound to a value,
  2009. so an error is reported if its value is used before it is defined&per.  
  2010. :p.
  2011. :p.
  2012. LCLint reports an error if storage reachable by the caller after the call is
  2013. not defined when the function returns&per.  This can be suppressed by :link reftype=hd res=18.:font facename='System VIO' size=14x8.-mustdefine:font facename=default size=0x0.:elink.&per.
  2014. When checking a call, an actual parameter corresponding to an :font facename='System VIO' size=14x8.out:font facename=default size=0x0. parameter is
  2015. assumed to be completely defined after the call returns&per.
  2016. :p.
  2017. :p.
  2018. When checking unannotated programs, many spurious use before definition errors
  2019. may be reported   If :link reftype=hd res=18.:font facename='System VIO' size=14x8.impouts:font facename=default size=0x0.:elink. is on, no error is reported when an
  2020. incompletely-defined parameter is passed to a formal parameter with no
  2021. definition annotation, and the actual parameter is assumed to be defined after
  2022. the call&per.  The :font facename='System VIO' size=14x8./*@in@*/:font facename=default size=0x0. annotation can be used to denote a parameter that must
  2023. be completely defined, even if impouts is on&per.  If impouts is off, there is an
  2024. implicit in annotation on every parameter with no definition annotation&per.
  2025.  
  2026.  
  2027. :p.
  2028. :link reftype=hd res=55.Figure 13&per.  Use before definition&per.:elink.
  2029.  
  2030.  
  2031. .br
  2032. :font facename='Tms Rmn' size=18x10.
  2033. .br
  2034.  
  2035. 7&per.1&per.2 Relaxing Checking
  2036. :font facename=default size=0x0.
  2037. .br
  2038. .br
  2039. The reldef annotation relaxes definition checking for a particular declaration&per.
  2040. Storage declared with a reldef annotation is assumed to be defined when it is
  2041. used, but no error is reported if it is not defined before it is returned or
  2042. passed as a parameter&per.
  2043. :p.
  2044. :p.
  2045. It is up to the programmer to check reldef fields are used correctly&per.   They
  2046. should be avoided in most cases, but may be useful for fields of structures
  2047. that may or may not be defined depending on other constraints&per.  
  2048.  
  2049. .br
  2050. :font facename='Tms Rmn' size=18x10.
  2051. .br
  2052.  
  2053. 7&per.1&per.3 Partially Defined Structures
  2054. :font facename=default size=0x0.
  2055. .br
  2056. .br
  2057. The partial annotated can be used to relax checking of structure fields&per.  A
  2058. structure with undefined fields may be passed as a partial parameter or
  2059. returned as a partial result&per.  Inside a function body, no error is reported
  2060. when the field of a partial structure is used&per.  After a call, all fields of a
  2061. structure that is passed as a partial parameter are assumed to be completely
  2062. defined&per.
  2063. :p.
  2064.  
  2065.  
  2066.  
  2067. .br
  2068. :font facename='Tms Rmn' size=18x10.
  2069. .br
  2070.  
  2071. 7&per.1&per.4 Global Variables
  2072. :font facename=default size=0x0.
  2073. .br
  2074. .br
  2075. Special annotations can be used in the globals list of a function declaration
  2076. (:link reftype=hd res=7.Section 4&per.2:elink.) to describe the states of global variables before and after the
  2077. call&per.
  2078. :p.
  2079. :p.
  2080. If a global is preceded by undef, it is assumed to be undefined before the
  2081. call&per. Thus, no error is reported if the global is not defined when the function
  2082. is called, but an error is reported if the global is used in the function body
  2083. before it is defined&per.
  2084. :p.
  2085. :p.
  2086. The killed annotation denotes a global variable that may be undefined when the
  2087. call returns&per.  For globals that contain dynamically allocated storage, a killed
  2088. global variable is similar to an only parameter (:link reftype=hd res=8.Section 5&per.2:elink.)&per.  An error is
  2089. reported if it contains the only reference to storage that is not released
  2090. before the call returns&per.
  2091. :p.
  2092. :p.
  2093. :link reftype=hd res=56.Figure 14&per.  Annotated globals lists&per.:elink.
  2094. :p.
  2095.  
  2096. .br
  2097. :font facename='Helv' size=20x12.
  2098. .br
  2099.  
  2100. 7&per.2 Null Pointers
  2101. :font facename=default size=0x0.
  2102. .br
  2103. .br
  2104. A common cause of program failures is when a null pointer is dereferenced&per.
  2105. LCLint detects these errors by distinguishing possibly NULL pointers at
  2106. interface boundaries&per.
  2107. :p.
  2108. :p.
  2109. The null annotation is used to indicate that a pointer value may be NULL&per.  A
  2110. pointer declared with no null annotation, may not be NULL&per.  If null checking is
  2111. turned on (controlled by null), LCLint will report an error when a possibly
  2112. null pointer is passed as a parameter, returned as a result, or assigned to an
  2113. external reference with no null qualifier&per.
  2114. :p.
  2115. :p.
  2116. If a pointer is declared with the null annotation, the code must check that it
  2117. is not NULL on all paths leading to the a dereference of the pointer (or the
  2118. pointer being returned or passed as a value with no null annotation)&per.
  2119. Dereferences of possibly null pointers may be protected by conditional
  2120. statements or assertions (to see how assert is declared see :link reftype=hd res=10.Section 7&per.3:elink.) that
  2121. check the pointer is not NULL&per.
  2122. :p.
  2123. :p.
  2124. Consider two implementations of firstChar in :link reftype=hd res=57.Figure 15:elink.&per. For firstChar1, LCLint
  2125. reports an error since the pointer that is dereferenced is declared with a null
  2126. annotation&per.  For firstChar2, no error is reported since the true branch of the
  2127. s == NULL if statement returns, so the dereference of s is only reached if s is
  2128. not NULL&per.
  2129. :p.
  2130. .br
  2131. :font facename='Tms Rmn' size=18x10.
  2132. .br
  2133.  
  2134. 7&per.2&per.1 Predicate Functions
  2135. :font facename=default size=0x0.
  2136. .br
  2137. .br
  2138. Another way to protect null dereference, is to declare a function using
  2139. falsenull or truenull and call the function in a conditional statement before
  2140. the null-annotated pointer is dereferenced&per.  The falsenull and truenull
  2141. annotations may only be used on return values for functions that return a
  2142. boolean:link reftype=hd res=5.[19]:elink. result and whose first argument is
  2143. a possibly null pointer&per.
  2144. :p.
  2145. :p.
  2146. A function is annotated with :font facename='System VIO' size=14x8.truenull:font facename=default size=0x0. is assumed to return TRUE if its first
  2147. parameter is NULL and FALSE otherwise&per. For example, if isNull is declared as,
  2148. :cgraphic.
  2149.    /*@truenull@*/ bool isNull (/*@null@*/ char *x);
  2150. :ecgraphic.
  2151. we could write firstChar2&colon.
  2152. :cgraphic.
  2153.    char firstChar2 (/*@null@*/ char *s)
  2154.    {
  2155.       if (isNull (s)) return '\0';
  2156.       return *s;
  2157.    }
  2158. :ecgraphic.
  2159. No error is reported since the dereference of s is only reached if isNull(s) is
  2160. false, and since isNull is declared with the truenull annotation this means s
  2161. must not be null&per.
  2162. :p.
  2163. :p.
  2164. The :font facename='System VIO' size=14x8.falsenull:font facename=default size=0x0. annotation is not quite the opposite of truenull&per.  If a function
  2165. declared with falsenull returns TRUE, it means its parameter is not NULL&per.  If
  2166. it returns FALSE, the parameter may or may not be NULL&per.
  2167. :p.
  2168. :p.
  2169. For example, we could define isNonEmpty to return TRUE if its parameter is not
  2170. NULL and has least one character before the NUL terminator&colon.
  2171. :cgraphic.
  2172.    /*@falsenull@*/ bool isNonEmpty (/*@null@*/ char *x)
  2173.    {
  2174.      return (x != NULL &.&. *x != `\0');
  2175.    }
  2176. :ecgraphic.
  2177. LCLint does not check that the implementation of a function declared with
  2178. falsenull or truenull is consistent with its annotation, but assumes the
  2179. annotation is correct when code that calls the function is checked&per.
  2180.  
  2181. .br
  2182. :font facename='Tms Rmn' size=18x10.
  2183. .br
  2184.  
  2185. 7&per.2&per.2 Overriding Null Types
  2186. :font facename=default size=0x0.
  2187. .br
  2188. .br
  2189. The null annotation may be used in a type definition to indicate that all
  2190. instances of the type may be NULL&per.  For declarations of a type declared using
  2191. null, the null annotation in the type definition may be overridden with
  2192. notnull&per. This is particularly useful for parameters to hidden static operations
  2193. of abstract types where the null test has already been done before the function
  2194. is called, or function results of the type which are never NULL&per.  For an
  2195. abstract type, notnull may not be used for parameters to external functions,
  2196. since clients should not be aware of when the concrete representation may by
  2197. NULL&per.  Parameters to static functions in the implementation module, however,
  2198. may be declared using notnull, since they may only be called from places where
  2199. the representation is accessible&per.  Return values for static or external
  2200. functions may be declared using notnull&per. 
  2201. :p.
  2202. :p.
  2203. :link reftype=hd res=58.Figure 16&per.  Using notnull&per.:elink.
  2204. :p.
  2205.  
  2206. .br
  2207. :font facename='Tms Rmn' size=18x10.
  2208. .br
  2209.  
  2210. 7&per.2&per.3 Relaxing Null Checking
  2211. :font facename=default size=0x0.
  2212. .br
  2213. .br
  2214. An additional annotation, relnull may be used to relax null checking (relnull
  2215. is analogous to reldef for definition checking)&per.  No error is reported when a
  2216. relnull value is dereferenced, or when a possibly null value is assigned to an
  2217. identifier declared using relnull&per. 
  2218. :p.
  2219. :p.
  2220. This is generally used for structure fields that may or may not be null
  2221. depending on some other constraint&per.  LCLint does not report and error when NULL
  2222. is assigned to a relnull reference, or when a relnull reference is
  2223. dereferenced&per.  It is up to the programmer to ensure that this constraint is
  2224. satisfied before the pointer is dereferenced&per.
  2225.  
  2226. .br
  2227. :font facename='Helv' size=20x12.
  2228. .br
  2229.  
  2230. 7&per.3 Execution
  2231. :font facename=default size=0x0.
  2232. .br
  2233. .br
  2234. To detect certain errors and avoid spurious errors, it is important to know
  2235. something about the control flow behavior of called functions&per. Without
  2236. additional information, LCLint assumes that all functions eventually return and
  2237. execution continues normally at the call site&per.  
  2238. :p.
  2239. :p.
  2240. The exits annotation is used to denote a function that never returns&per.  For
  2241. example,
  2242. :cgraphic.
  2243. extern /*@exits@*/ void fatalerror (/*@observer@*/ char *s);
  2244. :ecgraphic.
  2245. declares fatalerror to never return&per.  This allows LCLint to correctly analyze
  2246. code like,
  2247. :cgraphic.
  2248.    if (x == NULL) fatalerror ("Yikes!");
  2249.    *x = 3;
  2250. :ecgraphic.
  2251. Other functions may exit, but sometimes (or usually) return normally&per.  The
  2252. mayexit annotation denotes a function that may or may not return&per.  This doesn't
  2253. help checking much, since LCLint must assume that a function declared with
  2254. mayexit returns normally when checking the code&per.
  2255. :p.
  2256. :p.
  2257. To be more precise, the trueexit and falseexit annotations may be used
  2258. Similar to truenull and falsenull (see :link reftype=hd res=10.Section 7&per.2&per.1:elink.), trueexit and falseexit
  2259. mean that a function always exits if the value of its first argument is TRUE or
  2260. FALSE respectively&per.  They may be used only on functions whose first argument
  2261. has a boolean type&per.  
  2262. :p.
  2263. :p.
  2264. A function declared with trueexit must exit if the value of its argument is
  2265. TRUE, and a function declared with falseexit must exit if the value of its
  2266. argument is FALSE&per.  For example, the standard library declares assert as[20]&colon.
  2267. :p.
  2268. :cgraphic.
  2269. /*@falseexit@*/ void assert (/*@sef@*/ bool /*@alt int@*/ pred);
  2270. :ecgraphic.
  2271. This way, code like,
  2272. :cgraphic.
  2273.    assert (x != NULL);
  2274. :p.
  2275.    *x = 3;
  2276. :ecgraphic.
  2277. is checked correctly, since the falseexit annotation on assert means the
  2278. deference of x is not reached is x != NULL is false&per.
  2279.  
  2280. .br
  2281. :font facename='Helv' size=20x12.
  2282. .br
  2283. 7&per.4 Special Clauses
  2284. :font facename=default size=0x0.
  2285. .br
  2286. .br
  2287.  
  2288. Sometimes it is necessary to specify function interfaces at a lower
  2289. level than is possible with the standard annotations&per.  For example, if a
  2290. function defines some fields of a returned structure but does not define
  2291. all the fields&per.  The :font facename='System VIO' size=14x8./*@special@*/:font facename=default size=0x0. annotation is used to mark a
  2292. parameter, global variable, or return value that is described using
  2293. special clauses&per.  The usual implicit definition rules do not apply to a
  2294. special declaration&per.
  2295. :p.
  2296. Special clauses may be used to constrain the state of a parameter or
  2297. return value before or after a call&per.  One or more special clauses may
  2298. appear in a function declaration, before the modifies or globals
  2299. clauses&per.  Special clauses may be listed in any order, but the same
  2300. special clause should not be used more than once&per.  Parameters used in
  2301. special clauses must be annotated with :font facename='System VIO' size=14x8./*@special@*/:font facename=default size=0x0. in the function
  2302. header&per.  In a special clause list, result is used to refer to the return
  2303. value of the function&per.  If result appears in a special clause, the
  2304. function return value must be annotated with :font facename='System VIO' size=14x8./*@special@*/:font facename=default size=0x0.&per.
  2305. :p.
  2306. The following special clauses are used to describe the definition state
  2307. or parameters before and after the function is called and the return
  2308. value after the function returns&colon.
  2309. :p.
  2310.  
  2311. :font facename='System VIO' size=14x8./*@uses :font facename=default size=0x0.:hp3.references:ehp3.:font facename='System VIO' size=14x8.@*/:font facename=default size=0x0. 
  2312. :p.
  2313. References in the uses clause must be completely defined before the
  2314. function is called&per.  They are assumed to be defined at function entrance
  2315. when the function is checked&per.
  2316.  
  2317.  
  2318. :font facename='System VIO' size=14x8./*@sets :font facename=default size=0x0.:hp3.references:ehp3.:font facename='System VIO' size=14x8.@*/:font facename=default size=0x0.
  2319. :p.
  2320. References in the sets clause must be allocated before the function is
  2321. called&per.  They are completely defined after the function returns&per. When
  2322. the function is checked, they are assumed to be allocated at function
  2323. entrance and an error is reported if there is a path on which they are
  2324. not defined before the function returns&per.
  2325.  
  2326.  
  2327. :font facename='System VIO' size=14x8./*@defines :font facename=default size=0x0.:hp3.references:ehp3.:font facename='System VIO' size=14x8.@*/:font facename=default size=0x0.
  2328. :p.
  2329. References in the defines clause must not refer to unshared, allocated
  2330. storage before the function is called&per.  They are completely defined
  2331. after the function returns&per. When the function is checked, they are
  2332. assumed to be undefined at function entrance and an error is reported if
  2333. there is a path on which they are not defined before the function
  2334. returns&per.
  2335.  
  2336.  
  2337. :font facename='System VIO' size=14x8./*@allocates :font facename=default size=0x0.:hp3.references:ehp3.:font facename='System VIO' size=14x8.@*/:font facename=default size=0x0.
  2338. :p.
  2339. References in the allocates clause must not refer to unshared, allocated
  2340. storage before the function is called&per.  They are allocated but not
  2341. necessarily defined after the function returns&per. When the function is
  2342. checked, they are assumed to be undefined at function entrance and an
  2343. error is reported if there is a path on which they are not allocated
  2344. before the function returns&per.
  2345.  
  2346.  
  2347. :font facename='System VIO' size=14x8./*@releases :font facename=default size=0x0.:hp3.references:ehp3.:font facename='System VIO' size=14x8.@*/:font facename=default size=0x0.
  2348. :p.
  2349. References in the releases clause are deallocated by the function&per.  They
  2350. must correspond to storage which could be passed as an only parameter
  2351. before the function is called, and are dead pointers after the function
  2352. returns&per.  When the function is checked, they are assumed to be allocated
  2353. at function entrance and an error is reported if they refer to live,
  2354. allocated storage at any return point&per.
  2355.  
  2356. :p.
  2357.  
  2358. Additional generic special clauses can be used to describe other aspects
  2359. of the state of inner storage before or after a call&per.  Generic special
  2360. clauses have the form :hp3.state:ehp3.:font facename='System VIO' size=14x8.&colon.:font facename=default size=0x0.:hp3.constraint:ehp3.&per.  The
  2361. state is either :font facename='System VIO' size=14x8.pre:font facename=default size=0x0. (before the function is called), or
  2362. :font facename='System VIO' size=14x8.post:font facename=default size=0x0. (after the function is called)&per.  The constraint is similar
  2363. to an annotation&per.  The following constraints are supported&colon.
  2364.  
  2365. :p.
  2366. .br
  2367. :font facename='Tms Rmn' size=16x8.
  2368. .br
  2369. Aliasing Annotations:font facename=default size=0x0.
  2370. .br
  2371. .br
  2372.  
  2373. :font facename='System VIO' size=14x8.pre&colon.only:font facename=default size=0x0., :font facename='System VIO' size=14x8.post&colon.only:font facename=default size=0x0.
  2374. .br
  2375. :font facename='System VIO' size=14x8.pre&colon.shared:font facename=default size=0x0., :font facename='System VIO' size=14x8.post&colon.shared:font facename=default size=0x0.
  2376. .br
  2377. :font facename='System VIO' size=14x8.pre&colon.owned:font facename=default size=0x0., :font facename='System VIO' size=14x8.post&colon.owned:font facename=default size=0x0.
  2378. .br
  2379. :font facename='System VIO' size=14x8.pre&colon.dependent:font facename=default size=0x0., :font facename='System VIO' size=14x8.post&colon.dependent:font facename=default size=0x0.
  2380. .br
  2381. :p.
  2382. References refer to :font facename='System VIO' size=14x8.only:font facename=default size=0x0., :font facename='System VIO' size=14x8.shared:font facename=default size=0x0., :font facename='System VIO' size=14x8.owned:font facename=default size=0x0. or
  2383. :font facename='System VIO' size=14x8.dependent:font facename=default size=0x0. storage before (:font facename='System VIO' size=14x8.pre:font facename=default size=0x0.) or after
  2384. (:font facename='System VIO' size=14x8.post:font facename=default size=0x0.) the call&per.
  2385.  
  2386.  
  2387. .br
  2388. :font facename='Tms Rmn' size=16x8.
  2389. .br
  2390. Exposure Annotations:font facename=default size=0x0.
  2391. .br
  2392. .br
  2393.  
  2394. :font facename='System VIO' size=14x8.pre&colon.observer:font facename=default size=0x0., :font facename='System VIO' size=14x8.post&colon.observer:font facename=default size=0x0.
  2395. .br
  2396. :font facename='System VIO' size=14x8.pre&colon.exposed:font facename=default size=0x0., :font facename='System VIO' size=14x8.post&colon.exposed:font facename=default size=0x0.
  2397. .br
  2398. :p.
  2399.  
  2400. References refer to :font facename='System VIO' size=14x8.observer:font facename=default size=0x0. or :font facename='System VIO' size=14x8.exposed:font facename=default size=0x0. storage before
  2401. (:font facename='System VIO' size=14x8.pre:font facename=default size=0x0.) or after (:font facename='System VIO' size=14x8.post:font facename=default size=0x0.) the call&per.
  2402.  
  2403.  
  2404.  
  2405. .br
  2406. :font facename='Tms Rmn' size=16x8.
  2407. .br
  2408. Null State Annotations:font facename=default size=0x0.
  2409. .br
  2410. .br
  2411.  
  2412. :font facename='System VIO' size=14x8.pre&colon.isnull:font facename=default size=0x0., :font facename='System VIO' size=14x8.post&colon.isnull:font facename=default size=0x0.
  2413. :p.
  2414. References have the value :font facename='System VIO' size=14x8.NULL:font facename=default size=0x0. before (:font facename='System VIO' size=14x8.pre:font facename=default size=0x0.) or after
  2415. (:font facename='System VIO' size=14x8.post:font facename=default size=0x0.) the call&per. Note, this is not the same name or meaning as
  2416. the null annotation (which means the value may be :font facename='System VIO' size=14x8.NULL:font facename=default size=0x0.&per.)  
  2417.  
  2418. :font facename='System VIO' size=14x8.pre&colon.notnull:font facename=default size=0x0., :font facename='System VIO' size=14x8.post&colon.notnull:font facename=default size=0x0.
  2419. :p.
  2420. References do not have the value :font facename='System VIO' size=14x8.NULL:font facename=default size=0x0. before (:font facename='System VIO' size=14x8.pre:font facename=default size=0x0.) or
  2421. after (:font facename='System VIO' size=14x8.post:font facename=default size=0x0.) the call&per. 
  2422.  
  2423.  
  2424.  
  2425. Some examples of special clauses are shown in Figure 17&per. The defines clause for
  2426. :font facename='System VIO' size=14x8.record_new:font facename=default size=0x0. indicates that the :font facename='System VIO' size=14x8.id:font facename=default size=0x0. field of the
  2427. structure pointed to by the result is defined, but the :font facename='System VIO' size=14x8.name:font facename=default size=0x0.
  2428. field is not&per.  So, :font facename='System VIO' size=14x8.record_create:font facename=default size=0x0. needs to call
  2429. :font facename='System VIO' size=14x8.record_setName:font facename=default size=0x0. to define the :font facename='System VIO' size=14x8.name:font facename=default size=0x0. field&per.  Similarly,
  2430. the releases clause for :font facename='System VIO' size=14x8.record_clearName:font facename=default size=0x0. indicates that no
  2431. storage is associated with the :font facename='System VIO' size=14x8.name:font facename=default size=0x0. field of its parameter
  2432. after the return, so no failure to deallocate storage message is
  2433. produced for the call to :font facename='System VIO' size=14x8.free:font facename=default size=0x0. in :font facename='System VIO' size=14x8.record_free:font facename=default size=0x0.&per.
  2434.  
  2435.  
  2436. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  2437. .br
  2438. :link reftype=hd res=11.
  2439. :elink.:artwork name='right-arrow.bmp' align=left.:artlink.:link reftype=hd res=11.:eartlink.:link reftype=hd res=11.:elink.
  2440. :link reftype=hd res=1.
  2441. :elink.:artwork name='up-arrow.bmp' align=left.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  2442. :link reftype=hd res=27.
  2443. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  2444.  
  2445. :link reftype=hd res=2.David Evans:elink. 
  2446. .br
  2447. :link reftype=hd res=3.Systematic Program Development:elink.
  2448. .br
  2449. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  2450.  
  2451.  
  2452. .* Source filename: sec8.html
  2453. :h2 res=11.LCLint User's Guide - 8&per. Macros
  2454. :font facename=default size=0x0.
  2455. :p.
  2456.  
  2457. .br
  2458. :font facename='Helv' size=32x20.
  2459. .br
  2460.  
  2461. 8&per. Macros
  2462. :font facename=default size=0x0.
  2463. .br
  2464. .br
  2465. Macros are commonly used in C programs to implement constants or to mimic
  2466. functions without the overhead of a function call&per.  Macros that are used to
  2467. implement functions are a persistent source of bugs in C programs, since they
  2468. may not behave like the intended function when they are invoked with certain
  2469. parameters or used in certain syntactic contexts&per.  
  2470. :p.
  2471. :p.
  2472. LCLint eliminates most of the potential problems by detecting macros with
  2473. dangerous implementations and dangerous macro invocations&per.  Whether or not a
  2474. macro definition is checked or expanded normally depends on flag settings and
  2475. control comments (see :link reftype=hd res=11.Section 8&per.3:elink.)&per.  Stylized macros can also be used to define
  2476. control structures for iterating through many values (see :link reftype=hd res=11.Section 8&per.4:elink.)&per.
  2477.  
  2478. .br
  2479. :font facename='Helv' size=20x12.
  2480. .br
  2481.  
  2482. 8&per.1 Constant Macros
  2483. :font facename=default size=0x0.
  2484. .br
  2485. .br
  2486. Macros may be used to implement constants&per.  To get type-checking for constant
  2487. macros, use the  constant syntactic comment&colon.
  2488. :cgraphic.
  2489. /*@constant null char *mstring_undefined@*/
  2490. :ecgraphic.
  2491. Declared constants are not expanded and are checked according to the
  2492. declaration&per.  A constant with a null annotation may be used as only storage&per.
  2493.  
  2494. .br
  2495. :font facename='Helv' size=20x12.
  2496. .br
  2497.  
  2498. 8&per.2 Function-like Macros
  2499. :font facename=default size=0x0.
  2500. .br
  2501. .br
  2502. Using macros to imitate functions is notoriously dangerous&per.  Consider this
  2503. broken macro for squaring a number&colon.
  2504. :p.
  2505. :cgraphic.
  2506. # define square(x) x * x
  2507. :ecgraphic.
  2508. This works fine for a simple invocation like square(i)&per.  It behaves
  2509. unexpectedly, though, if it is invoked with a parameter that has a side
  2510. effect&per.
  2511. :p.
  2512. :p.
  2513. For example, :font facename='System VIO' size=14x8.square(i++):font facename=default size=0x0. expands to :font facename='System VIO' size=14x8.i++ * i++:font facename=default size=0x0.&per.  Not
  2514. only does this give the incorrect result, it has undefined behavior
  2515. since the order in which the operands are evaluated is not defined&per.  (See :link reftype=hd res=13.Section 10&per.1:elink. for more information
  2516. on how expressions exhibiting undefined evaluation order behavior are detected
  2517. by LCLint&per.)  To correct the problem we either need to rewrite the macro so that
  2518. its parameter is evaluated exactly once, or prevent clients from invoking the
  2519. macro with a parameter that has a side-effect&per.  
  2520. :p.
  2521. :p.
  2522. Another possible problem with macros is that they may produce unexpected
  2523. results because of operator precedence rules&per.  The invocation, :font facename='System VIO' size=14x8.square(i+1):font facename=default size=0x0.
  2524. expands to :font facename='System VIO' size=14x8.i+1*i+1:font facename=default size=0x0., which evaluates to :font facename='System VIO' size=14x8.i+i+1:font facename=default size=0x0. instead
  2525. of the square of :font facename='System VIO' size=14x8.i+1:font facename=default size=0x0.&per.  To
  2526. ensure the expected behavior, the macro parameter should be enclosed in
  2527. parentheses where it is used in the macro body&per.
  2528. :p.
  2529. :p.
  2530. Macros may also behave unexpectedly if they are not syntactically equivalent to
  2531. an expression&per.  Consider the macro definition,
  2532. :cgraphic.
  2533. # define incCounts()  ntotal++; ncurrent++;
  2534. :ecgraphic.
  2535. This works fine, unless it is used as a statement&per.  For example,
  2536. :cgraphic.
  2537. if (x < 3) incCounts();
  2538. :ecgraphic.
  2539. increments ntotal if :font facename='System VIO' size=14x8.x < 3:font facename=default size=0x0. but always increments ncurrent&per.
  2540. :p.
  2541. :p.
  2542. One solution is to use the comma operator to define the macro&colon.
  2543. :cgraphic.
  2544. # define incCounts()  (ntotal++, ncurrent++)
  2545. :ecgraphic.
  2546. More complicated macros can be written using a do à while construction&colon.
  2547. :p.
  2548. :cgraphic.
  2549.   # define incCounts() \
  2550.      do { ntotal++; ncurrent++; } while (FALSE)
  2551. :ecgraphic.
  2552. LCLint detects these pitfalls in macro definitions, and checks that a macro
  2553. behaves as much like a function as possible&per.  A client should only be able to
  2554. tell that a function was implemented by a macro if it attempts to use the macro
  2555. as a pointer to a function&per.
  2556. :p.
  2557. :p.
  2558. These checks are done by LCLint on a macro definition corresponding to a
  2559. function&colon.
  2560. :p.
  2561. :ul compact.
  2562. :li.Each parameter to a macro (except those declared to be side-effect free,
  2563. see :link reftype=hd res=11.Section 8&per.2&per.1:elink.) must be used exactly once in all possible executions of the
  2564. macro, so  side-effecting arguments behave as expected&per.[21]  (Controlled by :link reftype=hd res=18.:font facename='System VIO' size=14x8.macroparams:font facename=default size=0x0.:elink.&per.)
  2565. :li.A parameter to a macro may not be used as the left hand side of an
  2566. assignment expression or as the operand of an increment or decrement operator
  2567. in the macro text, since this produces non-functional behavior&per.  (Controlled by
  2568. :link reftype=hd res=18.:font facename='System VIO' size=14x8.macroassign:font facename=default size=0x0.:elink.&per.)
  2569. :li.Macro parameters must be enclosed in parentheses when they are used in
  2570. potentially dangerous contexts&per.  (Controlled by :link reftype=hd res=18.:font facename='System VIO' size=14x8.macroparens:font facename=default size=0x0.:elink.&per.)
  2571. :li.A macro definition must be syntactically equivalent to a statement when
  2572. it is invoked followed by a semicolon&per. (Controlled by :link reftype=hd res=18.:font facename='System VIO' size=14x8.macrostmt:font facename=default size=0x0.:elink.&per.)
  2573. :li.The type of the macro body must match the return type of the
  2574. corresponding function&per.  If the macro is declared with type void, its body may
  2575. have any type but the macro value may not be used&per.
  2576. :li.All variables declared in the body of a macro definition must be in the
  2577. macro variable namespace, so they do not conflict with variables in the scope
  2578. where the macro is invoked (which may be used in the macro parameters)&per.  By
  2579. default, the macro namespace is all names prefixed by m_&per.  (See :link reftype=hd res=12.Section 9&per.2:elink. for
  2580. information on controlling namespaces&per.)
  2581. :eul.
  2582.        
  2583. At the call site, a macro is checked like any other function call&per.
  2584.  
  2585. .br
  2586. :font facename='Tms Rmn' size=18x10.
  2587. .br
  2588.  
  2589. 8&per.2&per.1 Side-Effect Free Parameters
  2590. :font facename=default size=0x0.
  2591. .br
  2592. .br
  2593. Suppose we really do want to implement square as a macro, but want do so in a
  2594. safe way&per.  One way to do this is to require that it is never invoked with a
  2595. parameter that has a side-effect&per.  LCLint will check that this constraint
  2596. holds, if the parameter is annotated to be :hp1.side-effect free:ehp1.&per.  That is,
  2597. the expression corresponding to this parameter must not modify any state, so it
  2598. does not matter how many times it is evaluated&per.  The sef annotation is used to
  2599. denote a parameter that may not have any side-effects&colon.
  2600. :cgraphic.
  2601.    extern int square (/*@sef@*/ int x);
  2602.    # define square(x) ((x) *(x))
  2603. :ecgraphic.
  2604. Now, LCLint will not report an error checking the definition of square even
  2605. though x is used more than once&per.
  2606. :p.
  2607. :p.
  2608. A message will be reported, however, if square is invoked with a parameter that
  2609. has a side-effect&per.
  2610. :p.
  2611. For the code fragment,
  2612. :cgraphic.
  2613. square (i++)
  2614. :ecgraphic.
  2615. LCLint produces the message&colon.
  2616. :cgraphic.
  2617.    Parameter 1 to square is declared sef, but the argument may modify i&colon. i++
  2618. :ecgraphic.
  2619. It is also an error to pass a non-sef macro parameter as a sef macro parameter
  2620. in the body of a macro definition&per.  For example,
  2621. :cgraphic.
  2622.    extern int sumsquares (int x, int y);
  2623.    # define sumsquares(x,y) (square(x) + square(y))
  2624. :ecgraphic.
  2625. Although x only appears once in the definition of sumsquares it will be
  2626. evaluated twice since square is expanded&per. LCLint reports an error when a
  2627. non-sef macro parameter is passed as a sef parameter&per.
  2628. :p.
  2629. :p.
  2630. A parameter may be passed as a sef parameter without an error being reported,
  2631. if LCLint can determine that evaluating the parameter has no side-effects&per.  For
  2632. function calls, the modifies clause is used to determine if a side-effect is
  2633. possible&per.:link reftype=hd res=5.[22]:elink.   To prevent many spurious
  2634. errors, if the called function has no modifies clause, LCLint will report an
  2635. error only if sefuncon is on&per.  Justifiably paranoid programmers will insist on
  2636. setting sefuncon on, and will add modifies clauses to unconstrained functions
  2637. that are used in sef macro arguments&per.
  2638.  
  2639. .br
  2640. :font facename='Tms Rmn' size=18x10.
  2641. .br
  2642.  
  2643. 8&per.2&per.2 Polymorphism
  2644. :font facename=default size=0x0.
  2645. .br
  2646. .br
  2647. One problem with our new definition of square is that while the original macro
  2648. would work for parameters of any numeric type, LCLint will now report an error
  2649. is the new version is used with a non-integer parameter&per.
  2650. :p.
  2651. :p.
  2652. We can use the :font facename='System VIO' size=14x8./*@alt :font facename=default size=0x0.:hp3.type:ehp3.:font facename='System VIO' size=14x8.;,:font facename=default size=0x0.+:font facename='System VIO' size=14x8.@>:font facename=default size=0x0.
  2653. syntax to indicate that an alternate type may be used&per.  For example,
  2654. :cgraphic.
  2655.   extern int /*@alt float@*/ square (/*@sef@*/ int /*@alt float@*/ x);
  2656.   # define square(x) ((x) *(x))
  2657. :ecgraphic.
  2658. declares square for both ints and floats&per. 
  2659. :p.
  2660. Alternate types are also useful for declaring functions for which the return
  2661. value may be safely ignored (see :link reftype=hd res=13.Section 10&per.3&per.2:elink.)&per.
  2662.  
  2663. .br
  2664. :font facename='Helv' size=20x12.
  2665. .br
  2666.  
  2667. 8&per.3 Controlling Macro Checking
  2668. :font facename=default size=0x0.
  2669. .br
  2670. .br
  2671. By default, LCLint expands macros normally and checks the resulting code after
  2672. macros have been expanded&per.  Flags and control comments may be used to control
  2673. which macros are expanded and which are checked as functions or constants&per.
  2674. :p.
  2675. :p.
  2676. If  the fcnmacros flag is on, LCLint assumes all macros defined with parameter
  2677. lists implement functions and checks them accordingly&per.  Parameterized macros
  2678. are not expanded and are checked as functions with unknown result and parameter
  2679. types (or using the types in the prototype, if one is given)&per.  The analogous
  2680. flag for macros that define constants is constmacros&per.  If it is on, macros with
  2681. no parameter lists are assumed to be constants, and checked accordingly&per.  The
  2682. allmacros flag sets both fcnmacros and constmacros&per.  If the macrofcndecl flag
  2683. is set, a message reports parameterized macros with no corresponding function
  2684. prototype&per.  If the macroconstdecl flag is set, a similar message reports macros
  2685. with no parameters with no corresponding constant declaration&per.
  2686. :p.
  2687. :p.
  2688. The macro checks described in the previous sections make sense only for macros
  2689. that are intended to replace functions or constants&per.  When fcnmacros or
  2690. constmacros is on, more general macros need to be marked so they will not be
  2691. checked as functions or constants, and will be expanded normally&per.  Macros which
  2692. are not meant to behave like functions should be preceded by the
  2693. :font facename='System VIO' size=14x8./*@notfunction@*/:font facename=default size=0x0. comment&per.  For example,
  2694. :cgraphic.
  2695.    /*@notfunction@*/
  2696.    # define forever for(;;)
  2697. :ecgraphic.
  2698. Macros preceded by notfunction are expanded normally before regular checking is
  2699. done&per.  If a macro that is not syntactically equivalent to a statement without a
  2700. semi-colon (e&per.g&per., a macro which enters a new scope) is not preceded by
  2701. notfunction, parse errors may result when fcnmacros or constmacros is on&per.
  2702.  
  2703. .br
  2704. :font facename='Helv' size=20x12.
  2705. .br
  2706.  
  2707. 8&per.4 Iterators
  2708. :font facename=default size=0x0.
  2709. .br
  2710. .br
  2711. It is often useful to be able to execute the same code for many different
  2712. values&per.  For example, we may want to sum all elements in an intSet that
  2713. represents a set of integers&per.  If intSet is an abstract type, there is no easy
  2714. way of doing this in a client module without depending on the concrete
  2715. representation of the type&per.  Instead, we could provide such a mechanism as part
  2716. of the type's implementation&per.  We call a mechanism for looping through many
  2717. values an :hp1.iterator:ehp1.&per.
  2718. :p.
  2719.  
  2720. :p.
  2721. The C language provides no mechanism for creating user-defined iterators&per.
  2722. LCLint supports a stylized form of iterators declared using syntactic comments
  2723. and defined using macros&per.
  2724. :p.
  2725. :p.
  2726. Iterator declarations are similar to function declarations except instead of
  2727. returning a value, they assign values to their yield parameters in each
  2728. iteration&per.  For example, we could add this iterator declaration to
  2729. :font facename='System VIO' size=14x8.intSet&per.h:font facename=default size=0x0.&colon.
  2730. :cgraphic.
  2731. /*@iter intSet_elements (intSet s, yield int el);@*/
  2732. :ecgraphic.
  2733. The yield annotation means that the variable passed as the second actual
  2734. argument is declared as a local variable of type int and assigned a value in
  2735. each loop iteration&per.
  2736. .br
  2737. :font facename='Tms Rmn' size=16x8.
  2738. .br
  2739. Defining
  2740. Iterators
  2741. :font facename=default size=0x0.
  2742. .br
  2743. .br
  2744. An iterator is defined using a macro&per.  Here's one (not particularly efficient)
  2745. way of defining intSet_elements&colon.
  2746. :cgraphic.
  2747.    typedef /*@abstract@*/ struct {
  2748.       int nelements;
  2749.       int *elements;
  2750.    } intSet;
  2751.    &per.&per.&per.
  2752.    # define intSet_elements(s,m_el) \
  2753.      { int m_i; \ 
  2754.        for (m_i = (0); m_i <= ((s)->nelements); m_i++) { \
  2755.            int m_el = (s)->elements[(m_i)];
  2756.  
  2757.    # define end_intSet_elements }}
  2758. :ecgraphic.
  2759. Each time through the loop, the yield parameter m_el is assigned to the next
  2760. value&per.  After all values have been assigned to m_el for one iteration, the loop
  2761. terminates&per.  Variables declared by the iterator macro (including the yield
  2762. parameter) are preceded by the macro variable namespace prefix m_ (see Section
  2763. 8&per.2) to avoid conflicts with variables defined in the scope where the iterator
  2764. is used&per.
  2765. .br
  2766. :font facename='Tms Rmn' size=16x8.
  2767. .br
  2768. Using
  2769. Iterators
  2770. :font facename=default size=0x0.
  2771. .br
  2772. .br
  2773. The general structure for using an iterator is,
  2774. :p.
  2775. :hp1.iter:ehp1. (:hp1.<params>:ehp1.) stmt; end_:hp1.iter:ehp1.
  2776. :p.
  2777. For example, a client could use intSet_elements to sum the elements of an
  2778. intSet&colon.
  2779. :cgraphic.
  2780.    intSet s;
  2781.    int sum = 0;
  2782.    &per.&per.&per.
  2783.    intSet_elements (s, el) { 
  2784.       sum += el; 
  2785.    } end_intSet_elements;
  2786. :ecgraphic.
  2787. The actual parameter corresponding to a yield parameter, el, is not declared in
  2788. the function scope&per.  Instead, it is declared by the iterator and assigned to an
  2789. appropriate value for each iteration&per.
  2790. :p.
  2791. :p.
  2792. LCLint will do the following checks for uses of stylized iterators&colon.
  2793. :p.
  2794. :ul compact.
  2795. :li.An invocation of the iterator :hp1.iter:ehp1. must be balanced by a
  2796. corresponding end, named end_:hp1.iter:ehp1.&per.
  2797. :li.All actual parameters must be defined, except those corresponding to
  2798. yield parameters&per.
  2799. :li.Yield parameters must be new identifiers, not declared in the current
  2800. scope or any enclosing scope&per.
  2801. :eul.
  2802.  
  2803. Iterators are a bit awkward to implement, but they enable compact, easily
  2804. understood client code&per.  For abstract collection types, an iterator can be used
  2805. to enable clients to operate on elements of the collection without breaking
  2806. data abstraction&per.
  2807.  
  2808.  
  2809. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  2810. .br
  2811. :link reftype=hd res=12.
  2812. :elink.
  2813. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=12.:eartlink.:link reftype=hd res=12.:elink.
  2814. :link reftype=hd res=1.
  2815. :elink.
  2816. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  2817. :link reftype=hd res=27.
  2818. :elink.
  2819. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  2820.  
  2821. :link reftype=hd res=2.David Evans:elink. 
  2822. .br
  2823. :link reftype=hd res=3.Systematic Program Development:elink.
  2824. .br
  2825. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  2826.  
  2827.  
  2828. .* Source filename: sec9.html
  2829. :h2 res=12.LCLint User's Guide - 9&per. Naming Conventions
  2830. :font facename=default size=0x0.
  2831. :p.
  2832.  
  2833. .br
  2834. :font facename='Helv' size=32x20.
  2835. .br
  2836.  
  2837. 9&per.  Naming Conventions
  2838. :font facename=default size=0x0.
  2839. .br
  2840. .br
  2841. Naming conventions tend to be a religious issue&per. Generally, it doesn't matter
  2842. too much what naming convention is followed as long as one is chosen and
  2843. followed religiously&per.  There are two kinds of naming conventions supported by
  2844. LCLint&per.  Type-based naming conventions (:link reftype=hd res=12.Section 9&per.1:elink.) constrain identifier names
  2845. according to the abstract types that are accessible where the identifier is
  2846. defined&per.  Prefix naming conventions (:link reftype=hd res=12.Section 9&per.2:elink.) constrain the initial
  2847. characters of identifier names according to what is being declared and its
  2848. scope&per.  Naming conventions may be combined or different conventions may be
  2849. selected for different kinds of identifiers&per.  In addition, LCLint supports
  2850. checking that names do not conflict with names reserved for the standard
  2851. library or implementation (:link reftype=hd res=12.Section 9&per.3:elink.) and that names are sufficiently
  2852. distinguishable from other names&per. 
  2853.  
  2854. .br
  2855. :font facename='Helv' size=20x12.
  2856. .br
  2857. 9&per.1 Type-Based Naming Conventions
  2858. :font facename=default size=0x0.
  2859. .br
  2860. .br
  2861. Generic naming conventions constrain valid names of identifiers&per.  By limiting
  2862. valid names, namespaces may be preserved and programs may be more easily
  2863. understood since the name gives clues as to how and where the name is defined
  2864. and how it should be used&per.
  2865. :p.
  2866. :p.
  2867. Names may be constrained by the scope of the name (external, file static,
  2868. internal), the file in which the identifier is defined, the type of the
  2869. identifier, and global constraints&per.
  2870. .br
  2871. :font facename='Tms Rmn' size=18x10.
  2872. .br
  2873. 9&per.1&per.1 Czech Names
  2874. :font facename=default size=0x0.
  2875. .br
  2876. .br
  2877. :p.
  2878. :hp3.Of course, this is a complete jumble to the uninitiated, and that's the joke&per.:ehp3.
  2879. .br
  2880. - Charles Simonyi, on the Hungarian naming convention
  2881.  
  2882. :p.
  2883. Czech:link reftype=hd res=5.[23]:elink. names denote operations and variables
  2884. of abstract types by preceding the names by :hp1.<type:ehp1.:hp1.>:ehp1._&per.  The
  2885. remainder of the name should begin with a lowercase character, but may use any
  2886. other character besides the underscore&per.  Types may be named using any
  2887. non-underscore characters&per.   
  2888. :p.
  2889. :p.
  2890. The Czech naming convention is selected by the czech flag&per.  If accessczech is
  2891. on, a function, variable, constant or iterator named
  2892. :hp1.<type>:ehp1._:hp1.<name:ehp1.:hp1.>:ehp1. has access to the abstract type
  2893. :hp1.<type>:ehp1.&per.
  2894. :p.
  2895. :p.
  2896. Reporting of violations of the Czech naming convention is controlled by
  2897. different flags depending on what is being declared&colon.
  2898. :p.
  2899. :font facename='System VIO' size=14x8.czechfcns:font facename=default size=0x0.
  2900. :p.
  2901. Functions and iterators&per.  An error is reported for a function name of the form
  2902. :hp1.<prefix>_<name>:ehp1. where :hp1.<prefix>:ehp1. is not the name
  2903. of an accessible type&per.  Note that if accessczech is on, a type named
  2904. :hp1.<prefix>:ehp1. would be accessible in a function beginning with
  2905. :hp1.<prefix>_:ehp1.&per.  If accessczech is off, an error is reported instead&per.
  2906. An error is reported for a function name that does not have an underscore if
  2907. any abstract types are accessible where the function is defined&per.
  2908.  
  2909. :font facename='System VIO' size=14x8.czechvars:font facename=default size=0x0.
  2910. .br
  2911. :font facename='System VIO' size=14x8.czechconstants:font facename=default size=0x0.
  2912. .br
  2913. :font facename='System VIO' size=14x8.czechmacros:font facename=default size=0x0.
  2914. .br
  2915. :p.
  2916. Variables, constants and expanded macros&per.  An error is reported if the
  2917. identifier name starts with :hp1.<prefix>:ehp1._ and :hp1.prefix:ehp1. is not the
  2918. name of an accessible abstract type, or if an abstract type is accessible and
  2919. the identifier name does not begin with :hp1.<type>_:ehp1. where type is the
  2920. name of an accessible abstract type&per.  If accessczech is on, the representation
  2921. of the type is visible in the constant or variable definition&per.
  2922.  
  2923. :font facename='System VIO' size=14x8.czechtypes:font facename=default size=0x0.
  2924. :p.
  2925. User-defined types&per.  An error is reported if a type name includes an underscore
  2926. character&per.
  2927.  
  2928. .br
  2929. :font facename='Tms Rmn' size=18x10.
  2930. .br
  2931. 9&per.1&per.2 Slovak Names
  2932. :font facename=default size=0x0.
  2933. .br
  2934. .br
  2935. Slovak names are similar to Czech names, except they are spelled differently&per.
  2936. A Slovak name is of the form :hp1.<type><Name>:ehp1.&per.  The type prefix
  2937. may not use uppercase characters&per.  The remainder of the name starts with the
  2938. first uppercase character&per.
  2939. :p.
  2940. :p.
  2941. The slovak flag selects the Slovak naming convention&per.  Like Czech names, it may
  2942. be used with accessslovak to control access to abstract representations&per. The
  2943. slovakfcns, slovakvars, slovakconstants, and slovakmacros flags are analogous
  2944. to the similar Czech flags&per.  If slovaktype is on, an error is reported if a
  2945. type name includes an uppercase letter&per.
  2946.  
  2947. .br
  2948. :font facename='Tms Rmn' size=18x10.
  2949. .br
  2950.  
  2951. 9&per.1&per.3 Czechoslovak Names
  2952. :font facename=default size=0x0.
  2953. .br
  2954. .br
  2955. Czechoslovak names are a combination of Czech names and Slovak names&per.
  2956. Operations may be named either :hp1.<type:ehp1.:hp1.>:ehp1._ followed by any
  2957. sequence of non-underscore characters, or :hp1.<type>:ehp1. followed by an
  2958. uppercase letter and any sequence of characters&per.  Czechoslovak names have been
  2959. out of favor since 1993, but may be necessary for checking legacy code&per. The
  2960. czechoslovakfcns, czechoslovakvars, czechoslovakmacros, and
  2961. czechoslovakconstants flags are analogous to the similar Czech flags&per.  If
  2962. czechoslovaktype is on, an error is reported if a type name contains either an
  2963. uppercase letter or an underscore character&per.
  2964.  
  2965. .br
  2966. :font facename='Helv' size=20x12.
  2967. .br
  2968.  
  2969. 9&per.2 Namespace Prefixes
  2970. :font facename=default size=0x0.
  2971. .br
  2972. .br
  2973. Another way to restrict names is to constrain the leading character sequences
  2974. of various kinds of identifiers&per.  For example, a the names of all user-defined
  2975. types might begin with "T" followed by an uppercase letter and all file static
  2976. names begin with an uppercase letter&per.  This may be useful for enforcing a
  2977. namespace (e&per.g&per., all names exported by the X-windows library should begin with
  2978. "X") or just making programs easier to understand by establishing an enforced
  2979. convention&per.  LCLint can be used to constrain identifiers in this way to detect
  2980. identifiers inconsistent with prefixes&per.
  2981. :p.
  2982. :p.
  2983. All namespace flags are of the form, -:hp1.<context>:ehp1.prefix
  2984. :hp1.<string>:ehp1.&per.  For example, the macro variable namespace restricting
  2985. identifiers declared in macro bodies to be preceded by "m_" would be selected
  2986. by -macrovarprefix "m_"&per.  The string may contain regular characters that may
  2987. appear in a C identifier&per.  These must match the initial characters of the
  2988. identifier name&per.  In addition, special characters (shown in Table 1) can be
  2989. used to denoted a class of characters&per.:link reftype=hd res=5.[24]:elink.  The
  2990. * character may be used at the end of a prefix string to specify the
  2991. rest of the identifier is zero or more characters matching the character
  2992. immediately before the *&per. For example, the prefix string "T&.*"
  2993. matches "T" or "TWINDOW" but not "Twin"&per.
  2994. :p.
  2995.  
  2996. :cgraphic.
  2997. ^    Any uppercase letter, A-Z                                                 
  2998. &.    Any lowercase letter, a-z                                                 
  2999. %    Any character that is not an uppercase letter (allows lowercase           
  3000.      letters, digits and underscore)                                           
  3001. ~    Any character that is not a lowercase letter (allows uppercase letters,   
  3002.      digits and underscore)                                                    
  3003. $    Any letter (a-z, A-Z)                                                     
  3004. /    Any letter or digit (A-Z, a-z, 0-9)                                       
  3005. ?    Any character valid in a C identifier                                     
  3006. #    Any digit, 0-9                                                            
  3007.  
  3008. :ecgraphic.
  3009. :hp2.Table
  3010. 1&per.  Prefix character codes&per.:ehp2.
  3011. :p.
  3012.  
  3013. Different prefixes can be selected for the following identifier
  3014. contexts&colon.
  3015. .br
  3016. :p. 
  3017. :font facename='System VIO' size=14x8.macrovarprefix:font facename=default size=0x0.
  3018. :p. Any variable declared inside a macro body 
  3019.  
  3020. :font facename='System VIO' size=14x8.uncheckedmacroprefix:font facename=default size=0x0.
  3021. :p. Any macro that is not checked as a function or constant
  3022. (see :link reftype=hd res=11.Section 8&per.4:elink.)                 
  3023.  
  3024. :font facename='System VIO' size=14x8.tagprefix:font facename=default size=0x0.
  3025. :p.Tags for struct, union and enum declarations  
  3026.  
  3027. :font facename='System VIO' size=14x8.enumprefix:font facename=default size=0x0.
  3028. :p.Members of enum types                         
  3029.  
  3030. :font facename='System VIO' size=14x8.typeprefix:font facename=default size=0x0.
  3031. :p.
  3032. Name of a user-defined type               
  3033.  
  3034. :font facename='System VIO' size=14x8.filestaticprefix:font facename=default size=0x0.
  3035. :p.Any identifier with file static scope
  3036.  
  3037. :font facename='System VIO' size=14x8.globvarprefix:font facename=default size=0x0.
  3038. :p.
  3039. Any variable (not of function type) with global variables scope 
  3040.       
  3041. :font facename='System VIO' size=14x8.externalprefix:font facename=default size=0x0.
  3042. :p.
  3043. Any exported identifier                       
  3044.  
  3045. :p.
  3046. If an identifier is in more than one of the namespace contexts, the most specific
  3047. defined namespace prefix is used (e&per.g&per., a global variable is also an exported
  3048. identifier, so if globalvarprefix is set, it is checked against the variable
  3049. name; if not, the identifier is checked against the externalprefix&per.)
  3050. :p.
  3051. :p.
  3052. For each prefix flag, a corresponding flag named
  3053. :hp1.<prefixname>:ehp1.exclude controls  whether errors are reported if
  3054. identifiers in a different namespace match the namespace prefix&per.  For example,
  3055. if macrovarprefixexclude is on, LCLint checks that no identifier that is not a
  3056. variable declared inside a macro body uses the macro variable prefix&per. 
  3057. :p.
  3058. :p.
  3059. Here is a (somewhat draconian) sample naming convention&colon.
  3060. :p.
  3061. :link reftype=hd res=18.:font facename='System VIO' size=14x8.-uncheckedmacroprefix "~*":font facename=default size=0x0.:elink.
  3062. .br
  3063.        unchecked macros have no lowercase letters 
  3064. .br
  3065.  :font facename='System VIO' size=14x8.-typeprefix
  3066. "T^&.*":font facename=default size=0x0.
  3067. .br
  3068.  all type typenames begin with T followed by an
  3069. uppercase letter&per.  The rest of the name is all lowercase letters&per.  
  3070. .br
  3071. :font facename='System VIO' size=14x8.+typeprefixexclude:font facename=default size=0x0.
  3072. .br
  3073. no identifier that does not name a user-defined type may begin with the
  3074. type name prefix (set above) 
  3075. .br
  3076.  :font facename='System VIO' size=14x8.-filestaticprefix"^&.&.&.":font facename=default size=0x0.
  3077. .br
  3078.  file static scope variables begin with an uppercase letter and
  3079. three lowercase letters
  3080. .br
  3081.  :font facename='System VIO' size=14x8.-globvarprefix "G":font facename=default size=0x0.
  3082. .br
  3083.  all global variables variables start with G 
  3084. .br
  3085.  :font facename='System VIO' size=14x8.+globvarprefixexclude:font facename=default size=0x0.
  3086. .br
  3087. no identifier that is not a global variable starts with G 
  3088. :p.  
  3089. .br
  3090. :font facename='Helv' size=20x12.
  3091. .br
  3092.   9&per.3
  3093. Naming Restrictions :font facename=default size=0x0.
  3094. .br
  3095. .br
  3096.  Additional naming
  3097. restrictions can be used to check that names do no conflict with names
  3098. reserved for the standard library, and that identifier are sufficiently
  3099. distinct (either for the compiler and linker, or for the programmer&per.)
  3100. Restrictions may be different for names that are needed by the linker
  3101. (:hp1.external:ehp1. names) and names that are only needed during
  3102. compilations (:hp1.internal:ehp1. names)&per.  Names of non-static functions and
  3103. global variables are external; all other names are internal&per.   
  3104. .br
  3105. :font facename='Tms Rmn' size=18x10.
  3106. .br
  3107.   9&per.3&per.1
  3108. Reserved Names :font facename=default size=0x0.
  3109. .br
  3110. .br
  3111.  Many names are reserved for the
  3112. implementation and standard library&per.  A complete list of reserved names
  3113. can
  3114. be
  3115. found in [:link reftype=hd res=25.vdL:elink., p&per. 126-128] or [:link reftype=hd res=1.ANSI:elink., Section 4]&per.  Some name prefixes such as str
  3116. followed by a lowercase character are reserved for future library
  3117. extensions&per.  Most C compilers do not detect naming conflicts, and they
  3118. can lead to unpredictable program behavior&per.  If ansireserved is on,
  3119. LCLint reports errors for external names that conflict with reserved
  3120. names&per.  If ansireservedinternal is on, errors are also reported for
  3121. internal names&per.   
  3122. .br
  3123. :font facename='Tms Rmn' size=18x10.
  3124. .br
  3125.   9&per.3&per.2 Distinct Identifiers :font facename=default size=0x0.
  3126. .br
  3127. .br
  3128. :p. :hp3.The decision to retain the old six-character
  3129. case-insensitive restriction on significance was most painful&per.:ehp3.
  3130. .br
  3131. - ANSI C Rationale 
  3132.  
  3133. :p. LCLint can check that identifiers
  3134. differ within a given number of characters, optionally ignoring
  3135. alphabetic case and differences between characters that look similar&per.
  3136. The number of significant characters may be different for external and
  3137. internal names&per.  
  3138. :p. 
  3139. :p. Using :font facename='System VIO' size=14x8.+distinctexternalnames:font facename=default size=0x0.
  3140. sets the number of significant characters for external names to six and
  3141. makes alphabetical case insignificant for external names&per.  This is the
  3142. minimum significance acceptable in an ANSI-conforming compiler&per.  Most
  3143. modern compilers exceed these minimums (which are particularly hard to
  3144. follow if one uses the Czech or Slovak naming convention)&per.  The number
  3145. of significant characters can be changed using the externalnamelength
  3146. :hp1.<number>:ehp1. flag&per.  If externalnamecaseinsensitive is on,
  3147. alphabetical case is ignored in comparing external names&per. LCLint reports
  3148. identifiers that differ only in alphabetic case&per. 
  3149. :p. 
  3150. :p. For internal
  3151. identifiers, a conforming compiler must recognize at least 31 characters
  3152. and treat alphabetical cases distinctly&per.  Nevertheless, it may still be
  3153. useful to check that internal names are more distinct then required by
  3154. the compiler to minimize the likelihood that identifiers are confused in
  3155. the program&per.  Analogously to external names, the internalnamelength
  3156. :hp1.<number>:ehp1. flag sets the number of significant characters in
  3157. an internal name and internalnamecaseinsensitive sets the case
  3158. sensitivity&per.  The internalnamelookalike flag further restricts
  3159. distinctions between identifiers&per.  When set, similar-looking characters
  3160. match -- the lowercase letter "l" matches the uppercase letter "I" and
  3161. the number "1"; the letter "O" or "o" matches the number "0"; "5"
  3162. matches "S"; and "2" matches "Z"&per.  Identifiers that are not distinct
  3163. except for look-alike characters will produce an error message&per.
  3164. External names are also internal names, so they must satisfy both the
  3165. external and internal distinct identifier checks&per.
  3166. :p. 
  3167. :p. Figure 18 illustrates some of the name checking
  3168. done by LCLint&per.
  3169. :p. 
  3170. :p. 
  3171.  
  3172. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  3173. .br
  3174. :link reftype=hd res=13.
  3175. :elink.
  3176. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=13.:eartlink.:link reftype=hd res=13.:elink.
  3177. :link reftype=hd res=1.
  3178. :elink.
  3179. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  3180. :link reftype=hd res=27.
  3181. :elink.
  3182. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  3183.  
  3184. :link reftype=hd res=2.David Evans:elink. 
  3185. .br
  3186. :link reftype=hd res=3.Systematic Program Development:elink.
  3187. .br
  3188. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  3189.  
  3190.  
  3191. .* Source filename: sec10.html
  3192. :h2 res=13.LCLint User's Guide - 10&per. Other Checks
  3193. :font facename=default size=0x0.
  3194. :p.
  3195.  
  3196.  
  3197. .br
  3198. :font facename='Helv' size=32x20.
  3199. .br
  3200.   10&per. Other Checks :font facename=default size=0x0.
  3201. .br
  3202. .br
  3203.  
  3204.  
  3205. The section describes other errors detected by LCLint that are not
  3206. directly related to extra information provided in annotations&per.  Many of
  3207. the checks are significantly improved, however, because of the extra
  3208. information that is known about the program&per.
  3209.  
  3210. .br
  3211. :font facename='Helv' size=20x12.
  3212. .br
  3213.  
  3214. 10&per.1 Undefined Evaluation Order
  3215. :font facename=default size=0x0.
  3216. .br
  3217. .br
  3218.  
  3219.  
  3220. The order in which side effects take place in a C program is
  3221. not entirely defined by the code&per.  Certain execution points are known as
  3222. :hp1.sequence points:ehp1. -- a function call (after the arguments have been
  3223. evaluated), the end of a full expression (an initializer, expression in
  3224. an expression statement, the control expression of an if, switch, while
  3225. or do statement, each expression of a for statement, and the expression
  3226. in a return statement), and after the first operand or a &.&., ||,
  3227. ? or , operand&per.
  3228. :p. 
  3229. :p. All side effects before a sequence point must be
  3230. complete before the sequence point, and no evaluations after the
  3231. sequence
  3232. point shall have taken place [:link reftype=hd res=25.ANSI:elink., Section 2&per.1&per.2&per.3]&per.  Between sequence
  3233. points, side effects and evaluations may take place in any order&per.
  3234. Hence, the order in which expressions or arguments are evaluated is not
  3235. specified&per.  Compilers are free to evaluate function arguments and parts
  3236. of expressions (that do not contain sequence points) in any order&per.  The
  3237. behavior of code that uses a value that is modified by another
  3238. expression that is not required to be evaluated before or after the
  3239. other use is undefined&per.
  3240. :p. 
  3241. :p. LCLint detects instances where
  3242. undetermined order of evaluation produces undefined behavior&per.  If
  3243. modifies clauses and globals lists are used, this checking is enabled in
  3244. expressions involving function calls&per. Evaluation order checking is
  3245. controlled by the evalorder flag&per.
  3246. :p. 
  3247. :p. When checking systems without
  3248. modifies and globals information, evaluation order checking may report
  3249. errors when unconstrained functions are called in procedure arguments&per.
  3250. Since LCLint has no annotations to constrain what these functions may
  3251. modify, it cannot be guaranteed that the evaluation order is defined if
  3252. another argument calls an unconstrained function or uses a global
  3253. variable or storage reachable from a parameter to the unconstrained
  3254. function&per.  Its best to add modifies and globals clauses to constrain the
  3255. unconstrained functions in ways that eliminate the possibility of
  3256. undefined behavior&per.  For large legacy systems, this may require too much
  3257. effort&per.  Instead, the :font facename='System VIO' size=14x8.-evalorderuncon:font facename=default size=0x0. flag
  3258. may be used to prevent reporting of undefined behavior due to the order
  3259. of evaluation of unconstrained functions&per. 
  3260. :p.
  3261. :p.
  3262. :link reftype=hd res=61.Figure 19&per.  Evaluation order:elink.
  3263. :p.
  3264.  
  3265. .br
  3266. :font facename='Helv' size=20x12.
  3267. .br
  3268. 10&per.2 Problematic Control Structures
  3269. :font facename=default size=0x0.
  3270. .br
  3271. .br
  3272.  
  3273. A number of control structures that are syntactically legal may indicate
  3274. likely bugs in programs&per.  LCLint can detect errors involving likely
  3275. infinite loops (:link reftype=hd res=13.Section 10&per.2&per.1:elink.),
  3276. fall through cases and missing cases in switch statements (Section 10&per.2&per.2), break statements
  3277. within deeply nested loops or switches (Section 10&per.2&per.3), clauses of if, while
  3278. or for statements that are empty statements or unblocked single
  3279. statements (:link reftype=hd res=13.Section 10&per.2&per.4:elink.) and
  3280. incomplete if-else logic (:link reftype=hd res=13.Section
  3281. 10&per.2&per.5:elink.)&per.  Although any of these may appear in a correct program,
  3282. depending on the programming style used they may indicate likely bugs or
  3283. style violations that should be detected and eliminated&per.
  3284.  
  3285. .br
  3286. :font facename='Tms Rmn' size=18x10.
  3287. .br
  3288. 10&per.2&per.1 Likely Infinite Loops
  3289.  
  3290. :font facename=default size=0x0.
  3291. .br
  3292. .br
  3293.  
  3294. LCLint reports an error if it detects a loop that appears to be
  3295. infinite&per.  An error is reported for a loop which does not modify any
  3296. value used in its condition test inside the body of the loop or in the
  3297. condition test itself&per.  This checking is enhanced by modifies clauses
  3298. and globals lists since they provide more information about what global
  3299. variable may be used in the condition test and what values may be
  3300. modified by function calls in the loop body&per.
  3301. :p. 
  3302. :p.
  3303.  
  3304. :link reftype=hd res=62.Figure 20:elink. shows examples of infinite loops
  3305. detected by LCLint&per. An error is reported for the loop in line 14, since
  3306. neither of the values used in the loop condition (x directly and glob1
  3307. through the call to f) is modified by the body of the loop&per.  If the
  3308. declaration of g is changed to include glob1 in the modifies clause no
  3309. error is reported&per.  (In this example, if we assume the annotations are
  3310. correct, then the programmer has probably called the wrong function in
  3311. the loop body&per.  This isn't surprising, given the horrible choices of
  3312. function and variable names!)
  3313. :p.
  3314.  
  3315. :p.
  3316. If an unconstrained function is called within the loop body, LCLint will assume
  3317. that it modifies a value used in the condition test and not report an infinite
  3318. loop error, unless infloopsuncon is on&per.  If infloopsuncon is on, LCLint will
  3319. report infinite loop errors for loops where there is no explicit modification
  3320. of a value used in the condition test, but where they may be an undetected
  3321. modification through a call to an unconstrained function (e&per.g&per., line 15 in
  3322. :link reftype=hd res=62.Figure 20:elink.)&per.  
  3323. :p.
  3324. .br
  3325. :font facename='Tms Rmn' size=18x10.
  3326. .br
  3327. 10&per.2&per.2 Switches
  3328. :font facename=default size=0x0.
  3329. .br
  3330. .br
  3331. The automatic fall-through of C switch statements is almost never the intended
  3332. behavior&per.:link reftype=hd res=5.[25]:elink.  LCLint detects case statements
  3333. with code that may fall through to the next case&per.  The casebreak flag controls
  3334. reporting of fall through cases&per.  A single fall through case may be marked by
  3335. preceding the case keyword with :font facename='System VIO' size=14x8./*@fallthrough@*/:font facename=default size=0x0. to indicate explicitly that
  3336. execution falls through to this case&per.
  3337. :p.
  3338. :p.
  3339. For switches on enum types, LCLint reports an error if a member of the
  3340. enumerator does not appear as a case in the switch body (and there is no
  3341. default case)&per.  (Controlled by :link reftype=hd res=18.:font facename='System VIO' size=14x8.misscase:font facename=default size=0x0.:elink.&per.)
  3342. :p.
  3343. :p.
  3344. An example of switch checking is shown in :link reftype=hd res=63.Figure 21:elink.&per.
  3345. .br
  3346. :font facename='Tms Rmn' size=18x10.
  3347. .br
  3348. 10&per.2&per.3 Deep Breaks
  3349. :font facename=default size=0x0.
  3350. .br
  3351. .br
  3352. There is no syntax provided by C (other than goto) for breaking out of a nested
  3353. loop&per.  All break and continue statements act only on the innermost surrounding
  3354. loop or switch&per.  This often leads to serious problems[26] when a programmer intends to break the outer loop
  3355. or switch instead&per.  LCLint optionally reports errors for break and
  3356. continue statements in nested contexts&per.
  3357. :p.
  3358. :ul compact.
  3359. :li.break inside a loop (while or for) that is inside a loop&per.  Controlled by
  3360. looploopbreak&per.  To indicate that a break is inside an inner loop, precede the
  3361. break by :font facename='System VIO' size=14x8./*@innerbreak@*/:font facename=default size=0x0.&per.
  3362. :li.break inside a loop that is inside a switch statement&per.  Controlled by
  3363. switchloopbreak&per.  To mark the break as a loop break, precede the break by
  3364. :font facename='System VIO' size=14x8./*@loopbreak@*/:font facename=default size=0x0.&per.
  3365. :li.break inside a switch statement that is inside a loop&per.  Controlled by
  3366. loopswitchbreak&per.  To mark the break as a switch break, precede the break by
  3367. :font facename='System VIO' size=14x8./*@switchbreak@*/:font facename=default size=0x0.&per.
  3368. :li.break inside a switch inside another switch&per.  Controlled by
  3369. switchswitchbreak&per.  To indicate that the break is for the inner switch, use
  3370. :font facename='System VIO' size=14x8./*@innerbreak@*/:font facename=default size=0x0.&per.
  3371. :eul.
  3372.  
  3373.  
  3374. Since continue only makes sense within loops, errors are only reported for
  3375. continue statements within nested loops&per.  (Controlled by :link reftype=hd res=18.:font facename='System VIO' size=14x8.looploopcontinue:font facename=default size=0x0.:elink.&per.)  A
  3376. safe inner continue may be precede by :font facename='System VIO' size=14x8./*@innercontinue@*/:font facename=default size=0x0. to suppress error
  3377. messages locally&per. The deepbreak flag sets all nested break and continue
  3378. checking flags&per.
  3379. :p.
  3380. :p.
  3381. LCLint reports an error if the marker preceding a break is not consistent with
  3382. its effect&per.  An error is reported if innerbreak precedes a break that is not
  3383. breaking an inner loop, switchbreak precedes a break that is not breaking a
  3384. switch, or loopbreak precedes a break that is not breaking a loop&per.
  3385. .br
  3386. :font facename='Tms Rmn' size=18x10.
  3387. .br
  3388. 10&per.2&per.4 Loop and If Bodies
  3389. :font facename=default size=0x0.
  3390. .br
  3391. .br
  3392. An empty statement after an if, while or for often indicates a potential bug&per.
  3393. A single statement (i&per.e&per., not a compound block) after an if, while or for is
  3394. not likely to indicate a bug, but make the code harder to read and edit&per.
  3395. LCLint can report errors for if or loop statements with empty bodies or bodies
  3396. that are not compound statements&per.  Separate flags control checking for
  3397. statements following an  if, while or for&colon.
  3398. :p.
  3399. :ul compact.
  3400. :li.[:font facename='System VIO' size=14x8.if:font facename=default size=0x0., :font facename='System VIO' size=14x8.while:font facename=default size=0x0., :font facename='System VIO' size=14x8.for:font facename=default size=0x0.]
  3401. :font facename='System VIO' size=14x8.empty:font facename=default size=0x0. --
  3402. report errors for empty bodies (e&per.g&per., :font facename='System VIO' size=14x8.if (x > 3) ;:font facename=default size=0x0.)
  3403. :li.[:font facename='System VIO' size=14x8.if:font facename=default size=0x0., :font facename='System VIO' size=14x8.while:font facename=default size=0x0., :font facename='System VIO' size=14x8.for:font facename=default size=0x0.]
  3404. :font facename='System VIO' size=14x8.block:font facename=default size=0x0. --
  3405. report errors for non-block bodies (e&per.g&per., :font facename='System VIO' size=14x8.if (x > 3) x++;:font facename=default size=0x0.)
  3406. :eul.
  3407.  
  3408.  
  3409. The if statement checks also apply to the body of the else clause&per.  An ifblock
  3410. error is not reported if the body of the else clause is an if statement, to
  3411. allow else if chains&per.  
  3412. .br
  3413. :font facename='Tms Rmn' size=18x10.
  3414. .br
  3415. 10&per.2&per.5 Complete if-else Logic
  3416. :font facename=default size=0x0.
  3417. .br
  3418. .br
  3419. Although it may be perfectly reasonable in many contexts, an if-else chain with
  3420. no final else may indicate missing logic or forgetting to check error cases&per.
  3421. If :link reftype=hd res=18.:font facename='System VIO' size=14x8.elseifcomplete:font facename=default size=0x0.:elink.
  3422. is on, LCLint reports errors when an if statement that is the body of an
  3423. else clause does not have a matching else clause&per.  For example, the code,
  3424. :cgraphic.
  3425.    if (x == 0) { return "nil"; }
  3426.    else if (x == 1) { return "many"; }
  3427. :ecgraphic.
  3428. produces an error message since the second if has no matching else branch&per.
  3429. .br
  3430. :font facename='Helv' size=20x12.
  3431. .br
  3432. 10&per.3 Suspicious Statements
  3433. :font facename=default size=0x0.
  3434. .br
  3435. .br
  3436.  
  3437. LCLint detects errors involving statements with no apparent effects (Section 10&per.3&per.1) and statements that
  3438. ignore the result of a called function (Section 10&per.3&per.2)&per.
  3439.  
  3440. .br
  3441. :font facename='Tms Rmn' size=18x10.
  3442. .br
  3443. 10&per.3&per.1 Statements with No Effects
  3444. :font facename=default size=0x0.
  3445. .br
  3446. .br
  3447.  
  3448. LCLint can report errors for statements that have no effect&per.  (Controlled by
  3449. noeffect&per.)   Because of modifies clauses, LCLint can detect more errors than
  3450. traditional checkers&per.  Unless the noeffectuncon flag is on, errors are not
  3451. reported for statements that involve calls to unconstrained functions since the
  3452. unconstrained function may cause a modification&per.
  3453. :p.
  3454. :p.
  3455. :link reftype=hd res=64.Figure 22&per.  Statements with no effect&per.:elink.
  3456. :p.
  3457. .br
  3458. :font facename='Tms Rmn' size=18x10.
  3459. .br
  3460.  
  3461. 10&per.3&per.2 Ignored Return Values
  3462. :font facename=default size=0x0.
  3463. .br
  3464. .br
  3465. LCLint reports an error when a return value is ignored&per.  Checking may be
  3466. controlled based on the type of the return value&colon. retvalint controls reporting
  3467. of ignored return values of type int, and retvalbool for return values of type
  3468. bool, and retvalothers for all other types&per.  A function statement may be cast
  3469. to void to prevent this error from being reported&per. 
  3470. :p.
  3471. :p.
  3472. Alternate types (:link reftype=hd res=11.Section 8&per.2&per.2:elink.) can be used to declare functions that return
  3473. values that may safely be ignored by declaring the result type to alternately
  3474. by void&per.  Several functions in the standard library are specified to
  3475. alternately return void to prevent ignored return value errors for standard
  3476. library functions (e&per.g&per., strcpy) where the result may be safely ignored (see
  3477. :link reftype=hd res=21.Apppendix F:elink.)&per.  
  3478. :p.
  3479. :p.
  3480. :link reftype=hd res=65.Figure 23:elink. shows example of ignored return value
  3481. errors reported by LCLint&per.
  3482. :p.
  3483.  
  3484. .br
  3485. :font facename='Helv' size=20x12.
  3486. .br
  3487. 10&per.4 Unused Declarations
  3488. :font facename=default size=0x0.
  3489. .br
  3490. .br
  3491. LCLint detects constants, functions, parameters, variables, types, enumerator
  3492. members, and structure or union fields that are declared but never used&per.  The
  3493. flags 
  3494. :link reftype=hd res=18.:font facename='System VIO' size=14x8.constuse:font facename=default size=0x0.:elink., 
  3495. :link reftype=hd res=18.:font facename='System VIO' size=14x8.fcnuse:font facename=default size=0x0.:elink., 
  3496. :link reftype=hd res=18.:font facename='System VIO' size=14x8.paramuse:font facename=default size=0x0.:elink.,
  3497. :link reftype=hd res=18.:font facename='System VIO' size=14x8.varuse:font facename=default size=0x0.:elink., 
  3498. :link reftype=hd res=18.:font facename='System VIO' size=14x8.typeuse:font facename=default size=0x0.:elink., 
  3499. :link reftype=hd res=18.:font facename='System VIO' size=14x8.enummemuse:font facename=default size=0x0.:elink. and
  3500. :link reftype=hd res=18.:font facename='System VIO' size=14x8.fielduse:font facename=default size=0x0.:elink. control whether
  3501. unused declaration errors are reported for each kind of declaration&per.
  3502. Errors for exported declarations are reported only if 
  3503. :link reftype=hd res=18.:font facename='System VIO' size=14x8.topuse:font facename=default size=0x0.:elink. is on (see Section 10&per.5)&per.
  3504. :p. 
  3505. :p.
  3506. The :font facename='System VIO' size=14x8./*@unused@*/:font facename=default size=0x0. annotation can be used before a declaration to indicate that
  3507. the item declared need not be used&per.  Unused declaration errors are not reported
  3508. for identifiers declared with unused&per.
  3509.  
  3510. .br
  3511. :font facename='Helv' size=20x12.
  3512. .br
  3513.  
  3514. 10&per.5 Complete Programs
  3515. :font facename=default size=0x0.
  3516. .br
  3517. .br
  3518. LCLint can be used on both complete and partial programs&per.  When checking
  3519. complete programs, additional checks can be done to ensure that every
  3520. identifier declared by the program is defined and used, and that functions that
  3521. do not need to be exported are declared static&per.
  3522. :p.
  3523. :p.
  3524. LCLint checks that all declared variables and functions are defined (controlled
  3525. by :link reftype=hd res=18.:font facename='System VIO' size=14x8.compdef:font facename=default size=0x0.:elink.)&per.
  3526. Declarations of functions and variables that are defined in an external
  3527. library, may be preceded by :font facename='System VIO' size=14x8./*@external@*/:font facename=default size=0x0. to suppress
  3528. undefined declaration errors&per.
  3529. :p. 
  3530. :p.
  3531. LCLint reports external declarations which are unused (Controlled by :link reftype=hd res=18.:font facename='System VIO' size=14x8.topuse:font facename=default size=0x0.:elink.)&per.
  3532. Which declarations are reported also depends on the declaration use flags (see
  3533. :link reftype=hd res=13.Section 10&per.4:elink.)&per.  
  3534. :p.
  3535. :p.
  3536. The :link reftype=hd res=18.:font facename='System VIO' size=14x8.partial:font facename=default size=0x0.:elink. flag sets
  3537. flags for checking a partial system&per.  Top-level unused declarations,
  3538. undefined declarations, and unnecessary external names are not reported
  3539. if :font facename='System VIO' size=14x8.partial:font facename=default size=0x0. is set&per.
  3540.  
  3541. .br
  3542. :font facename='Tms Rmn' size=18x10.
  3543. .br
  3544.  
  3545. 10&per.5&per.1 Unnecessary External Names
  3546. :font facename=default size=0x0.
  3547. .br
  3548. .br
  3549. LCLint can report variables and functions that are declared with global scope
  3550. (i&per.e&per., without using static), that are not used outside the file in which they
  3551. are defined&per.  In a stand-alone system, these identifiers should usually be
  3552. declared using static to limit their scope&per.  If the exportstatic flag is on,
  3553. LCLint will report declarations that could have file scope&per.  It should only be
  3554. used when all relevant source files are listed on the LCLint command line;
  3555. otherwise, variables and functions may be incorrectly identified as only used
  3556. in the file scope since LCLint did not process the other file in which they are
  3557. used&per.
  3558.  
  3559. .br
  3560. :font facename='Tms Rmn' size=18x10.
  3561. .br
  3562.  
  3563. 10&per.5&per.2 Declarations Missing from Headers
  3564. :font facename=default size=0x0.
  3565. .br
  3566. .br
  3567. A common practice in C programming styles, is that every function or variable
  3568. exported by :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.c:font facename=default size=0x0. is declared in :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.h:font facename=default size=0x0.&per.  If
  3569. the :link reftype=hd res=18.:font facename='System VIO' size=14x8.exportheader:font facename=default size=0x0.:elink. flag is on, LCLint will report exported declarations in :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.c
  3570. :font facename=default size=0x0. that are not declared in :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.h:font facename=default size=0x0.&per.
  3571. :p.
  3572.  
  3573. .br
  3574. :font facename='Helv' size=20x12.
  3575. .br
  3576.  
  3577. 10&per.6 Compiler Limits
  3578. :font facename=default size=0x0.
  3579. .br
  3580. .br
  3581. The ANSI Standard includes limits on minimum numbers that a conforming compiler
  3582. must support&per.  Whether of not a particular compiler exceeds these limits, it is
  3583. worth checking that a program does not exceed them so that it may be safely
  3584. compiled by other compilers&per.  In addition, exceeding a limit may indicate a
  3585. problem in the code (e&per.g&per., it is too complex if the control nest depth limit is
  3586. exceeded) that should be fixed regardless of the compiler&per.  The following
  3587. limits are checked by LCLint&per.  For each  limit, the maximum value may be set
  3588. from the command line (or locally using a stylized comment)&per.  If the 
  3589. :link reftype=hd res=18.:font facename='System VIO' size=14x8.ansilimits:font facename=default size=0x0.:elink.
  3590. flag is on, all limits are checked with the minimum values of a conforming
  3591. compiler&per.
  3592. :p.
  3593. :link reftype=hd res=18.:font facename='System VIO' size=14x8.includenest:font facename=default size=0x0.:elink.
  3594. :p.
  3595. Maximum nesting depth of file inclusion (#include)&per.  (ANSI minimum is 8)
  3596.  
  3597. :link reftype=hd res=18.:font facename='System VIO' size=14x8.controlnestdepth:font facename=default size=0x0.:elink.
  3598. :p.
  3599. Maximum nesting of compound statements, control structures&per.  (ANSI
  3600. minimum is 15)  
  3601.  
  3602. :link reftype=hd res=18.:font facename='System VIO' size=14x8.numenummembers:font facename=default size=0x0.:elink.
  3603. :p.
  3604. Number of members in an enum declaration&per. (ANSI minimum is 127)
  3605.  
  3606. :link reftype=hd res=18.:font facename='System VIO' size=14x8.numstructfields:font facename=default size=0x0.:elink.
  3607. :p.
  3608. Number of fields in a struct or union declaration&per. (ANSI minimum is 127)
  3609.  
  3610. :cgraphic.
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617. :ecgraphic.
  3618. :p.
  3619. :hp3.
  3620. Since human beings themselves are not fully debugged yet, there will be bugs in
  3621. your code no matter what you do&per.:ehp3.
  3622. .br
  3623. - Chris Mason, Zero-defects  memo (:hp1.Microsoft Secrets:ehp1., Cusumano
  3624. and Selby)
  3625.  
  3626.  
  3627. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  3628. .br
  3629. :link reftype=hd res=16.
  3630. :elink.:artwork name='right-arrow.bmp' align=left.:artlink.:link reftype=hd res=16.:eartlink.:link reftype=hd res=16.:elink.
  3631. :link reftype=hd res=1.
  3632. :elink.:artwork name='up-arrow.bmp' align=left.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  3633. :link reftype=hd res=27.
  3634. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  3635.  
  3636. :link reftype=hd res=2.David Evans:elink. 
  3637. .br
  3638. :link reftype=hd res=3.Systematic Program Development:elink.
  3639. .br
  3640. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  3641.  
  3642. .* Source filename: appA.html
  3643. :h2 res=16.LCLint User's Guide - Appendix A  Availability
  3644. :font facename=default size=0x0.
  3645. :p.
  3646.  
  3647. .br
  3648. :font facename='Helv' size=20x12.
  3649. .br
  3650. Appendix A  Availability
  3651. :p.
  3652. :font facename=default size=0x0.
  3653. .br
  3654. .br
  3655. :hp2.:ehp2.The web home page for LCLint is :font facename='System VIO' size=14x8.http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/larch/lclint/index&per.html:font facename=default size=0x0.&per.
  3656. It includes this guide in postscript format, samples demonstrating LCLint, and links to related web sites&per.
  3657. :p.
  3658. :p.
  3659. LCLint can be downloaded from :font facename='System VIO' size=14x8.http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/larch/lclint/download&per.html:font facename=default size=0x0.
  3660. or obtained via anonymous ftp from :font facename='System VIO' size=14x8.ftp&colon.//larch&per.lcs&per.mit&per.edu/pub/Larch/lclint/:font facename=default size=0x0.
  3661. :p.
  3662. Several UNIX platforms are supported and source code is provided for other platforms&per.
  3663.  
  3664. :p.
  3665. LCLint can also be run remotely using a form at :link reftype=hd res=39.:font facename='System VIO' size=14x8.http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/larch/lclint/run&per.html:font facename=default size=0x0.:elink.
  3666. :p.
  3667.  
  3668. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  3669. .br
  3670. :link reftype=hd res=17.
  3671. :elink.
  3672. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=17.:eartlink.:link reftype=hd res=17.:elink.
  3673. :link reftype=hd res=1.
  3674. :elink.
  3675. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  3676. :link reftype=hd res=27.
  3677. :elink.
  3678. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  3679.  
  3680. :link reftype=hd res=2.David Evans:elink. 
  3681. .br
  3682. :link reftype=hd res=3.Systematic Program Development:elink.
  3683. .br
  3684. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  3685.  
  3686.  
  3687. .* Source filename: appB.html
  3688. :h2 res=17.LCLint User's Guide - Appendix B  Communication
  3689. :font facename=default size=0x0.
  3690. :p.
  3691.  
  3692.  
  3693. .br
  3694. :font facename='Helv' size=20x12.
  3695. .br
  3696. Appendix B  Communication
  3697. :font facename=default size=0x0.
  3698. .br
  3699. .br
  3700.  
  3701. :p.
  3702. :hp2.:ehp2.LCLint development is largely driven by suggestions and comments from
  3703. users&per.  We are also very interested in hearing about your experiences using
  3704. LCLint in developing or maintaining programs, enforcing coding standards, or
  3705. teaching courses&per.  For general information, suggestions, and questions on
  3706. LCLint send mail to :link reftype=hd res=40.:font facename='System VIO' size=14x8.lclint@larch&per.lcs&per.mit&per.edu:font facename=default size=0x0.:elink.&per.
  3707. :p.
  3708. :p.
  3709. To report a bug in LCLint send a message to :link reftype=hd res=41.:font facename='System VIO' size=14x8.lclint-bug@larch&per.lcs&per.mit&per.edu:font facename=default size=0x0.:elink.&per.
  3710. :p.
  3711. :p.
  3712. There are two mailing lists associated with LCLint&colon.
  3713. :p.
  3714. :font facename='System VIO' size=14x8.lclint-announce@larch&per.lcs&per.mit&per.edu:font facename=default size=0x0.
  3715. :p.
  3716. Reserved for announcements of new releases and bug fixes&per.  (Everyone who sends
  3717. mail regarding LCLint is added to this list&per.)
  3718.  
  3719. :font facename='System VIO' size=14x8.lclint-interest@larch&per.lcs&per.mit&per.edu:font facename=default size=0x0.
  3720. :p.
  3721. Informal discussions on the use and development of LCLint&per.  To subscribe, send
  3722. a (human-readable) message to :font facename='System VIO' size=14x8.lclint-request@larch&per.lcs&per.mit&per.edu:font facename=default size=0x0.,
  3723. or use a form&per.
  3724. :p.
  3725.  
  3726. :p.
  3727. LCLint discussions relating to checks enabled by specifications or annotations
  3728. are welcome in the :link reftype=hd res=43.:font facename='System VIO' size=14x8.comp&per.specification&per.larch:font facename=default size=0x0.:elink.
  3729.  
  3730. usenet group&per.  Messages more focused on C-specific checking would be more
  3731. appropriate for the lclint-interest list of one of the C language groups&per.
  3732.  
  3733.  
  3734. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  3735. .br
  3736. :link reftype=hd res=18.
  3737. :elink.
  3738. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  3739. :link reftype=hd res=1.
  3740. :elink.
  3741. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  3742. :link reftype=hd res=27.
  3743. :elink.
  3744. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  3745.  
  3746. :link reftype=hd res=2.David Evans:elink. 
  3747. .br
  3748. :link reftype=hd res=3.Systematic Program Development:elink.
  3749. .br
  3750. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  3751.  
  3752.  
  3753. .* Source filename: appC.html
  3754. :h2 res=18.LCLint User's Guide - Appendix C  Flags
  3755. :font facename=default size=0x0.
  3756. :p.
  3757.  
  3758.  
  3759. .br
  3760. :font facename='Helv' size=20x12.
  3761. .br
  3762. Appendix C  Flags:font facename=default size=0x0.
  3763. .br
  3764. .br
  3765. :p.
  3766.  
  3767. :hp2.:ehp2.Flags can be grouped into four major categories&colon. 
  3768. :p.
  3769. :ul compact.
  3770. :li.Global flags for controlling initializations and global behavior
  3771. :li.Message format flags for controlling how messages are displayed
  3772. :li.Mode selectors for coarse control of LCLint checking
  3773. :li.Checking flags that control checking and what classes of
  3774.         messages are reported
  3775. :eul.
  3776.  
  3777. Global flags can be used in initialization files and at the command line; all
  3778. other flags may also be used in control comments&per.
  3779.  
  3780.  
  3781. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  3782. .br
  3783. :link reftype=hd res=19.
  3784. :elink.
  3785. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=19.:eartlink.:link reftype=hd res=19.:elink.
  3786. :link reftype=hd res=1.
  3787. :elink.
  3788. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  3789. :link reftype=hd res=27.
  3790. :elink.
  3791. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  3792.  
  3793. :link reftype=hd res=2.David Evans:elink. 
  3794. .br
  3795. :link reftype=hd res=3.Systematic Program Development:elink.
  3796. .br
  3797. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  3798.  
  3799.  
  3800.  
  3801.  
  3802. :h3 res=1801.Global Flags
  3803. :p.
  3804. :hp2.Global Flags:ehp2.
  3805. :p.
  3806. :hp2.:ehp2.Global flags can be set at the command line or in an options file, but
  3807. cannot be set locally using stylized comments&per.  These flags control on-line
  3808. help, initialization files, pre-processor flags, libraries and output&per. 
  3809. :p.
  3810.  
  3811. :hp2.:hp1.Help:ehp1.:ehp2.
  3812. :p.
  3813. :hp2.:hp1.:ehp1.:ehp2.On-line help provides documentation on LCLint operation and
  3814. flags&per.  When a help flag is used, no checking is done by LCLint&per.  Help flags
  3815. may be preceded by :font facename='System VIO' size=14x8.-:font facename=default size=0x0. or :font facename='System VIO' size=14x8.+:font facename=default size=0x0.&per.
  3816. :p.
  3817. :font facename='System VIO' size=14x8.help:font facename=default size=0x0.
  3818. :p.
  3819. Display general help overview, including list of additional help topics&per.
  3820.  
  3821. :font facename='System VIO' size=14x8.help:font facename=default size=0x0. <:hp3.topic:ehp3.>
  3822. :p.
  3823. Display help on :hp1.<topic>:ehp1.&per. Available topics&colon.
  3824. :p.
  3825. :table cols='38 38'.
  3826. :row.
  3827. :c.annotations:c.describe annotations
  3828. :row.
  3829. :c.comments:c.describe control comments
  3830. :row.
  3831. :c.flags:c.summarize flag categories
  3832. :row.
  3833. :c.flags <:hp3.category:ehp3.>:c.all flags pertaining to
  3834. <:hp3.category:ehp3.> (one of the categories listed by lclint -help
  3835. flags)         
  3836. :row.
  3837. :c.flags alpha:c.all flags in alphabetical order
  3838. :row.
  3839. :c.flags full:c.print a full description of all flags
  3840. :row.
  3841. :c.mail:c.print information on mailing lists
  3842. :row.
  3843. :c.modes:c.flags settings in modes
  3844. :row.
  3845. :c.prefixcodes:c.character codes for setting namespace prefixes
  3846. :row.
  3847. :c.references:c.print references to relevant papers and web sites
  3848. :row.
  3849. :c.vars:c.describe environment variables
  3850. :row.
  3851. :c.version:c.print maintainer and version information
  3852. :etable.
  3853.  
  3854.  
  3855. :font facename='System VIO' size=14x8.help:font facename=default size=0x0. <:hp3.flag:ehp3.>
  3856. :p.
  3857. Describe flag :hp1.<flag>:ehp1.&per.  (May list several flags&per.)
  3858.  
  3859. :font facename='System VIO' size=14x8.warnflags:font facename=default size=0x0.
  3860. :p.
  3861. Display a warning when a flag is set in a surprising way&per.  An error is reported
  3862. if an obsolete (LCLint Version 1&per.4 or earlier) flag is set, a flag is set to
  3863. its current value (i&per.e&per., the + or - may be wrong), or a mode selector flag is
  3864. set after mode checking flags that will be reset by the mode were set&per.  By
  3865. default, warnflags is on&per.  To suppress flag warnings, use :font facename='System VIO' size=14x8.-warnflags:font facename=default size=0x0.&per.
  3866.  
  3867. :p.
  3868. :hp2.:hp1.Initialization:ehp1.:ehp2.
  3869. :p.
  3870. :hp2.:hp1.:ehp1.:ehp2.These flags control directories and files used by LCLint&per.  They
  3871. may be used from the command line or in an options file, but may not be used as
  3872. control comments in the source code&per.  Except where noted&per. they have the same
  3873. meaning preceded by - or +&per.  
  3874. :p.
  3875.  
  3876. :font facename='System VIO' size=14x8.tmpdir:font facename=default size=0x0. :hp1.<directory>:ehp1.
  3877. :p.
  3878. :p.
  3879. Set directory for writing temp files&per.  Default is :font facename='System VIO' size=14x8./tmp/:font facename=default size=0x0.&per.
  3880.  
  3881.  
  3882. :font facename='System VIO' size=14x8.I:font facename=default size=0x0.:hp1.<directory>:ehp1.
  3883. :p.
  3884. Add directory to path searched for C include files&per.  Note there is no space
  3885. after the I, to be consistent with C preprocessor flags&per.
  3886.  
  3887.  
  3888. :font facename='System VIO' size=14x8.S:font facename=default size=0x0.:hp1.<directory>:ehp1.
  3889. :p.
  3890. Add directory to path search for &per.lcl specification files&per.
  3891.  
  3892. :p.
  3893. :p.
  3894.  
  3895. :font facename='System VIO' size=14x8.f :font facename=default size=0x0.:hp1.<file>:ehp1.
  3896. :p.
  3897. :p.
  3898. Load options file :hp1.<file>:ehp1.&per.  If this flag is used from the command
  3899. line, the default :font facename='System VIO' size=14x8.~/&per.lclintrc:font facename=default size=0x0. file is not loaded&per.  This flag may be used in an
  3900. options file to load in another options file&per.
  3901.  
  3902.  
  3903. :font facename='System VIO' size=14x8.nof:font facename=default size=0x0.
  3904. :p.
  3905. Prevents the default options files (:font facename='System VIO' size=14x8.&per./&per.lclintrc:font facename=default size=0x0. and
  3906. :font facename='System VIO' size=14x8.~/&per.lclintrc:font facename=default size=0x0.) from being loaded&per.  (Setting :font facename='System VIO' size=14x8.-nof:font facename=default size=0x0.
  3907. overrides :font facename='System VIO' size=14x8.+nof:font facename=default size=0x0., causing the options files to be loaded normally&per.)
  3908.  
  3909. :font facename='System VIO' size=14x8.systemdirs:font facename=default size=0x0.
  3910. :p.
  3911. Set directories for system files (default is ":font facename='System VIO' size=14x8./usr/include:font facename=default size=0x0.")&per.  Separate
  3912. directories with colons (e&per.g&per., ":font facename='System VIO' size=14x8./usr/include&colon./usr/local/lib:font facename=default size=0x0.")&per.  Flag settings
  3913. propagate to files in a system directory&per.  If :font facename='System VIO' size=14x8.-systemdirerrors:font facename=default size=0x0. is set, no
  3914. errors are reported for files in system directories&per.
  3915.  
  3916. :p.
  3917. :hp2.:hp1.Pre-processor:ehp1.:ehp2.
  3918. :p.
  3919. :hp2.:hp1.:ehp1.:ehp2.These flags are used to define or undefine pre-processor
  3920. constants&per.  The -I:hp1.<directory>:ehp1. flag is also passed to the C
  3921. pre-processor&per.
  3922. :p.
  3923.  
  3924. :font facename='System VIO' size=14x8.D:font facename=default size=0x0.<:hp3.initializer:ehp3.>
  3925. :p.
  3926. Passed to the C pre-processor&per.
  3927.  
  3928.  
  3929. :font facename='System VIO' size=14x8.U:font facename=default size=0x0.<:hp3.initializer:ehp3.>
  3930. :p.
  3931. Passed to the C pre-processor
  3932.  
  3933. :p.
  3934. :hp2.:hp1.Libraries:ehp1.:ehp2.
  3935. :p.
  3936. :hp2.:hp1.:ehp1.:ehp2.These flags control the creation and use of libraries&per.
  3937. :p.
  3938. :font facename='System VIO' size=14x8.dump :font facename=default size=0x0.:hp1.<file>:ehp1.
  3939. :p.
  3940. Save state in :hp1.<file>:ehp1. for loading&per.  The default extension &per.lcd is
  3941. added if :hp1.<file>:ehp1. has no extension&per.
  3942.  
  3943. :font facename='System VIO' size=14x8.load :font facename=default size=0x0.:hp1.<file>:ehp1.
  3944. :p.
  3945. Load state from :hp1.<file>:ehp1. (created by :font facename='System VIO' size=14x8.-dump:font facename=default size=0x0.)&per.  The default extension
  3946. :font facename='System VIO' size=14x8.&per.lcd:font facename=default size=0x0. is added if :hp1.<file>:ehp1. has no extension&per.  Only one library file
  3947. may be loaded&per.
  3948.  
  3949. :p.
  3950. By default, the standard library is loaded if the -load flag is not used to
  3951. load a user library&per.  If no user library is loaded, one of the following flags
  3952. may be used to select a different standard library&per.  Precede the flag by + to
  3953. load the described library (or prevent a library from being loaded using
  3954. nolib)&per.  See :link reftype=hd res=21.Apppendix F:elink. for information on the
  3955. provided libraries&per.
  3956.  
  3957. :p.
  3958. :font facename='System VIO' size=14x8.nolib:font facename=default size=0x0.
  3959. :p.
  3960. Do not load any library&per.  This prevents the standard library from being loaded&per.
  3961.  
  3962. :font facename='System VIO' size=14x8.ansi-lib:font facename=default size=0x0.
  3963. :p.
  3964. Use the ANSI standard library (selected by default)&per. 
  3965.  
  3966.  
  3967. :font facename='System VIO' size=14x8.strict-lib:font facename=default size=0x0.
  3968. :p.
  3969. Use strict version of the ANSI standard library&per.
  3970.  
  3971.  
  3972. :font facename='System VIO' size=14x8.posix-lib:font facename=default size=0x0.
  3973. :p.
  3974. Use the POSIX standard library&per.
  3975.  
  3976.  
  3977. :font facename='System VIO' size=14x8.posix-strict-lib:font facename=default size=0x0.
  3978. :p.
  3979. Use the strict version of the POSIX standard library&per.
  3980.  
  3981.  
  3982. :font facename='System VIO' size=14x8.unix-lib:font facename=default size=0x0.
  3983. :p.
  3984. Use UNIX version of standard library&per.
  3985.  
  3986.  
  3987. :font facename='System VIO' size=14x8.unix-strict-lib:font facename=default size=0x0.
  3988. :p.
  3989. Use the strict version of the UNIX standard library&per. 
  3990.  
  3991.  
  3992. :p.
  3993. :hp2.:hp1.Output:ehp1.:ehp2.
  3994. :p.
  3995. :hp2.:hp1.:ehp1.:ehp2.These flags control what additional information is printed by
  3996. LCLint&per.  Setting +:hp1.<flag>:ehp1. causes the described information to be
  3997. printed;  setting -:hp1.<flag>:ehp1. prevents it&per.  By default, all these
  3998. flags are off&per.
  3999. :p.
  4000. :font facename='System VIO' size=14x8.usestderr:font facename=default size=0x0.
  4001. :p.
  4002. Send error messages to standard error (instead of standard out)&per.
  4003.  
  4004. :font facename='System VIO' size=14x8.showsummary:font facename=default size=0x0.
  4005. :p.
  4006. Show a summary of all errors reported and suppressed&per.  Counts of suppressed
  4007. errors are not necessarily correct since turning a flag off may prevent some
  4008. checking from being done to save computation, and errors that are not
  4009. reported may propagate differently from when they are reported&per.
  4010.  
  4011. :font facename='System VIO' size=14x8.showscan:font facename=default size=0x0.
  4012. :p.
  4013. Show file names are they are processed&per.
  4014.  
  4015. :font facename='System VIO' size=14x8.showalluses:font facename=default size=0x0.
  4016. :p.
  4017. Show list of uses of all external identifiers sorted by number of uses&per.
  4018.  
  4019. :font facename='System VIO' size=14x8.stats:font facename=default size=0x0.
  4020. :p.
  4021. Display number of lines processed and checking time&per.
  4022.  
  4023. :font facename='System VIO' size=14x8.timedist:font facename=default size=0x0.
  4024. :p.
  4025. Display distribution of where checking time is spent&per.
  4026.  
  4027. :font facename='System VIO' size=14x8.quiet:font facename=default size=0x0.
  4028. :p.
  4029. Suppress herald and error count&per.  (If quiet is not set, LCLint prints out a
  4030. herald with version  information before checking begins, and a line summarizing
  4031. the total number of errors reported&per.)
  4032.  
  4033. :font facename='System VIO' size=14x8.whichlib:font facename=default size=0x0.
  4034. :p.
  4035. Print out the standard library filename and creation information&per.
  4036.  
  4037.  
  4038. :font facename='System VIO' size=14x8.limit :font facename=default size=0x0.:hp1.<number>:ehp1.
  4039. :p.
  4040. At most :hp1.<number>:ehp1. similar errors are reported consecutively&per.
  4041. Further errors are suppressed, and a message showing the number of suppressed
  4042. messages is printed&per.
  4043.  
  4044. :p.
  4045. :hp2.:hp1.Expected Errors:ehp1.:ehp2.
  4046. :p.
  4047. :hp2.:hp1.:ehp1.:ehp2.Normally, LCLint will expect to report no errors&per.  The exit
  4048. status will be success (0) if no errors are reported, and failure if any errors
  4049. are reported&per.  Flags can be used to set the expected number of reported errors&per.
  4050. Because of the provided error suppression mechanisms, these options should
  4051. probably not be used for final checking real programs but may be useful in
  4052. developing programs using make&per.
  4053. :p.
  4054. :font facename='System VIO' size=14x8.expect :font facename=default size=0x0.:hp1.<number>:ehp1.
  4055. :p.
  4056. Exactly :hp1.<number>:ehp1. code errors are expected&per.  LCLint will exit with
  4057. failure exit status unless :hp1.<number>:ehp1. code errors are
  4058. detected&per. 
  4059.  
  4060.  
  4061. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  4062. .br
  4063. :link reftype=hd res=18.
  4064. :elink.
  4065. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  4066. :link reftype=hd res=1.
  4067. :elink.
  4068. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  4069. :link reftype=hd res=27.
  4070. :elink.
  4071. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  4072.  
  4073. :link reftype=hd res=2.David Evans:elink. 
  4074. .br
  4075. :link reftype=hd res=3.Systematic Program Development:elink.
  4076. .br
  4077. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  4078.  
  4079.  
  4080.  
  4081.  
  4082. :h3 res=1802.Message Format
  4083. :p.
  4084. :hp2.Message Format:ehp2.
  4085. :p.
  4086. :hp2.:ehp2.These flags control how messages are printed&per.  They may be set at the
  4087. command line, in options files, or locally in syntactic comments&per.  The linelen
  4088. and limit flags may be preceded by + or - with the same meaning; for the other
  4089. flags, + turns on the describe printing and - turns it off&per.  The box to the
  4090. left of each flag gives its default value&per.
  4091. :p.
  4092.  
  4093. :font facename='System VIO' size=14x8.showcolumn:font facename=default size=0x0.
  4094. :p.
  4095. Show column number where error is found&per.  Default&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  4096.  
  4097. :font facename='System VIO' size=14x8.showfunc:font facename=default size=0x0.
  4098. :p.
  4099. Show name of function (or macro) definition containing error&per.  The function
  4100. name is printed once before the first message detected in that function&per.
  4101. Default&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  4102. :p.
  4103.  
  4104. :font facename='System VIO' size=14x8.showallconjs:font facename=default size=0x0.
  4105. :p.
  4106. Show all possible alternate types (see Section 8&per.2&per.2)&per.  Default&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  4107.  
  4108. :font facename='System VIO' size=14x8.hints:font facename=default size=0x0.
  4109. :p.
  4110. Provide hints describing an error and how a message may be suppressed for the
  4111. first error reported in each error class&per. Default&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  4112.  
  4113. :font facename='System VIO' size=14x8.forcehints:font facename=default size=0x0.
  4114. :p.
  4115. Provide hints for all errors reported, even if the hint has already been
  4116. displayed for the same error class&per.  Default&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  4117.  
  4118.  
  4119. :font facename='System VIO' size=14x8.linelen:font facename=default size=0x0. :hp1.<number>:ehp1.
  4120. :p.
  4121. Set length of maximum message line to :hp1.<number>:ehp1. characters&per.  LCLint
  4122. will split messages longer than :hp1.<number>:ehp1. characters long into
  4123. multiple lines&per.  Default&colon. :font facename='System VIO' size=14x8.80:font facename=default size=0x0.
  4124.  
  4125. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  4126. .br
  4127. :link reftype=hd res=18.
  4128. :elink.
  4129. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  4130. :link reftype=hd res=1.
  4131. :elink.
  4132. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  4133. :link reftype=hd res=27.
  4134. :elink.
  4135. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  4136.  
  4137. :link reftype=hd res=2.David Evans:elink. 
  4138. .br
  4139. :link reftype=hd res=3.Systematic Program Development:elink.
  4140. .br
  4141. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  4142.  
  4143.  
  4144.  
  4145. :h3 res=1803.Mode Selector Flags
  4146. :p.
  4147. :hp2.Mode Selector Flags:ehp2.
  4148. :p.
  4149. :hp2.:ehp2.Mode selects flags set the mode checking flags to predefined values&per.
  4150. They provide a quick coarse-grain way of controlling what classes of errors are
  4151. reported&per. Specific checking flags may be set after a mode flag to override the
  4152. mode settings&per.  Mode flags may be used locally, however the mode settings will
  4153. override specific command line flag settings&per.  A warning is produced if a mode
  4154. flag is used after a mode checking flag has been set&per. 
  4155. :p.
  4156. :p.
  4157. These are brief descriptions to give a general idea of what each mode does&per.  To
  4158. see the complete flag settings in each mode, use lclint -help modes&per. A mode
  4159. flag has the same effect when used with either + or -&per.
  4160. :p.
  4161. :font facename='System VIO' size=14x8.weak:font facename=default size=0x0.
  4162. :p.
  4163. Weak checking, intended for typical unannotated C code&per.  No modifies checking,
  4164. macro checking, rep exposure, or clean interface checking is done&per.  Return
  4165. values of type int may be ignored&per.  The types bool, int, char and user-defined
  4166. enum types are all equivalent&per.  Old style declarations are unreported&per. 
  4167.  
  4168. :font facename='System VIO' size=14x8.standard:font facename=default size=0x0.
  4169. :p.
  4170. The default mode&per.  All checking done by weak, plus modifies checking, global
  4171. alias checking, use all parameters, using released storage, ignored return
  4172. values or any type, macro checking, unreachable code, infinite loops, and
  4173. fall-through cases&per.  The types bool, int and char are distinct&per.  Old style
  4174. declarations are reported&per.
  4175.  
  4176.  :font facename='System VIO' size=14x8.checks:font facename=default size=0x0.
  4177. :p.
  4178. Moderately strict checking&per.  All checking done by standard, plus must
  4179. modification checking, rep exposure, return alias, memory management and
  4180. complete interfaces&per.
  4181.  
  4182. :font facename='System VIO' size=14x8.strict:font facename=default size=0x0.
  4183. :p.
  4184. Absurdly strict checking&per.  All checking done by checks, plus modifications and
  4185. global variables used in unspecified functions, strict standard library, and
  4186. strict typing of C operators&per. A special reward will be presented to the first
  4187. person to produce a real program that produces no errors with strict checking&per.
  4188.  
  4189. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  4190. .br
  4191. :link reftype=hd res=18.
  4192. :elink.
  4193. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  4194. :link reftype=hd res=1.
  4195. :elink.
  4196. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  4197. :link reftype=hd res=27.
  4198. :elink.
  4199. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  4200.  
  4201. :link reftype=hd res=2.David Evans:elink. 
  4202. .br
  4203. :link reftype=hd res=3.Systematic Program Development:elink.
  4204. .br
  4205. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  4206.  
  4207.  
  4208.  
  4209. :h3 res=1804.Checking Flags
  4210. :p.
  4211. :hp2.Checking Flags:ehp2.
  4212. :p.
  4213. :hp2.:ehp2.These flags control checking done by LCLint&per.  They may be set locally
  4214. using syntactic comments, from the command line, or in an options file&per.  Some
  4215. flags directly control whether a certain class of message is reported&per.
  4216. Preceding the flag by + turns reporting on, and preceding the flag by - turns
  4217. reporting off&per.  Other flags control checking less directly by determining
  4218. default values (what annotations are implicit), making types equivalent (to
  4219. prevent certain type errors), controlling representation access, etc&per.  For
  4220. these flags, the effect of + is described, and the effect of - is the opposite
  4221. (or explicitly explained if there is no clear opposite)&per.  The organization of
  4222. this section mirrors Sections 3-10&per.
  4223.  
  4224. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  4225. .br
  4226. :link reftype=hd res=18.
  4227. :elink.
  4228. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  4229. :link reftype=hd res=1.
  4230. :elink.
  4231. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  4232. :link reftype=hd res=27.
  4233. :elink.
  4234. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  4235.  
  4236. :link reftype=hd res=2.David Evans:elink. 
  4237. .br
  4238. :link reftype=hd res=3.Systematic Program Development:elink.
  4239. .br
  4240. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  4241.  
  4242.  
  4243.  
  4244. :h4.Key
  4245. :p.
  4246. :hp2.:hp1.Key:ehp1.:ehp2.
  4247. :p.
  4248. :hp2.:hp1.:ehp1.:ehp2.Under each flag name is a flag descriptor encoding the
  4249. what kind of flag it is and its default value&per.  The descriptions are&colon.
  4250. :p.
  4251.  
  4252. plain&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  4253. :p.
  4254. A plain flag&per.  The value after the colon gives the default setting
  4255. (e&per.g&per., this flag is off&per.)  
  4256.  
  4257.  
  4258. m&colon. :font facename='System VIO' size=14x8.--++:font facename=default size=0x0. 
  4259. :p.
  4260. A mode checking flag&per.  The value of the flag is set by the mode selector&per.  The
  4261. four signs give the setting in the weak, standard, checks and strict modes&per.
  4262. (e&per.g&per., this flag is off in the weak and standard modes, and on in the checks
  4263. and strict modes&per.) 
  4264.  
  4265.  
  4266. shortcut
  4267. :p.
  4268. A shortcut flag&per.  This flag sets other flags, so it has no default value&per.
  4269.  
  4270. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  4271. .br
  4272. :link reftype=hd res=18.
  4273. :elink.
  4274. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  4275. :link reftype=hd res=1.
  4276. :elink.
  4277. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  4278. :link reftype=hd res=27.
  4279. :elink.
  4280. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  4281.  
  4282. :link reftype=hd res=2.David Evans:elink. 
  4283. .br
  4284. :link reftype=hd res=3.Systematic Program Development:elink.
  4285. .br
  4286. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  4287.  
  4288.  
  4289.  
  4290. :h4.Types
  4291. :p.
  4292. :hp2.:hp1.Types:ehp1.:ehp2.
  4293. :p.
  4294. :hp2.:hp1.:ehp1.Abstract Types:ehp2.
  4295. :p.
  4296. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  4297. .br
  4298. :font facename='System VIO' size=14x8.impabstract:font facename=default size=0x0.
  4299. :p.
  4300. Implicit abstract annotation for type declarations that do not use concrete&per.
  4301. :p.
  4302. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4303. .br
  4304. :font facename='System VIO' size=14x8.mutrep:font facename=default size=0x0.
  4305. :p.
  4306. Representation of mutable type has sharing semantics&per.
  4307. :p.
  4308. :hp2.Access :ehp2.(:link reftype=hd res=6.Section 3&per.1:elink.):hp2.:ehp2.
  4309. :p.
  4310. :hp2.:ehp2.
  4311. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  4312. .br
  4313. :font facename='System VIO' size=14x8.accessmodule:font facename=default size=0x0.
  4314. :p.
  4315. An abstract type defined in :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.h:font facename=default size=0x0. (or specified in :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.lcl:font facename=default size=0x0.) is
  4316. accessible in :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.c:font facename=default size=0x0.&per.
  4317. :p.
  4318. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  4319. .br
  4320. :font facename='System VIO' size=14x8.accessfile:font facename=default size=0x0.
  4321. :p.
  4322. An abstract type named :hp1.type:ehp1. is accessible in files named
  4323. :hp1.type:ehp1.&per.:hp1.<extenstion>:ehp1.&per.
  4324. :p.
  4325. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  4326. .br
  4327. :font facename='System VIO' size=14x8.accessczech:font facename=default size=0x0.
  4328. :p.
  4329. An abstract type named :hp1.type:ehp1. may be accessible in a function named
  4330. :hp1.type:ehp1._:hp1.name:ehp1.&per. (see :link reftype=hd res=12.Section 9&per.1&per.1:elink.)
  4331. :p.:link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  4332. .br
  4333. :font facename='System VIO' size=14x8.accessslovak:font facename=default size=0x0.
  4334. :p.
  4335. An abstract type named :hp1.type:ehp1. may be accessible in a function named
  4336. :hp1.typeName:ehp1.&per.  (see :link reftype=hd res=12.Section&per.9&per.1&per.2:elink.)
  4337. :p.
  4338. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  4339. .br
  4340. :font facename='System VIO' size=14x8.accessczechoslovak:font facename=default size=0x0.
  4341. :p.
  4342. An abstract type named :hp1.type:ehp1. may be accessible in a function named
  4343. :hp1.type:ehp1._:hp1.name:ehp1. or :hp1.typeName:ehp1.&per.  (see :link reftype=hd res=12.Section 9&per.1&per.3:elink.)
  4344. :p.
  4345. :link reftype=hd res=18.shortcut:elink.
  4346. .br
  4347. :font facename='System VIO' size=14x8.accessall:font facename=default size=0x0.
  4348. :p.
  4349. Sets accessmodule, accessfile and accessczech&per.
  4350. :p.
  4351. :hp2.Boolean Types :ehp2.(:link reftype=hd res=6.Section 3&per.3:elink.):hp2.:ehp2.
  4352. :p.
  4353. :hp2.:ehp2.These flags control the type name used to represent booleans, and
  4354. whether the boolean type is abstract&per.
  4355. :p.
  4356.  
  4357. :p.
  4358. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  4359. .br
  4360. :font facename='System VIO' size=14x8.bool:font facename=default size=0x0.
  4361. :p.
  4362. Boolean type is an abstract type&per.
  4363. :p.
  4364. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.bool:font facename=default size=0x0.
  4365. .br
  4366.  
  4367. booltype :hp1.<name:ehp1.:hp1.>:ehp1. 
  4368. :p.
  4369. Set name of boolean type to :hp1.<name>:ehp1.&per.
  4370. :p.
  4371. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.FALSE:font facename=default size=0x0.
  4372. .br
  4373.  
  4374. :font facename='System VIO' size=14x8.boolfalse :font facename=default size=0x0.:hp1.<name:ehp1.:hp1.>:ehp1.
  4375. :p.
  4376. Set name of boolean false to :hp1.<name>:ehp1.&per.
  4377. :p.
  4378. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.TRUE:font facename=default size=0x0.
  4379. .br
  4380.  
  4381. :font facename='System VIO' size=14x8.booltrue :font facename=default size=0x0.:hp1.<name:ehp1.:hp1.>:ehp1.
  4382. :p.
  4383. Set name of boolean true to :hp1.<name>:ehp1.&per.
  4384. :p.
  4385. :hp2.Predicates:ehp2.
  4386. :p.
  4387. :hp2.:ehp2.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  4388. .br
  4389. :font facename='System VIO' size=14x8.predboolptr:font facename=default size=0x0.
  4390. :p.
  4391. Type of condition test is a pointer&per.
  4392. :p.
  4393. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4394. .br
  4395. :font facename='System VIO' size=14x8.predboolint:font facename=default size=0x0.
  4396. :p.
  4397. Type of condition test is an integral type&per.
  4398. :p.
  4399. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++++:font facename=default size=0x0.
  4400. .br
  4401. :font facename='System VIO' size=14x8.predboolothers:font facename=default size=0x0.
  4402. :p.
  4403. Type of condition test is not a boolean, pointer or integral type&per.
  4404. :p.
  4405. :link reftype=hd res=18.shortcut:elink.
  4406. .br
  4407. :font facename='System VIO' size=14x8.predbool:font facename=default size=0x0.
  4408. :p.
  4409. Sets predboolint, predboolptr and preboolothers&per.
  4410. :p.
  4411. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  4412. .br
  4413. :font facename='System VIO' size=14x8.predassign:font facename=default size=0x0.
  4414. :p.
  4415. The condition test is an assignment expression&per. If an assignment is intended,
  4416. add an extra      parentheses nesting (e&per.g&per., :font facename='System VIO' size=14x8.if ((a = b)) &per.&per.&per.:font facename=default size=0x0.)&per.
  4417. :p.
  4418. :hp2.Primitive Operations:ehp2.
  4419. :p.
  4420. :hp2.:ehp2.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4421. .br
  4422. :font facename='System VIO' size=14x8.ptrarith:font facename=default size=0x0.
  4423. :p.
  4424. Arithmetic involving pointer and integer&per.
  4425. :p.
  4426. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++--:font facename=default size=0x0.
  4427. .br
  4428. :font facename='System VIO' size=14x8.ptrnegate:font facename=default size=0x0.
  4429. :p.
  4430. Allow the operand of the ! operator to be a pointer&per.
  4431. :p.
  4432.  
  4433. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4434. .br
  4435. :font facename='System VIO' size=14x8.bitwisesigned:font facename=default size=0x0.
  4436. :p.
  4437. An operand to a bitwise operator is not an unsigned values&per.  This may
  4438. have unexpected results depending on the signed representations&per.
  4439. :p.
  4440.  
  4441. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4442. .br
  4443. :font facename='System VIO' size=14x8.shiftsigned:font facename=default size=0x0.
  4444. :p.
  4445. An operand to a shift operator is not unsigned values&per.  This may have
  4446. unexpected results depending on the signed representations&per.
  4447. :p.
  4448.  
  4449. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4450. .br
  4451. :font facename='System VIO' size=14x8.strictops:font facename=default size=0x0.
  4452. :p.
  4453. Primitive operation does not type check strictly&per.
  4454. :p.
  4455. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4456. .br
  4457. :font facename='System VIO' size=14x8.sizeoftype:font facename=default size=0x0.
  4458. :p.
  4459. Operand of sizeof operator is a type&per.  (Safer to use expression, int *x =
  4460. sizeof (*x); instead of sizeof (int)&per.)
  4461. :p.
  4462. :p.
  4463. :hp2.Format Codes:ehp2.
  4464. :p.
  4465. :hp2.:ehp2.
  4466. :p.
  4467. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  4468. .br
  4469. :font facename='System VIO' size=14x8.formatcode:font facename=default size=0x0.
  4470. :p.
  4471. Invalid format code in format string for printflike or scanflike function&per.
  4472. :p.
  4473. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  4474. .br
  4475. :font facename='System VIO' size=14x8.formattype:font facename=default size=0x0.
  4476. :p.
  4477. Type-mismatch in parameter corresponding to format code in a printflike or
  4478. scanflike function&per.
  4479. :p.
  4480. :hp2.Main:ehp2.
  4481. :p.
  4482. :hp2.:ehp2.
  4483. :p.
  4484. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  4485. .br
  4486. :font facename='System VIO' size=14x8.maintype:font facename=default size=0x0.
  4487. :p.
  4488. Type of main does not match expected type (function returning an int, taking no
  4489. parameters or two parameters of type int and char **&per.)
  4490. :p.
  4491. :hp2.Comparisons:ehp2.
  4492. :p.
  4493.  
  4494. :hp2.:ehp2.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4495. .br
  4496. :font facename='System VIO' size=14x8.boolcompare:font facename=default size=0x0.
  4497. :p.
  4498. Comparison between boolean values&per.  This is dangerous since there may be
  4499. multiple TRUE values if any non-zero value is interpreted at TRUE&per.
  4500. :p.
  4501. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4502. .br
  4503. :font facename='System VIO' size=14x8.realcompare:font facename=default size=0x0.
  4504. :p.
  4505. Comparison involving float or double values&per.  This is dangerous since it may
  4506. produce unexpected results because floating point representations are
  4507. inexact&per.
  4508. :p.
  4509. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4510. .br
  4511. :font facename='System VIO' size=14x8.ptrcompare:font facename=default size=0x0.
  4512. :p.
  4513. Comparison between pointer and number&per.
  4514. :p.
  4515. :hp2.Type Equivalence
  4516. :ehp2.
  4517. :p.
  4518. :hp2.:ehp2.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.+---:font facename=default size=0x0.
  4519. .br
  4520. :font facename='System VIO' size=14x8.voidabstract:font facename=default size=0x0.
  4521. :p.
  4522. Allow :font facename='System VIO' size=14x8.void *:font facename=default size=0x0. to match pointers to abstract types&per.  (Casting a pointer to an
  4523. abstract type to a pointer to :font facename='System VIO' size=14x8.void:font facename=default size=0x0. is okay if :link reftype=hd res=18.:font facename='System VIO' size=14x8.+voidabstract:font facename=default size=0x0.:elink. is set&per.)
  4524. :p.
  4525. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  4526. .br
  4527.  
  4528. :font facename='System VIO' size=14x8.castfcnptr:font facename=default size=0x0.
  4529. :p.
  4530.  A pointer to a function is cast to (or used as) a pointer to void (or
  4531. vice versa)&per.
  4532. :p.
  4533. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.+---:font facename=default size=0x0.
  4534. .br
  4535. :font facename='System VIO' size=14x8.forwarddecl:font facename=default size=0x0.
  4536. :p.
  4537. Forward declarations of pointers to abstract representation match abstract
  4538. type&per.
  4539. :p.
  4540.  
  4541. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4542. .br
  4543. :font facename='System VIO' size=14x8.imptype:font facename=default size=0x0.
  4544. :p.
  4545. A variable declaration has no explicit type&per.  The type is
  4546. implicitly int&per.
  4547. :p.
  4548.  
  4549. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  4550. .br
  4551. :font facename='System VIO' size=14x8.incompletetype:font facename=default size=0x0.
  4552. :p.
  4553. A formal parameter is declared with an incomplete type (e&per.g&per.,
  4554. :font facename='System VIO' size=14x8.int[][]:font facename=default size=0x0.)&per.
  4555. :p.
  4556.  
  4557. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.+---:font facename=default size=0x0.
  4558. .br
  4559. :font facename='System VIO' size=14x8.charindex:font facename=default size=0x0.
  4560. :p.
  4561. Allow char to index arrays&per.
  4562. :p.
  4563. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  4564. .br
  4565. :font facename='System VIO' size=14x8.enumindex:font facename=default size=0x0.
  4566. :p.
  4567. Allow members of enum type  to index arrays&per.
  4568. :p.
  4569. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.+---:font facename=default size=0x0.
  4570. .br
  4571. :font facename='System VIO' size=14x8.boolint:font facename=default size=0x0.
  4572. :p.
  4573. Make bool and int types equivalent&per.  (No type errors are reported when a boolean
  4574. is used where an integral type is expected and vice versa&per.) 
  4575. :p.
  4576. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.+---:font facename=default size=0x0.
  4577. .br
  4578. :font facename='System VIO' size=14x8.charint:font facename=default size=0x0.
  4579. :p.
  4580. Make :font facename='System VIO' size=14x8.char:font facename=default size=0x0. and :font facename='System VIO' size=14x8.int:font facename=default size=0x0. types equivalent&per.
  4581. :p.
  4582. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++--:font facename=default size=0x0.
  4583. .br
  4584. :font facename='System VIO' size=14x8.enumint:font facename=default size=0x0.
  4585. :p.
  4586. Make :font facename='System VIO' size=14x8.enum:font facename=default size=0x0. and :font facename='System VIO' size=14x8.int:font facename=default size=0x0. types equivalent&per.
  4587. :p.
  4588. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.+---:font facename=default size=0x0.
  4589. .br
  4590. :font facename='System VIO' size=14x8.floatdouble:font facename=default size=0x0.
  4591. :p.
  4592. Make :font facename='System VIO' size=14x8.float:font facename=default size=0x0. and :font facename='System VIO' size=14x8.double:font facename=default size=0x0. types equivalent&per.
  4593. :p.
  4594. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  4595. .br
  4596. :font facename='System VIO' size=14x8.ignorequals:font facename=default size=0x0.
  4597. :p.
  4598. Ignore type qualifiers (:font facename='System VIO' size=14x8.long:font facename=default size=0x0., :font facename='System VIO' size=14x8.short:font facename=default size=0x0., :font facename='System VIO' size=14x8.unsigned:font facename=default size=0x0.
  4599. )&per.
  4600. :p.
  4601. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++--:font facename=default size=0x0.
  4602. .br
  4603. :font facename='System VIO' size=14x8.relaxquals:font facename=default size=0x0.
  4604. :p.
  4605. Report qualifier mismatches only if dangerous (information may be lost since a
  4606. larger type is assigned to (or passed as) a smaller one or a comparison uses
  4607. signed and unsigned values&per.)
  4608. :p.
  4609. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  4610. .br
  4611. :font facename='System VIO' size=14x8.ignoresigns:font facename=default size=0x0.
  4612. :p.
  4613. Ignore signs in type comparisons (:font facename='System VIO' size=14x8.unsigned:font facename=default size=0x0. matches :font facename='System VIO' size=14x8.signed:font facename=default size=0x0.)&per.
  4614. :p.
  4615. :p.
  4616. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  4617. .br
  4618.  
  4619. :font facename='System VIO' size=14x8.longintegral:font facename=default size=0x0.
  4620. :p.
  4621. Allow :font facename='System VIO' size=14x8.long:font facename=default size=0x0. type to match an arbitrary integral type (e&per.g&per., :font facename='System VIO' size=14x8.size_t:font facename=default size=0x0.)&per.
  4622. :p.
  4623. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.+---:font facename=default size=0x0.
  4624. .br
  4625.  
  4626. :font facename='System VIO' size=14x8.longunsignedintegral:font facename=default size=0x0.
  4627. :p.
  4628. Allow :font facename='System VIO' size=14x8.long unsigned:font facename=default size=0x0. type to match an arbitrary integral type (e&per.g&per.,
  4629. :font facename='System VIO' size=14x8.dev_t:font facename=default size=0x0.)&per.
  4630. :p.
  4631. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  4632. .br
  4633.  
  4634. :font facename='System VIO' size=14x8.matchanyintegral:font facename=default size=0x0.
  4635. :p.
  4636. Allow any integral type to match an arbitrary integral type (e&per.g&per.,
  4637. :font facename='System VIO' size=14x8.dev_t:font facename=default size=0x0.)&per.
  4638. :p.
  4639. :p.
  4640.  
  4641. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.+---:font facename=default size=0x0.
  4642. .br
  4643.  
  4644. :font facename='System VIO' size=14x8.long-unsigned-unsigned-integral:font facename=default size=0x0.
  4645. :p.
  4646. Allow unsigned long type to match an arbitrary unsigned integral type
  4647. (e&per.g&per., :font facename='System VIO' size=14x8.size_t:font facename=default size=0x0.)&per.
  4648. :p.
  4649. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.+---:font facename=default size=0x0.
  4650. .br
  4651.  
  4652. :font facename='System VIO' size=14x8.long-signed-integral:font facename=default size=0x0.
  4653. :p.
  4654. Allow long type to match an arbitrary signed integral type (e&per.g&per.,
  4655. :font facename='System VIO' size=14x8.ssize_t:font facename=default size=0x0.)&per.
  4656.  
  4657. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++++:font facename=default size=0x0.
  4658. .br
  4659. :font facename='System VIO' size=14x8.num-literal:font facename=default size=0x0.
  4660. :p.
  4661. Integer literals can be used as floats&per.
  4662. :p.
  4663. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  4664. .br
  4665.  
  4666. :font facename='System VIO' size=14x8.char-int-literal:font facename=default size=0x0.
  4667. :p.A character constant may be used as an :font facename='System VIO' size=14x8.int:font facename=default size=0x0.&per.
  4668. :p.
  4669. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++++:font facename=default size=0x0.
  4670. .br
  4671. :font facename='System VIO' size=14x8.zeroptr:font facename=default size=0x0.
  4672. :p.
  4673. Literal :font facename='System VIO' size=14x8.0:font facename=default size=0x0. may be used as a pointer&per.
  4674. :p.
  4675. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  4676. .br
  4677. :font facename='System VIO' size=14x8.relaxtypes:font facename=default size=0x0.
  4678. :p.
  4679. Allow all numeric types to match&per.
  4680. :p.
  4681. :p.
  4682. :link reftype=hd res=18.plain&colon. :elink.:font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  4683. .br
  4684. :font facename='System VIO' size=14x8.fullinitblock:font facename=default size=0x0.
  4685. :p.
  4686. Initializer does not set every field in the structure&per.
  4687. :p.
  4688.  
  4689. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  4690. .br
  4691. :link reftype=hd res=18.
  4692. :elink.
  4693. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  4694. :link reftype=hd res=1.
  4695. :elink.
  4696. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  4697. :link reftype=hd res=27.
  4698. :elink.
  4699. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  4700.  
  4701. :link reftype=hd res=2.David Evans:elink. 
  4702. .br
  4703. :link reftype=hd res=3.Systematic Program Development:elink.
  4704. .br
  4705. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  4706.  
  4707.  
  4708. :h4.Function Interfaces
  4709. :p.
  4710. :hp2.:hp1.Function Interfaces:ehp1.:ehp2.
  4711. :p.
  4712. :hp2.:hp1.:ehp1.Modification :ehp2.(:link reftype=hd res=7.Section 4&per.1:elink.):hp2.:ehp2.
  4713. :p.
  4714. :hp2.:ehp2.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++++:font facename=default size=0x0.
  4715. .br
  4716. :font facename='System VIO' size=14x8.modifies:font facename=default size=0x0.
  4717. :p.
  4718. Undocumented modification of caller-visible state&per.  Without :link reftype=hd res=18.:font facename='System VIO' size=14x8.+moduncon:font facename=default size=0x0.:elink.,
  4719. modification errors are only reported in the definitions of functions declared
  4720. with a modifies clause (or specified)&per.
  4721. :p.
  4722. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  4723. .br
  4724. :font facename='System VIO' size=14x8.mustmod:font facename=default size=0x0.
  4725. :p.
  4726. Documented modification is not detected&per.  An object listed in the modifies
  4727. clause for a function, is not modified by the implementation&per.
  4728. :p.
  4729. :link reftype=hd res=18.shortcut:elink.
  4730. .br
  4731. :font facename='System VIO' size=14x8.mod-uncon:font facename=default size=0x0.
  4732. :p.
  4733. Report modification errors in functions declared without a modifies
  4734. clause&per.(Sets :link reftype=hd res=18.:font facename='System VIO' size=14x8.modnomods:font facename=default size=0x0.:elink., :link reftype=hd res=18.:font facename='System VIO' size=14x8.mod-globs-nomods:font facename=default size=0x0.:elink. and 
  4735. :link reftype=hd res=18.:font facename='System VIO' size=14x8.mod-strict-globs-nomods:font facename=default size=0x0.:elink.&per.)
  4736. :p.
  4737. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4738. .br
  4739. :font facename='System VIO' size=14x8.mod-nomods:font facename=default size=0x0.
  4740. :p.
  4741. Report modification errors (not involving global variables) in functions
  4742. declared without a modifies clause&per.
  4743. :p.
  4744. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4745. .br
  4746. :font facename='System VIO' size=14x8.mod-uncon-nomods:font facename=default size=0x0.
  4747. :p.
  4748. An unconstrained function is called in a function body where  modifications are
  4749. checked&per.  Since the unconstrained function may modify anything, there may be
  4750. undetected modifications in the checked function&per.
  4751. :p.
  4752. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4753. .br
  4754. :font facename='System VIO' size=14x8.mod-internal-strict:font facename=default size=0x0.
  4755. :p.
  4756. A function that modifies :font facename='System VIO' size=14x8.internalState:font facename=default size=0x0. is called from a function that does not
  4757. list :font facename='System VIO' size=14x8.internalState:font facename=default size=0x0. in its modifies clause&per.
  4758. :p.
  4759. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4760. .br
  4761. :font facename='System VIO' size=14x8.mod-file-sys:font facename=default size=0x0.
  4762. :p.
  4763.  
  4764. A function modifies the file system but does not list fileSystem in its
  4765. modifies clause&per.  
  4766. :p.
  4767.  
  4768. :hp2.Global Variables:hp1. :ehp1.:ehp2.(:link reftype=hd res=7.Section 4&per.2:elink.):hp1.
  4769. :ehp1.
  4770. :p.
  4771. :hp1.:ehp1.Errors involving the use and modification of global and file static
  4772. variables are reported depending on flag settings, annotations where the global
  4773. variable is declared, and whether or not the function where the global is used
  4774. was declared with a globals clause&per.
  4775. :p.
  4776. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++++:font facename=default size=0x0.
  4777. .br
  4778. :font facename='System VIO' size=14x8.globs:font facename=default size=0x0.
  4779. :p.
  4780. Undocumented use of a checked global variable in a function with a globals
  4781. list&per.
  4782. :p.
  4783. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++++:font facename=default size=0x0.
  4784. .br
  4785. :font facename='System VIO' size=14x8.globuse:font facename=default size=0x0.
  4786. :p.
  4787. A global listed in the globals list is not used in the implementation&per.
  4788. :p.
  4789. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4790. .br
  4791. :font facename='System VIO' size=14x8.globnoglobs:font facename=default size=0x0.
  4792. :p.
  4793. Use of a checked global in a function with no globals list&per.
  4794. :p.
  4795. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4796. .br
  4797. :font facename='System VIO' size=14x8.internalglobs:font facename=default size=0x0.
  4798. :p.
  4799. Undocumented use of internal state (should have :font facename='System VIO' size=14x8.globals internalState:font facename=default size=0x0.)&per.
  4800. :p.
  4801. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4802. .br
  4803. :font facename='System VIO' size=14x8.internalglobsnoglobs:font facename=default size=0x0.
  4804. :p.
  4805.         Use of internal state in function with no globals list&per.
  4806. :p.
  4807. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4808. .br
  4809. :font facename='System VIO' size=14x8.globstate:font facename=default size=0x0.
  4810. :p.
  4811. A function returns with global in inconsistent state (null or undefined)
  4812. :p.
  4813. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  4814. .br
  4815. :font facename='System VIO' size=14x8.allglobs:font facename=default size=0x0.
  4816. :p.
  4817. Report use and modification errors for globals not annotated with unchecked&per.
  4818. :p.
  4819. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++++:font facename=default size=0x0.
  4820. .br
  4821. :font facename='System VIO' size=14x8.checkstrictglobs:font facename=default size=0x0.
  4822. :p.
  4823. Report use and modification errors for checkedstrict globals&per.
  4824. :p.
  4825. :hp1.Modification of Global Variables:ehp1.
  4826. :p.
  4827. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4828. .br
  4829. :font facename='System VIO' size=14x8.modglobs:font facename=default size=0x0.
  4830. :p.
  4831. Undocumented modification of a checked global variable&per. 
  4832. :p.
  4833. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4834. .br
  4835. :font facename='System VIO' size=14x8.modglobsunchecked:font facename=default size=0x0.
  4836. :p.
  4837. Undocumented modification of an unchecked global variable&per.
  4838. :p.
  4839. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4840. .br
  4841. :font facename='System VIO' size=14x8.modglobsnomods:font facename=default size=0x0.
  4842. :p.
  4843. Undocumented modification of a checked global variable in a function with no
  4844. modifies clause&per. 
  4845. :p.
  4846. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4847. .br
  4848. :font facename='System VIO' size=14x8.modstrictglobsnomods:font facename=default size=0x0.
  4849. :p.
  4850. Undocumented modification of a checkedstrict global variable in a function
  4851. declared with no modifies clause&per.
  4852. :p.
  4853. :hp1.Globals Lists and Modifies Clauses:ehp1.
  4854. :p.
  4855. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4856. .br
  4857. :font facename='System VIO' size=14x8.warnmissingglobs:font facename=default size=0x0.
  4858. :p.
  4859. Global variable used in modifies clause is not listed in globals list&per.  (The
  4860. global is added to the globals list&per.)
  4861. :p.
  4862. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4863. .br
  4864. :font facename='System VIO' size=14x8.warnmissingglobsnoglobs:font facename=default size=0x0.
  4865. :p.
  4866. Global variable used in modifies clause of a function with no globals list&per.
  4867. :p.
  4868. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  4869. .br
  4870. :font facename='System VIO' size=14x8.globsimpmodsnothing:font facename=default size=0x0.
  4871. :p.
  4872. A function declared with a globals list but no modifies clause is assumed to
  4873. modify nothing&per.
  4874. :p.
  4875. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  4876. .br
  4877. :font facename='System VIO' size=14x8.modsimpnoglobs:font facename=default size=0x0.
  4878. :p.
  4879. A function declared with a modifies clause but no globals list is assumed to
  4880. use no globals&per.
  4881. :p.
  4882. :hp1.Implicit Checking Qualifiers:ehp1.
  4883. :p.
  4884. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  4885. .br
  4886. :font facename='System VIO' size=14x8.impcheckedglobs:font facename=default size=0x0.
  4887. :p.
  4888. Implicit checked qualifier on global variables with no checking annotation&per.
  4889. :p.
  4890. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  4891. .br
  4892. :font facename='System VIO' size=14x8.impcheckedstatics:font facename=default size=0x0.
  4893. :p.
  4894. Implicit checked qualifier file static scope variables with no checking
  4895. annotation&per. 
  4896. :p.
  4897. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  4898. .br
  4899. :font facename='System VIO' size=14x8.impcheckmodglobs:font facename=default size=0x0.
  4900. :p.
  4901. Implicit checkmod qualifier on global variables with no checking annotation&per.
  4902. :p.
  4903. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  4904. .br
  4905. :font facename='System VIO' size=14x8.impcheckmodstatics:font facename=default size=0x0.
  4906. :p.
  4907. Implicit checkmod qualifier file static scope variables with no checking
  4908. annotation&per.
  4909. :p.
  4910. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4911. .br
  4912. :font facename='System VIO' size=14x8.impcheckedstrictglobs:font facename=default size=0x0.
  4913. :p.
  4914. Implicit checked qualifier on global variables with no checking annotation&per.
  4915. :p.
  4916. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  4917. .br
  4918. :font facename='System VIO' size=14x8.impcheckedstrictstatics:font facename=default size=0x0.
  4919. :p.
  4920. Implicit checked qualifier file static scope variables with no checking
  4921. annotation&per.
  4922. :p.
  4923. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  4924. .br
  4925. :font facename='System VIO' size=14x8.impcheckmodinternals:font facename=default size=0x0.
  4926. :p.
  4927. Implicit checkmod qualifier on function scope static variables with no checking
  4928. annotation&per.
  4929. :p.
  4930. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4931. .br
  4932. :font facename='System VIO' size=14x8.impglobsweak:font facename=default size=0x0.
  4933. :p.
  4934. :hp1.Global Aliasing:ehp1.
  4935. :p.
  4936. :hp1.:ehp1.:link reftype=hd res=18.shortcut:elink.
  4937. .br
  4938. :font facename='System VIO' size=14x8.globalias:font facename=default size=0x0.
  4939. :p.
  4940. Function returns with global aliasing external state (sets
  4941. :link reftype=hd res=18.:font facename='System VIO' size=14x8.checkstrictglobalias:font facename=default size=0x0.:elink., :link reftype=hd res=18.:font facename='System VIO' size=14x8.checkedglobalias:font facename=default size=0x0.:elink., 
  4942. :link reftype=hd res=18.:font facename='System VIO' size=14x8.checkmodglobalias:font facename=default size=0x0.:elink. and
  4943. :link reftype=hd res=18.:font facename='System VIO' size=14x8.uncheckedglobalias:font facename=default size=0x0.:elink.)&per.
  4944. :p.
  4945. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4946. .br
  4947. :font facename='System VIO' size=14x8.checkstrictglobalias:font facename=default size=0x0.
  4948. :p.
  4949. Function returns with a checkstrict global aliasing external state&per.
  4950. :p.
  4951. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4952. .br
  4953. :font facename='System VIO' size=14x8.checkedglobalias:font facename=default size=0x0.
  4954. :p.
  4955. Function returns with a checked global aliasing external state&per.
  4956. :p.
  4957. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4958. .br
  4959. :font facename='System VIO' size=14x8.checkmodglobalias:font facename=default size=0x0.
  4960. :p.
  4961. Function returns with a checkmod global aliasing external state&per.
  4962. :p.
  4963. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  4964. .br
  4965. :font facename='System VIO' size=14x8.uncheckedglobalias:font facename=default size=0x0.
  4966. :p.
  4967. Function returns with an unchecked global aliasing external state&per.
  4968. :p.
  4969. :hp2.Declaration Consistency :ehp2.:hp1.(:link reftype=hd res=7.Section 4&per.3:elink.):ehp1.
  4970. :p.
  4971. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4972. .br
  4973. :font facename='System VIO' size=14x8.incondefs:font facename=default size=0x0.
  4974. :p.
  4975. Identifier redeclared or redefined with inconsistent type&per.
  4976. :p.
  4977. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4978. .br
  4979. :font facename='System VIO' size=14x8.incondefslib:font facename=default size=0x0.
  4980. :p.
  4981. Identifier defined in a library is redefined with inconsistent :font facename='System VIO' size=14x8.type:font facename=default size=0x0.
  4982. :p.
  4983. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  4984. .br
  4985. :font facename='System VIO' size=14x8.overload:font facename=default size=0x0.
  4986. :p.
  4987. Standard library function overloaded&per.
  4988. :p.
  4989. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  4990. .br
  4991. :font facename='System VIO' size=14x8.matchfields:font facename=default size=0x0.
  4992. :p.
  4993. A struct or enum type is redefined with inconsistent fields or members&per.
  4994. :p.
  4995. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  4996. .br
  4997. :link reftype=hd res=18.
  4998. :elink.
  4999. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  5000. :link reftype=hd res=1.
  5001. :elink.
  5002. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  5003. :link reftype=hd res=27.
  5004. :elink.
  5005. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  5006.  
  5007. :link reftype=hd res=2.David Evans:elink. 
  5008. .br
  5009. :link reftype=hd res=3.Systematic Program Development:elink.
  5010. .br
  5011. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  5012.  
  5013.  
  5014. :h4.Memory Management
  5015. :p.
  5016. :hp2.:hp1.Memory Management:ehp1.:ehp2.
  5017. :p.
  5018. :hp2.:hp1.:ehp1.:ehp2.Reporting of memory management errors is controlled by flags
  5019. setting checking and implicit annotations and code annotations&per.  
  5020. :p.
  5021. :hp2.Deallocation Errors :ehp2.(:link reftype=hd res=8.Section 5&per.2:elink.):hp2.:hp1.:ehp1.:ehp2.
  5022. :p.
  5023. :hp2.:hp1.:ehp1.:ehp2.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5024. .br
  5025. :font facename='System VIO' size=14x8.usereleased:font facename=default size=0x0.
  5026. :p.
  5027. Storage used after it may have been released&per.
  5028. :p.
  5029. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  5030. .br
  5031. :font facename='System VIO' size=14x8.strictusereleased:font facename=default size=0x0.
  5032. :p.
  5033. An array element used after it may have been released&per.
  5034. :p.
  5035. :hp2.Inconsistent Branches:ehp2.
  5036. :p.
  5037. :hp2.:ehp2.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5038. .br
  5039. :font facename='System VIO' size=14x8.branchstate:font facename=default size=0x0.
  5040. :p.
  5041. Storage has inconsistent states of alternate paths through a branch (e&per.g&per., it
  5042. is released in the true branch of an if-statement, but there is no else
  5043. branch&per.)
  5044. :p.
  5045. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  5046. .br
  5047. :font facename='System VIO' size=14x8.strictbranchstate:font facename=default size=0x0.
  5048. :p.
  5049. Storage through array fetch has inconsistent states of alternate paths through
  5050. a branch&per.  Since array elements are not checked accurately, this may lead to
  5051. spurious errors&per.
  5052. :p.
  5053. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  5054. .br
  5055. :font facename='System VIO' size=14x8.deparrays:font facename=default size=0x0.
  5056. :p.
  5057. Treat array elements as dependent storage&per.  Checking of array elements cannot
  5058. be done accurately by LCLint&per.  If deparrays is not set, array elements are
  5059. assumed to be independent, so code that releases the same element more than
  5060. once will produce no error&per.  If deparrays is set, array elements are assumed to
  5061. be dependent, so code that releases the same element more that once will
  5062. produce an error, but so will code that releases different elements correctly
  5063. will produce a spurious error&per.
  5064. :p.
  5065. :hp2.Memory Leaks:ehp2.
  5066. :p.
  5067. :hp2.:ehp2.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5068. .br
  5069. :font facename='System VIO' size=14x8.mustfree:font facename=default size=0x0.
  5070. :p.
  5071. Allocated storage was not released before return or scope exit  Errors are
  5072. reported for only, fresh or owned storage&per.
  5073. :p.
  5074. :p.
  5075. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5076. .br
  5077. :font facename='System VIO' size=14x8.compdestroy:font facename=default size=0x0.
  5078. :p.
  5079. All only references derivable from out only parameter of type void * must be
  5080. released&per.  (This is the type of the parameter to free, but may also be used for
  5081. user-defined deallocation functions&per.)
  5082. :p.
  5083. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  5084. .br
  5085. :font facename='System VIO' size=14x8.strictdestroy:font facename=default size=0x0.
  5086. :p.
  5087. Report complete destruction errors for array elements that may have been
  5088. released&per.  (If strictdestroy is not set, LCLint will assume that if any array
  5089. element was released, the entire array was correctly released&per.)
  5090. :p.
  5091. :p.
  5092. :hp2.Transfer Errors :ehp2.
  5093. :p.
  5094. :hp2.:ehp2.A transfer error is reported when storage is transferred (by an
  5095. assignment, passing a parameter, or returning) in a way that is inconsistent&per.
  5096. :p.
  5097. :link reftype=hd res=18.shortcut:elink.
  5098. .br
  5099. :font facename='System VIO' size=14x8.memtrans:font facename=default size=0x0.
  5100. :p.
  5101. Sets all memory transfer errors flags&per.
  5102. :p.
  5103. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5104. .br
  5105. :font facename='System VIO' size=14x8.onlytrans:font facename=default size=0x0.
  5106. :p.
  5107. Only storage transferred to non-only reference (memory leak)&per.
  5108. :p.
  5109. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5110. .br
  5111. :font facename='System VIO' size=14x8.ownedtrans:font facename=default size=0x0.
  5112. :p.
  5113. Owned storage transferred to non-owned reference (memory leak)&per.
  5114. :p.
  5115. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5116. .br
  5117. :font facename='System VIO' size=14x8.freshtrans:font facename=default size=0x0.
  5118. :p.
  5119. Newly-allocated storage transferred to non-only reference (memory leak)&per.
  5120. :p.
  5121. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5122. .br
  5123. :font facename='System VIO' size=14x8.sharedtrans:font facename=default size=0x0.
  5124. :p.
  5125. Shared storage transferred to non-shared reference&per.
  5126. :p.
  5127. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5128. .br
  5129. :font facename='System VIO' size=14x8.dependenttrans:font facename=default size=0x0.
  5130. :p.
  5131. Inconsistent dependent transfer&per. Dependent storage is transferred to a
  5132. non-dependent reference&per.
  5133. :p.
  5134. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5135. .br
  5136. :font facename='System VIO' size=14x8.temptrans:font facename=default size=0x0.
  5137. :p.
  5138. Temporary storage (associated with a temp formal parameter) is transferred to a
  5139. non-temporary reference&per.  The storage may be released or new aliases created&per.
  5140. :p.
  5141. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5142. .br
  5143. :font facename='System VIO' size=14x8.kepttrans:font facename=default size=0x0.
  5144. :p.
  5145. Kept storage transferred to non-temporary reference&per.
  5146. :p.
  5147. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5148. .br
  5149. :font facename='System VIO' size=14x8.keeptrans:font facename=default size=0x0.
  5150. :p.
  5151. Keep storage is transferred in a way that may add a new alias to it, or release
  5152. it&per.
  5153. :p.
  5154. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5155. .br
  5156. :font facename='System VIO' size=14x8.refcounttrans:font facename=default size=0x0.
  5157. :p.
  5158. Reference counted storage is transferred in an inconsistent way&per.
  5159. :p.
  5160. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5161. .br
  5162. :font facename='System VIO' size=14x8.newreftrans:font facename=default size=0x0.
  5163. :p.
  5164. A new reference transferred to a reference counted reference (reference count
  5165. is not set correctly)&per.
  5166. :p.
  5167. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5168. .br
  5169. :font facename='System VIO' size=14x8.immediatetrans:font facename=default size=0x0.
  5170. :p.
  5171. An immediate address (result of &.) is transferred inconsistently&per.
  5172. :p.
  5173. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5174. .br
  5175. :font facename='System VIO' size=14x8.statictrans:font facename=default size=0x0.
  5176. :p.
  5177. Static storage is transferred in an inconsistent way&per.
  5178. :p.
  5179. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5180. .br
  5181. :font facename='System VIO' size=14x8.exposetrans:font facename=default size=0x0.
  5182. :p.
  5183. Inconsistent exposure transfer&per. Exposed storage is transferred to a
  5184. non-exposed, non-observer reference&per.
  5185. :p.
  5186. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5187. .br
  5188. :font facename='System VIO' size=14x8.observertrans:font facename=default size=0x0.
  5189. :p.
  5190. Inconsistent observer transfer&per. Observer storage is transferred to a
  5191. non-observer reference&per.
  5192. :p.
  5193. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5194. .br
  5195. :font facename='System VIO' size=14x8.unqualifiedtrans:font facename=default size=0x0.
  5196. :p.
  5197. Unqualified storage is transferred in an inconsistent way&per.
  5198. :p.
  5199.  
  5200. :hp1.Initializers:ehp1.
  5201. :p.
  5202. :link reftype=hd res=18.m&colon.:elink. :font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  5203. .br
  5204.  
  5205. :font facename='System VIO' size=14x8.onlyunqglobaltrans:font facename=default size=0x0.
  5206. :p.
  5207.  
  5208. Only storage transferred to an unqualified global or static reference&per.
  5209. This may lead to a memory leak, since the new reference is not
  5210. necessarily released&per.
  5211. :p.
  5212. :link reftype=hd res=18.m&colon.:elink. :font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  5213. .br
  5214.  
  5215. :font facename='System VIO' size=14x8.staticinittrans:font facename=default size=0x0.
  5216. :p.
  5217. Static storage is used as an initial value in an inconsistent way&per.
  5218. :p.
  5219. :link reftype=hd res=18.m&colon.:elink. :font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  5220. .br
  5221.  
  5222. :font facename='System VIO' size=14x8.unqualifiedinittrans:font facename=default size=0x0.
  5223. :p.
  5224. Unqualified storage is used as an initial value in an inconsistent way&per.
  5225. :p.
  5226.  
  5227. :hp1.Derived Storage:ehp1.
  5228. :p.
  5229. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5230. .br
  5231. :font facename='System VIO' size=14x8.compmempass:font facename=default size=0x0.
  5232. :p.
  5233. Storage derivable from a parameter does not match the alias kind expected for
  5234. the formal parameter&per.
  5235. :p.
  5236. :hp1.Stack References:ehp1.
  5237. :p.
  5238. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++++:font facename=default size=0x0.
  5239. .br
  5240. :font facename='System VIO' size=14x8.stackref:font facename=default size=0x0.
  5241. :p.
  5242. A stack reference is pointed to by an external reference when the function
  5243. returns&per.  Since the call frame will be destroyed when the function returns the
  5244. return value will point to dead storage&per. (:link reftype=hd res=8.Section 5&per.2&per.6:elink.)
  5245. :p.
  5246. :hp2.Implicit Memory Annotations :ehp2.(:link reftype=hd res=8.Section 5&per.3:elink.):hp1.:ehp1.
  5247. :p.
  5248. :hp1.:ehp1.
  5249. :p.
  5250. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  5251. .br
  5252. :font facename='System VIO' size=14x8.globimponly:font facename=default size=0x0.
  5253. :p.
  5254. Assume unannotated global storage is only&per.
  5255. :p.
  5256. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  5257. .br
  5258. :font facename='System VIO' size=14x8.paramimptemp:font facename=default size=0x0.
  5259. :p.
  5260. Assume unannotated parameter is temp&per.
  5261. :p.
  5262. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  5263. .br
  5264. :font facename='System VIO' size=14x8.retimponly:font facename=default size=0x0.
  5265. :p.
  5266. Assume unannotated returned storage is only&per.
  5267. :p.
  5268. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  5269. .br
  5270. :font facename='System VIO' size=14x8.structimponly:font facename=default size=0x0.
  5271. :p.
  5272. Assume unannotated structure or union field is only&per.
  5273. :p.
  5274. :link reftype=hd res=18.shortcut:elink.
  5275. .br
  5276. :font facename='System VIO' size=14x8.codeimponly:font facename=default size=0x0.
  5277. :p.
  5278. Sets globimponly, retimponly and structimponly&per.
  5279. :p.
  5280. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5281. .br
  5282. :font facename='System VIO' size=14x8.memimp:font facename=default size=0x0.
  5283. :p.
  5284. Report memory errors for unqualified storage&per.
  5285. :p.
  5286. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  5287. .br
  5288. :font facename='System VIO' size=14x8.passunknown:font facename=default size=0x0.
  5289. :p.
  5290. Passing a value as an unannotated parameter clears its annotation&per.  This will
  5291. prevent many spurious errors from being report for unannotated programs, but
  5292. eliminates the possibility of detecting many errors&per.
  5293. :p.
  5294. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  5295. .br
  5296. :link reftype=hd res=18.
  5297. :elink.
  5298. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  5299. :link reftype=hd res=1.
  5300. :elink.
  5301. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  5302. :link reftype=hd res=27.
  5303. :elink.
  5304. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  5305.  
  5306. :link reftype=hd res=2.David Evans:elink. 
  5307. .br
  5308. :link reftype=hd res=3.Systematic Program Development:elink.
  5309. .br
  5310. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  5311.  
  5312. :h4.Sharing
  5313. :p.
  5314. :hp2.:hp1.Sharing:ehp1.:ehp2.
  5315. :p.
  5316. :hp2.:hp1.:ehp1.Aliasing :ehp2.(:link reftype=hd res=9.Section 6:elink.):hp1.:ehp1.
  5317. :p.
  5318. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5319. .br
  5320. :font facename='System VIO' size=14x8.aliasunique:font facename=default size=0x0.
  5321. :p.
  5322. A actual parameter that is passed as a unique formal parameter is aliased by
  5323. another parameter or global variable&per.
  5324. :p.
  5325. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5326. .br
  5327. :font facename='System VIO' size=14x8.mayaliasunique:font facename=default size=0x0.
  5328. :p.
  5329. A actual parameter that is passed as a unique formal parameter may be aliased
  5330. by another parameter or global variable&per.
  5331. :p.
  5332. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5333. .br
  5334. :font facename='System VIO' size=14x8.mustnotalias:font facename=default size=0x0.
  5335. :p.
  5336. An alias has been added to a temp-qualifier parameter or global that is visible
  5337. externally when the function returns&per.  
  5338. :p.
  5339. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  5340. .br
  5341. :font facename='System VIO' size=14x8.retalias:font facename=default size=0x0.
  5342. :p.
  5343. A function returns an alias to parameter or global&per.
  5344. :p.
  5345. :hp2.Exposure :ehp2.(:link reftype=hd res=9.Section 6&per.2:elink.):hp2.:ehp2.
  5346. :p.
  5347. :hp2.:ehp2.:link reftype=hd res=18.shortcut:elink.
  5348. .br
  5349. :font facename='System VIO' size=14x8.repexpose:font facename=default size=0x0.
  5350. :p.
  5351. The internal representation of an abstract type is visible to the caller&per.  This
  5352. means clients may have access to a pointer into the abstract representation&per.
  5353. (Sets assignexpose, retexpose, and castexpose&per.)
  5354. :p.
  5355. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  5356. .br
  5357. :font facename='System VIO' size=14x8.assignexpose:font facename=default size=0x0.
  5358. :p.
  5359. Abstract representation is exposed by an assignment or passed parameter&per.
  5360. :p.
  5361. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  5362. .br
  5363. :font facename='System VIO' size=14x8.castexpose:font facename=default size=0x0.
  5364. :p.
  5365. Abstract representation is exposed through a cast&per.
  5366. :p.
  5367. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  5368. .br
  5369. :font facename='System VIO' size=14x8.retexpose:font facename=default size=0x0.
  5370. :p.
  5371. Abstract representation is exposed by a return value&per.
  5372. :p.
  5373. :hp1.Observer Modifications:ehp1.
  5374. :p.
  5375. :hp1.:ehp1.
  5376. :p.
  5377. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  5378. .br
  5379. :font facename='System VIO' size=14x8.modobserver:font facename=default size=0x0.
  5380. :p.
  5381. Possible modification of observer storage&per.
  5382. :p.
  5383. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  5384. .br
  5385. :font facename='System VIO' size=14x8.modobserveruncon:font facename=default size=0x0.
  5386. :p.
  5387. Storage declared with observer may be modified through a call to an
  5388. unconstrained function&per.
  5389. :p.
  5390. :hp1.String Literals  :ehp1.(:link reftype=hd res=9.Section 6&per.2&per.1:elink.):hp1. :ehp1.
  5391. :p.
  5392. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  5393. .br
  5394. :font facename='System VIO' size=14x8.readonlytrans:font facename=default size=0x0.
  5395. :p.
  5396. Report memory transfer errors for initializations to read-only string literals
  5397. :p.
  5398. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5399. .br
  5400. :font facename='System VIO' size=14x8.readonlystrings:font facename=default size=0x0.
  5401. :p.
  5402. String literals are read-only (ANSI semantics)&per.  An error is reported if a
  5403. string literal may be modified or released&per.
  5404. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  5405. .br
  5406. :link reftype=hd res=18.
  5407. :elink.
  5408. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  5409. :link reftype=hd res=1.
  5410. :elink.
  5411. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  5412. :link reftype=hd res=27.
  5413. :elink.
  5414. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  5415.  
  5416. :link reftype=hd res=2.David Evans:elink. 
  5417. .br
  5418. :link reftype=hd res=3.Systematic Program Development:elink.
  5419. .br
  5420. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  5421.  
  5422. :h4.Use Before Definition
  5423. :p.
  5424. :hp2.:hp1.Use Before Definition :ehp1.:ehp2.(:link reftype=hd res=10.Section 7&per.1:elink.):hp1.:ehp1.
  5425. :p.
  5426. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5427. .br
  5428. :font facename='System VIO' size=14x8.usedef:font facename=default size=0x0.
  5429. :p.
  5430. The value of a location that may not be initialized on some execution path is
  5431. used&per.
  5432. :p.
  5433. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  5434. .br
  5435. :font facename='System VIO' size=14x8.impouts:font facename=default size=0x0.
  5436. :p.
  5437. Allow unannotated pointer parameters to functions to be implicit out
  5438. parameters&per.
  5439. :p.
  5440. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5441. .br
  5442. :font facename='System VIO' size=14x8.compdef:font facename=default size=0x0.
  5443. :p.
  5444. Storage derivable from a parameter, return value or global variable is not
  5445. completely defined&per.
  5446. :p.
  5447. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5448. .br
  5449. :font facename='System VIO' size=14x8.uniondef:font facename=default size=0x0.
  5450. :p.
  5451. No field of a union is defined&per.  (No error is reported if at least one union
  5452. field is defined&per.)
  5453. :p.
  5454. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5455. .br
  5456. :font facename='System VIO' size=14x8.mustdefine:font facename=default size=0x0.
  5457. :p.
  5458. Parameter declared with out is not defined before return or scope exit&per.
  5459. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  5460. .br
  5461. :link reftype=hd res=18.
  5462. :elink.
  5463. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  5464. :link reftype=hd res=1.
  5465. :elink.
  5466. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  5467. :link reftype=hd res=27.
  5468. :elink.
  5469. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  5470.  
  5471. :link reftype=hd res=2.David Evans:elink. 
  5472. .br
  5473. :link reftype=hd res=3.Systematic Program Development:elink.
  5474. .br
  5475. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  5476.  
  5477.  
  5478. :h4.Null Pointers
  5479. :p.
  5480. :hp2.:hp1.Null Pointers :ehp1.:ehp2.(:link reftype=hd res=10.Section 7&per.2:elink.):hp2.:hp1.:ehp1.:ehp2.
  5481. :p.
  5482.  
  5483. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5484. .br
  5485. :font facename='System VIO' size=14x8.nullderef:font facename=default size=0x0.
  5486. :p.
  5487. A possibly null pointer may be dereferenced&per.
  5488. :p.
  5489. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5490. .br
  5491. :font facename='System VIO' size=14x8.nullpass:font facename=default size=0x0.
  5492. :p.
  5493. A possibly null pointer is passed as a parameter not annotated with :font facename='System VIO' size=14x8.null:font facename=default size=0x0.&per.
  5494.  
  5495. :p.
  5496. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5497. .br
  5498. :font facename='System VIO' size=14x8.nullret:font facename=default size=0x0.
  5499. :p.
  5500. A possibly null pointer is return as a result not annotated with
  5501. :font facename='System VIO' size=14x8.null:font facename=default size=0x0.&per.
  5502. :p.
  5503. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5504. .br
  5505. :font facename='System VIO' size=14x8.nullstate:font facename=default size=0x0.
  5506. :p.
  5507. Possibly null pointer reachable from a reference with no null
  5508. annotation&per.
  5509. :p.
  5510. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5511. .br
  5512. :font facename='System VIO' size=14x8.nullassign:font facename=default size=0x0.
  5513. :p.
  5514. :p.
  5515. Inconsistent assignment or initialization involving null pointer&per.
  5516. :p.
  5517. :link reftype=hd res=18.shortcut:elink.
  5518. .br
  5519. :font facename='System VIO' size=14x8.null:font facename=default size=0x0.
  5520. :p.
  5521. Sets all null checking flags&per.
  5522.  
  5523. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  5524. .br
  5525. :link reftype=hd res=18.
  5526. :elink.
  5527. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  5528. :link reftype=hd res=1.
  5529. :elink.
  5530. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  5531. :link reftype=hd res=27.
  5532. :elink.
  5533. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  5534.  
  5535. :link reftype=hd res=2.David Evans:elink. 
  5536. .br
  5537. :link reftype=hd res=3.Systematic Program Development:elink.
  5538. .br
  5539. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  5540.  
  5541. :h4.Macros
  5542. :p.
  5543. :hp2.:hp1.Macros :ehp1.:ehp2.(:link reftype=hd res=11.Section 8:elink.):hp2.:hp1.:ehp1.:ehp2.
  5544. :p.
  5545. :hp2.:hp1.:ehp1.:ehp2.These flags control expansion and checking of macro definitions
  5546. and invocations&per.
  5547. :p.
  5548. :hp2.Macro Expansion:ehp2.
  5549. :p.
  5550. :hp2.:ehp2.These flags control which macros are checked as functions or constants,
  5551. and which are expanded in the pre-processing phase&per.  Macros preceded by
  5552. :font facename='System VIO' size=14x8./*@notfunction@*/:font facename=default size=0x0. are never expanded regardless of these flag settings&per.  These
  5553. flags may be used in source-file control comments&per.
  5554. :p.
  5555. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5556. .br
  5557. :font facename='System VIO' size=14x8.fcnmacros:font facename=default size=0x0.
  5558. :p.
  5559. Macros defined with parameter lists are not expanded and are checked as
  5560. functions&per.
  5561. :p.
  5562. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5563. .br
  5564. :font facename='System VIO' size=14x8.constmacros:font facename=default size=0x0.
  5565. :p.
  5566. Macros defined without parameter lists are not expanded and are checked as
  5567. constants&per.
  5568. :p.
  5569. :link reftype=hd res=18.shortcut:elink.
  5570. .br
  5571. :font facename='System VIO' size=14x8.allmacros:font facename=default size=0x0.
  5572. :p.
  5573. Sets allfcnmacros and allconstmacros&per.
  5574. :p.
  5575. :p.
  5576.  
  5577. :p.
  5578. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5579. .br
  5580. :font facename='System VIO' size=14x8.libmacros:font facename=default size=0x0.
  5581. :p.
  5582. Macros defining identifiers declared in a loaded library are not expanded and
  5583. are checked according to the library information&per.       
  5584. :p.
  5585. :hp2.Macro Definitions:ehp2.
  5586. :p.
  5587. :hp2.:ehp2.These flags control what errors are reported in macro definitions&per.
  5588. :p.
  5589. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5590. .br
  5591. :font facename='System VIO' size=14x8.macrostmt:font facename=default size=0x0.
  5592. :p.
  5593. Macro definition is not syntactically equivalent to function&per.  This means if
  5594. the macro is used as a statement (e&per.g&per., :font facename='System VIO' size=14x8.if (test) macro();:font facename=default size=0x0.) unexpected behavior
  5595. may result&per.  One fix is to surround the macro body with :font facename='System VIO' size=14x8.do { &per.&per.&per.; } while
  5596. (FALSE):font facename=default size=0x0.&per. 
  5597. :p.
  5598. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5599. .br
  5600. :font facename='System VIO' size=14x8.macroparams:font facename=default size=0x0.
  5601. :p.
  5602. A macro parameter is not used exactly once in all possible invocations of the
  5603. macro&per.
  5604. :p.
  5605. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5606. .br
  5607. :font facename='System VIO' size=14x8.macroassign:font facename=default size=0x0.
  5608. :p.
  5609. A macro parameter is used as the left side of an assignment expression&per.
  5610. :p.
  5611. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5612. .br
  5613. :font facename='System VIO' size=14x8.macroparens:font facename=default size=0x0.
  5614. :p.
  5615. A macro parameter is used without parentheses (in potentially dangerous
  5616. context)&per.
  5617. :p.
  5618. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  5619. .br
  5620. :font facename='System VIO' size=14x8.macroempty:font facename=default size=0x0.
  5621. :p.
  5622. Macro definition of a function is empty&per.   
  5623. :p.
  5624. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5625. .br
  5626. :font facename='System VIO' size=14x8.macroredef:font facename=default size=0x0.
  5627. :p.
  5628. Macro is redefined&per.  There is another macro defined with the same name&per.
  5629. :p.
  5630. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5631. .br
  5632. macrounrecog 
  5633. :p.
  5634. An unrecognized identifier appears in a macro definition&per.  Since the identifier
  5635. may be defined where the macro is used, this could be okay, but LCLint will not
  5636. be able to check the unrecognized identifier appropriately&per.
  5637. :p.
  5638. :hp1.Corresponding Declarations:ehp1.
  5639. :p.
  5640. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++++:font facename=default size=0x0.
  5641. .br
  5642. :font facename='System VIO' size=14x8.macromatchname:font facename=default size=0x0.
  5643. :p.
  5644. A iter or constant macro is defined using a different name from the one used in
  5645. the previous syntactic comment&per.
  5646. :p.
  5647. :link reftype=hd res=18.shortcut:elink.
  5648. .br
  5649. :font facename='System VIO' size=14x8.macrodecl:font facename=default size=0x0.
  5650. :p.
  5651. A macro definition has no corresponding declaration&per.  (Sets macrofcndecl and
  5652. macroconstdecl&per.)
  5653. :p.
  5654. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5655. .br
  5656. :font facename='System VIO' size=14x8.macrofcndecl:font facename=default size=0x0.
  5657. :p.
  5658. Macro definition with parameter list has no corresponding function prototype&per.
  5659. Without a prototype, the types of the macro result and parameters is unknown&per.
  5660. :p.
  5661. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5662. .br
  5663. :font facename='System VIO' size=14x8.macroconstdecl:font facename=default size=0x0.
  5664. :p.
  5665. A macro definition without parameter list has no corresponding constant
  5666. declaration&per.    
  5667. :p.
  5668. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  5669. .br
  5670. :font facename='System VIO' size=14x8.nextlinemacros:font facename=default size=0x0.
  5671. :p.
  5672. A constant or iter declaration is not immediately followed by a macro
  5673. definition&per.
  5674. :p.
  5675. :hp2.Side-Effect Free Parameters :ehp2.(:link reftype=hd res=11.Section 8&per.2&per.1:elink.):hp1.:ehp1.
  5676. :p.
  5677. :hp1.:ehp1.These flags control error reporting for parameters with inconsistent
  5678. side-effects in invocations of checked function macros and function calls&per.
  5679. :p.
  5680. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  5681. .br
  5682. :font facename='System VIO' size=14x8.sefparams:font facename=default size=0x0.
  5683. :p.
  5684. An actual parameter with side-effects is passed as a formal parameter declared
  5685. with :font facename='System VIO' size=14x8.sef:font facename=default size=0x0.&per.
  5686. :p.
  5687. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  5688. .br
  5689. :font facename='System VIO' size=14x8.sefuncon:font facename=default size=0x0.
  5690. :p.
  5691. An actual parameter involving a call to an unconstrained function (declared
  5692. without modifies clause) that may modify anything is passed as a :font facename='System VIO' size=14x8.sef:font facename=default size=0x0. parameter&per.
  5693. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  5694. .br
  5695. :link reftype=hd res=18.
  5696. :elink.
  5697. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  5698. :link reftype=hd res=1.
  5699. :elink.
  5700. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  5701. :link reftype=hd res=27.
  5702. :elink.
  5703. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  5704.  
  5705. :link reftype=hd res=2.David Evans:elink. 
  5706. .br
  5707. :link reftype=hd res=3.Systematic Program Development:elink.
  5708. .br
  5709. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  5710.  
  5711. :h4.Iterators
  5712. :p.
  5713. :hp2.:hp1.Iterators:ehp1.:ehp2.
  5714. :p.
  5715. :hp2.:hp1.:ehp1.:ehp2.
  5716. :p.
  5717. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5718. .br
  5719. :font facename='System VIO' size=14x8.hasyield:font facename=default size=0x0.
  5720. :p.
  5721. An iterator has been declared with no parameters annotated with yield&per.
  5722. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  5723. .br
  5724. :link reftype=hd res=18.
  5725. :elink.
  5726. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  5727. :link reftype=hd res=1.
  5728. :elink.
  5729. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  5730. :link reftype=hd res=27.
  5731. :elink.
  5732. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  5733.  
  5734. :link reftype=hd res=2.David Evans:elink. 
  5735. .br
  5736. :link reftype=hd res=3.Systematic Program Development:elink.
  5737. .br
  5738. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  5739.  
  5740. :h4.Naming Conventions
  5741. :p.
  5742. :hp2.:hp1.Naming Conventions:ehp1.:ehp2.
  5743. :p.
  5744. :hp2.:hp1.:ehp1.:ehp2.
  5745. :p.
  5746. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  5747. .br
  5748. :font facename='System VIO' size=14x8.namechecks:font facename=default size=0x0.
  5749. :p.
  5750.  Turns all name checking on or off without changing other settings&per.
  5751. :p.
  5752. :hp2.Type-Based Naming Conventions :ehp2.(:link reftype=hd res=12.Section 9&per.1:elink.):hp2.:ehp2.
  5753. :p.
  5754. :hp2.:ehp2.:hp1.Czech Naming Convention:ehp1.
  5755. :p.
  5756. :hp1.:ehp1.:link reftype=hd res=18.shortcut:elink.
  5757. .br
  5758. :font facename='System VIO' size=14x8.czech:font facename=default size=0x0.
  5759. :p.
  5760. Selects complete Czech naming convention (sets 
  5761. :link reftype=hd res=18.:font facename='System VIO' size=14x8.accessczech:font facename=default size=0x0.:elink., 
  5762. :link reftype=hd res=18.:font facename='System VIO' size=14x8.czechfcns:font facename=default size=0x0.:elink.,
  5763. :link reftype=hd res=18.:font facename='System VIO' size=14x8.czechvars:font facename=default size=0x0.:elink., 
  5764. :link reftype=hd res=18.:font facename='System VIO' size=14x8.czechconsts:font facename=default size=0x0.:elink., 
  5765. :link reftype=hd res=18.:font facename='System VIO' size=14x8.czechmacros:font facename=default size=0x0.:elink., and 
  5766. :link reftype=hd res=18.:font facename='System VIO' size=14x8.czechtypes:font facename=default size=0x0.:elink.)&per.
  5767. :p.
  5768. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  5769. .br
  5770. :font facename='System VIO' size=14x8.accessczech:font facename=default size=0x0.
  5771. :p.
  5772. Allow access to abstract types following Czech naming convention&per.  The
  5773. representation of an abstract type named :hp1.t:ehp1. is accessible in the
  5774. definition of a function or constant named :hp1.t_name:ehp1.&per.
  5775. :p.
  5776. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5777. .br
  5778. :font facename='System VIO' size=14x8.czechfcns:font facename=default size=0x0.
  5779. :p.
  5780. Function or iterator name is not consistent with Czech naming convention&per.
  5781. :p.
  5782. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5783. .br
  5784. :font facename='System VIO' size=14x8.czechvars:font facename=default size=0x0.
  5785. :p.
  5786.  Variable name is not consistent with Czech naming convention&per.
  5787. :p.
  5788. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5789. .br
  5790. :font facename='System VIO' size=14x8.czechmacros:font facename=default size=0x0.
  5791. :p.
  5792.  Expanded macro name is not consistent with Czech naming convention&per.
  5793. :p.
  5794. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5795. .br
  5796. :font facename='System VIO' size=14x8.czechconsts:font facename=default size=0x0.
  5797. :p.
  5798. Constant name is not consistent with Czech naming convention&per.
  5799. :p.
  5800. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5801. .br
  5802. :font facename='System VIO' size=14x8.czechtypes:font facename=default size=0x0.
  5803. :p.
  5804.  Type name is not consistent with Czech naming convention&per.  Czech type names
  5805. must not use the underscore character&per.
  5806. :p.
  5807. :hp1.Slovak Naming Convention:ehp1.
  5808. :p.
  5809. :hp1.:ehp1.:link reftype=hd res=18.shortcut:elink.
  5810. .br
  5811. :font facename='System VIO' size=14x8.slovak:font facename=default size=0x0.
  5812. :p.
  5813. Selects complete Slovak naming convention (sets 
  5814. :link reftype=hd res=18.:font facename='System VIO' size=14x8.accessslovak:font facename=default size=0x0.:elink., 
  5815. :link reftype=hd res=18.:font facename='System VIO' size=14x8.slovakfcns:font facename=default size=0x0.:elink., 
  5816. :link reftype=hd res=18.:font facename='System VIO' size=14x8.slovakvars:font facename=default size=0x0.:elink., 
  5817. :link reftype=hd res=18.:font facename='System VIO' size=14x8.slovakconsts:font facename=default size=0x0.:elink., 
  5818. :link reftype=hd res=18.:font facename='System VIO' size=14x8.slovakmacros:font facename=default size=0x0.:elink.,  and 
  5819. :link reftype=hd res=18.:font facename='System VIO' size=14x8.slovaktypes:font facename=default size=0x0.:elink.)&per.
  5820. :p.
  5821. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5822. .br
  5823. :font facename='System VIO' size=14x8.accessslovak:font facename=default size=0x0.
  5824. :p.
  5825. Allow access to abstract types following Slovak naming convention&per. The
  5826. representation of an abstract type named :hp1.t:ehp1. is accessible in the
  5827. definition of a function or constant named :hp1.tName:ehp1.&per.
  5828. :p.
  5829. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5830. .br
  5831. :font facename='System VIO' size=14x8.slovakfcns:font facename=default size=0x0.
  5832. :p.
  5833. Function or iterator name is not consistent with Slovak naming convention&per.
  5834. :p.
  5835. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5836. .br
  5837. :font facename='System VIO' size=14x8.slovakmacros:font facename=default size=0x0.
  5838. :p.
  5839. Expanded macro name is not consistent with Slovak naming convention&per.
  5840. :p.
  5841. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5842. .br
  5843. :font facename='System VIO' size=14x8.slovakvars:font facename=default size=0x0.
  5844. :p.
  5845.  Variable name is not consistent with Slovak naming convention&per.
  5846. :p.
  5847. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5848. .br
  5849. :font facename='System VIO' size=14x8.slovakconsts:font facename=default size=0x0.
  5850. :p.
  5851.  Constant name is not consistent with Slovak naming convention&per.
  5852. :p.
  5853. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5854. .br
  5855. :font facename='System VIO' size=14x8.slovaktypes:font facename=default size=0x0.
  5856. :p.
  5857. Type name is not consistent with Slovak naming convention&per.  Slovak type names
  5858. may not include uppercase letters&per.
  5859. :p.
  5860. :p.
  5861. :p.
  5862. :p.
  5863. :hp1.Czechoslovak Naming Convention:ehp1.
  5864. :p.
  5865. :hp1.:ehp1.:link reftype=hd res=18.shortcut:elink.
  5866. .br
  5867. :font facename='System VIO' size=14x8.czechoslovak:font facename=default size=0x0.
  5868. :p.
  5869. Selects complete Czechoslovak naming convention (sets 
  5870. :font facename='System VIO' size=14x8.accessczechoslovak:font facename=default size=0x0.,
  5871. :link reftype=hd res=18.:font facename='System VIO' size=14x8.czechoslovakfcns:font facename=default size=0x0.:elink.,
  5872. :link reftype=hd res=18.:font facename='System VIO' size=14x8.czechoslovakvars:font facename=default size=0x0.:elink., 
  5873. :link reftype=hd res=18.:font facename='System VIO' size=14x8.czechoslovakconsts:font facename=default size=0x0.:elink., 
  5874. :link reftype=hd res=18.:font facename='System VIO' size=14x8.czechoslovakmacros:font facename=default size=0x0.:elink., and
  5875. :link reftype=hd res=18.:font facename='System VIO' size=14x8.czechoslovaktypes:font facename=default size=0x0.:elink.)&per.
  5876. :p.
  5877. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5878. .br
  5879. :font facename='System VIO' size=14x8.accessczechoslovak:font facename=default size=0x0.
  5880. :p.
  5881. Allow access to abstract types by Czechoslovak naming convention&per. The
  5882. representation of an abstract type named :hp1.t:ehp1. is accessible in the
  5883. definition of a function or constant named :hp1.t_name:ehp1. or :hp1.tName:ehp1.&per.
  5884. :p.
  5885. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5886. .br
  5887. :font facename='System VIO' size=14x8.czechoslovakfcns:font facename=default size=0x0.
  5888. :p.
  5889.  Function name is not consistent with Czechoslovak naming convention&per.
  5890. :p.
  5891. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5892. .br
  5893. :font facename='System VIO' size=14x8.czechoslovakmacros:font facename=default size=0x0.
  5894. :p.
  5895. Expanded macro name is not consistent with Czechoslovak naming convention&per.
  5896. :p.
  5897. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5898. .br
  5899. :font facename='System VIO' size=14x8.czechoslovakvars:font facename=default size=0x0.
  5900. :p.
  5901.  Variable name is not consistent with Czechoslovak naming convention&per.
  5902. :p.
  5903. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5904. .br
  5905. :font facename='System VIO' size=14x8.czechoslovakconsts:font facename=default size=0x0.
  5906. :p.
  5907.  Constant name is not consistent with Czechoslovak naming convention&per.
  5908. :p.
  5909. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5910. .br
  5911. :font facename='System VIO' size=14x8.czechoslovaktypes:font facename=default size=0x0.
  5912. :p.
  5913.  Type name is not consistent with Czechoslovak naming convention&per. Czechoslovak
  5914. type names may not include uppercase letters or the underscore character&per.
  5915. :p.
  5916. :hp2.Namespace Prefixes  :ehp2.(:link reftype=hd res=12.Section
  5917. 9&per.2:elink.)
  5918. :p.
  5919.  
  5920. :font facename='System VIO' size=14x8.macrovarprefix :font facename=default size=0x0.:hp1.<prefix string>:ehp1.
  5921. :p.
  5922. Set namespace prefix for variables declared in a macro body&per.  (Default is
  5923. m_&per.)
  5924. :p.
  5925. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  5926. .br
  5927. :font facename='System VIO' size=14x8.macrovarprefixexclude:font facename=default size=0x0.
  5928. :p.
  5929. A variable declared outside a macro body starts with the macrovarprefix&per.
  5930. :p.
  5931.  
  5932. :font facename='System VIO' size=14x8.tagprefix :font facename=default size=0x0.:hp1.<prefix string>:ehp1.
  5933. :p.
  5934. Set namespace prefix of struct, union or enum tag identifiers&per.
  5935. :p.
  5936. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5937. .br
  5938. :font facename='System VIO' size=14x8.tagprefixexclude:font facename=default size=0x0.
  5939. :p.
  5940.  An identifier that is not a tag starts with the tagprefix&per.
  5941. :p.
  5942.  
  5943. :font facename='System VIO' size=14x8.enumprefix :font facename=default size=0x0.:hp1.<prefix string>:ehp1.
  5944. :p.
  5945. Set namespace prefix for enum members&per.
  5946. :p.
  5947. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5948. .br
  5949. :font facename='System VIO' size=14x8.enumprefixexclude:font facename=default size=0x0.
  5950. :p.
  5951.  An identifier that is not an enum member starts with the enumprefix&per.
  5952. :p.
  5953.  
  5954. :font facename='System VIO' size=14x8.filestaticprefix :font facename=default size=0x0.:hp1.<prefix string>:ehp1.
  5955. :p.
  5956. Set namespace prefix for file static declarations&per.
  5957. :p.
  5958. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5959. .br
  5960. :font facename='System VIO' size=14x8.filestaticprefixexclude:font facename=default size=0x0.
  5961. :p.
  5962. An identifier that is not file static starts with the filestaticprefix&per.
  5963. :p.
  5964.  
  5965. :font facename='System VIO' size=14x8.globalprefix :font facename=default size=0x0.:hp1.<prefix string>:ehp1.
  5966. :p.
  5967. Set namespace prefix for global variables&per.
  5968. :p.
  5969. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5970. .br
  5971. :font facename='System VIO' size=14x8.globalprefixexclude:font facename=default size=0x0.
  5972. :p.
  5973. An identifier that is not a global variable starts with the globalprefix&per.
  5974. :p.
  5975.  
  5976. :font facename='System VIO' size=14x8.typeprefix :font facename=default size=0x0.:hp1.<prefix string>:ehp1.
  5977. :p.
  5978. Set namespace prefix for user-defined types&per.
  5979. :p.
  5980. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5981. .br
  5982. :font facename='System VIO' size=14x8.typeprefixexclude:font facename=default size=0x0.
  5983. :p.
  5984. An identifier that is not a type name starts with the typeprefix&per.
  5985. :p.
  5986.  
  5987. :font facename='System VIO' size=14x8.externalprefix :font facename=default size=0x0.:hp1.<prefix string>:ehp1.
  5988. :p.
  5989. Set namespace prefix for external identifiers&per.
  5990. :p.
  5991. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  5992. .br
  5993. :font facename='System VIO' size=14x8.externalprefixexclude:font facename=default size=0x0.
  5994. :p.
  5995. An identifier that is not external starts with the externalprefix&per.
  5996. :p.
  5997.  
  5998. :font facename='System VIO' size=14x8.localprefix :font facename=default size=0x0.:hp1.<prefix string>:ehp1.
  5999. :p.
  6000. Set namespace prefix for local variables&per.
  6001. :p.
  6002. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6003. .br
  6004. :font facename='System VIO' size=14x8.localprefixexclude:font facename=default size=0x0.
  6005. :p.
  6006.  An identifier that is not a local variable starts with the localprefix&per.
  6007. :p.
  6008.  
  6009. :font facename='System VIO' size=14x8.uncheckedmacroprefix :font facename=default size=0x0.:hp1.<prefix string>:ehp1.
  6010. :p.
  6011. :hp1.:ehp1.Set namespace prefix for unchecked macros&per.
  6012. :p.
  6013. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6014. .br
  6015. :font facename='System VIO' size=14x8.uncheckedmacroprefixexclude:font facename=default size=0x0.
  6016. :p.
  6017. An identifier that is not the name of an unchecked macro starts with the
  6018. uncheckedmacroprefix&per.
  6019. :p.
  6020.  
  6021. :font facename='System VIO' size=14x8.constprefix :font facename=default size=0x0.:hp1.<prefix string>:ehp1.
  6022. :p.
  6023. Set namespace prefix for constants&per.
  6024. :p.
  6025. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6026. .br
  6027. :font facename='System VIO' size=14x8.constprefixexclude:font facename=default size=0x0.
  6028. :p.
  6029. An identifier that is not a constant starts with the constantprefix&per.
  6030. :p.
  6031.  
  6032. :font facename='System VIO' size=14x8.iterprefix :font facename=default size=0x0.:hp1.<prefix string>:ehp1.
  6033. :p.
  6034. Set namespace prefix for iterators&per.
  6035. :p.
  6036. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6037. .br
  6038. :font facename='System VIO' size=14x8.iterprefixexclude:font facename=default size=0x0.
  6039. :p.
  6040. An identifier that is not a iter starts with the iterprefix&per.
  6041. :p.
  6042.  
  6043.  
  6044. :font facename='System VIO' size=14x8.proto-param-prefix :font facename=default size=0x0.:hp1.<prefix string>:ehp1.
  6045. :p.
  6046. Set namespace prefix for parameters in function prototypes&per.
  6047. :p.
  6048.  
  6049. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6050. .br
  6051. :font facename='System VIO' size=14x8.proto-param-prefix-exclude:font facename=default size=0x0.
  6052. :p.
  6053. An identifier that is not a parameter in a function prototype starts with the 
  6054. protoprarmprefix&per. 
  6055. :p.
  6056.  
  6057. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  6058. .br
  6059.  
  6060. :font facename='System VIO' size=14x8.proto-param-name:font facename=default size=0x0.
  6061. :p.
  6062. A parameter in a function prototype has a name (can interfere with macro
  6063. definitions)&per. 
  6064. :p.
  6065.  
  6066. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6067. .br
  6068.  
  6069. :font facename='System VIO' size=14x8.proto-param-match:font facename=default size=0x0.
  6070. :p.
  6071.  
  6072. The name of a parameter in a function definition does not match the
  6073. corresponding name of the parameter in a function prototype (after
  6074. removing the protoparamprefix)&per.
  6075. :p.
  6076.  
  6077. :hp2.Naming Restrictions  :ehp2.(:link reftype=hd res=12.Section 9&per.3:elink.):hp1.:ehp1.
  6078. :p.
  6079. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6080. .br
  6081. :font facename='System VIO' size=14x8.shadow:font facename=default size=0x0.
  6082. :p.
  6083. Declaration reuses name visible in outer scope&per.
  6084. :p.
  6085. :hp1.Reserved Names:ehp1.
  6086. :p.
  6087. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  6088. .br
  6089. :font facename='System VIO' size=14x8.ansi-reserved:font facename=default size=0x0.
  6090. :p.
  6091. External name conflicts with name reserved for the compiler or standard
  6092. library&per.
  6093. :p.
  6094. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6095. .br
  6096. :font facename='System VIO' size=14x8.ansi-reserved-internal:font facename=default size=0x0.
  6097. :p.
  6098.  Internal name conflicts with name reserved for the compiler or standard
  6099. library&per.
  6100. :p.
  6101.  
  6102. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  6103. .br
  6104. :font facename='System VIO' size=14x8.cpp-names:font facename=default size=0x0.
  6105. :p.
  6106. Internal or external name conflicts with a C++ reserved word&per.  (Will
  6107. cause problems if program is compiled with a C++ compiler&per.)
  6108. :p.
  6109.  
  6110. :hp1.Distinct External Names:ehp1.
  6111. :p.
  6112. :hp1.:ehp1.
  6113. :p.
  6114. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6115. .br
  6116. :font facename='System VIO' size=14x8.distinct-external-names:font facename=default size=0x0.
  6117. :p.
  6118. An external name is not distinguishable from another external name using
  6119. externalnamelen significant characters&per.
  6120. :p.
  6121.  
  6122. :font facename='System VIO' size=14x8.external-name-len:font facename=default size=0x0.:hp1.<number>:ehp1.
  6123. :p.
  6124. Sets the number of significant characters in an external name (ANSI default
  6125. minimum is 6)&per.  Sets :link reftype=hd res=18.:font facename='System VIO' size=14x8.+distinctexternalnames:font facename=default size=0x0.:elink.&per.
  6126. :p.
  6127. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6128. .br
  6129. :font facename='System VIO' size=14x8.external-name-case-insensitive:font facename=default size=0x0.
  6130. :p.
  6131. Make alphabetic case insignificant in external names&per.  According to ANSI
  6132. standard, case need not be significant in an external name&per.  If
  6133. :link reftype=hd res=18.:font facename='System VIO' size=14x8.+distinctexternalnames:font facename=default size=0x0.:elink. is not set, sets :link reftype=hd res=18.:font facename='System VIO' size=14x8.+distinctexternalnames
  6134. :font facename=default size=0x0.:elink. with unlimited
  6135. external name length&per.
  6136. :p.
  6137. :hp1.Distinct Internal Names:ehp1.
  6138. :p.
  6139. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  6140. .br
  6141. :font facename='System VIO' size=14x8.distinct-internal-names:font facename=default size=0x0.
  6142. :p.
  6143. An internal name is not distinguishable from another internal name using
  6144. internalnamelen significant characters&per.   (Also effected by
  6145. internalnamecaseinsensitive and internalnamelookalike&per.)
  6146. :p.
  6147.  
  6148. :font facename='System VIO' size=14x8.internal-name-len :font facename=default size=0x0.:hp1.<number>:ehp1.
  6149. :p.
  6150. Set the number of significant characters in an internal name&per. Sets
  6151. :link reftype=hd res=18.:font facename='System VIO' size=14x8.+distinctinternalnames:font facename=default size=0x0.:elink.&per.
  6152. :p.
  6153. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6154. .br
  6155. :font facename='System VIO' size=14x8.internal-name-case-insensitive:font facename=default size=0x0.
  6156. :p.
  6157. Set whether case is significant an internal names (-internalnamecaseinsensitive
  6158. means case is significant)&per.  If :link reftype=hd res=18.:font facename='System VIO' size=14x8.+distinctinternalnames:font facename=default size=0x0.:elink. is not set, sets
  6159. :link reftype=hd res=18.:font facename='System VIO' size=14x8.+distinct-internal-names:font facename=default size=0x0.:elink. with unlimited internal name length&per.
  6160. :p.
  6161.  
  6162. :p.
  6163. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6164. .br
  6165. :font facename='System VIO' size=14x8.internalnamelookalike:font facename=default size=0x0.
  6166. :p.
  6167.  Set whether similar looking characters (e&per.g&per., "1" and "l") match in internal
  6168. names&per.
  6169. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  6170. .br
  6171. :link reftype=hd res=18.
  6172. :elink.
  6173. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  6174. :link reftype=hd res=1.
  6175. :elink.
  6176. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  6177. :link reftype=hd res=27.
  6178. :elink.
  6179. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  6180.  
  6181. :link reftype=hd res=2.David Evans:elink. 
  6182. .br
  6183. :link reftype=hd res=3.Systematic Program Development:elink.
  6184. .br
  6185. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  6186.  
  6187. :h4.Other Checks
  6188. :p.
  6189. :hp2.:hp1.Other Checks:ehp1.:ehp2.
  6190. :p.
  6191. :hp2.:hp1.:ehp1.Undefined Evaluation Order  :ehp2.(:link reftype=hd res=13.Section 10&per.1:elink.)
  6192. :p.
  6193. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6194. .br
  6195. evalorder 
  6196. :p.
  6197. Behavior of an expression is undefined because sub-expressions contain
  6198. interfering side effects that may be evaluated in any order&per.
  6199. :p.
  6200. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6201. .br
  6202. :font facename='System VIO' size=14x8.evalorderuncon:font facename=default size=0x0.
  6203. :p.
  6204. An expression may be undefined because a sub-expression contains a call to an
  6205. unconstrained function (no modifies clause) that may modify something that may
  6206. be modified or used by another sub-expression&per.
  6207. :p.
  6208. :hp2.Problematic Control Structures :ehp2.(:link reftype=hd res=13.Section 10&per.2:elink.):hp1.:ehp1.
  6209. :p.
  6210. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6211. .br
  6212.  
  6213. :font facename='System VIO' size=14x8.infloops:font facename=default size=0x0.
  6214. :p.
  6215. Likely infinite loop is detected (:link reftype=hd res=13.Section 10&per.2&per.1:elink.)&per.
  6216. :p.
  6217. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  6218. .br
  6219.  
  6220. :font facename='System VIO' size=14x8.infloopsuncon:font facename=default size=0x0.
  6221. :p.
  6222. Likely infinite loop is detected&per.  Loop test or body calls an unconstrained
  6223. function, that may produce an undetected modification&per.
  6224. :p.
  6225. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6226. .br
  6227. :font facename='System VIO' size=14x8.elseifcomplete:font facename=default size=0x0.
  6228. :p.
  6229. There is no final else following an else if construct (:link reftype=hd res=13.Section 10&per.2&per.5:elink.)&per.
  6230. :hp2.:hp1.:ehp1.:ehp2.
  6231. :p.
  6232. :hp2.:hp1.:ehp1.:ehp2.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6233. .br
  6234. :font facename='System VIO' size=14x8.casebreak:font facename=default size=0x0.
  6235. :p.
  6236. These is a non-empty case in a switch not followed by a break (Section
  6237. 10&per.2&per.2)&per.:hp1.:ehp1.
  6238. :p.
  6239. :hp1.:ehp1.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6240. .br
  6241. :font facename='System VIO' size=14x8.misscase:font facename=default size=0x0.
  6242. :p.
  6243. A switch on an enum type is missing a case for a member of the enumerator&per.
  6244. :p.
  6245. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  6246. .br
  6247. :font facename='System VIO' size=14x8.loopexec:font facename=default size=0x0.
  6248. :p.
  6249. Assume all loops execute at least once&per.  This effects use-before-definition and
  6250. memory checking&per.  It should probably not be used globally, but may be used
  6251. surrounding a particular loop that is known to always execute to prevent
  6252. spurious messages&per.
  6253. :p.
  6254. :hp2.Deep Break  :ehp2.(:link reftype=hd res=13.Section 10&per.2&per.3:elink.):hp2.:ehp2.
  6255. :p.
  6256. :hp2.:ehp2.:link reftype=hd res=18.shortcut:elink.
  6257. .br
  6258. :font facename='System VIO' size=14x8.deepbreak:font facename=default size=0x0.
  6259. :p.
  6260. Report errors for break statements inside a nested while, for or switch&per.  (Sets
  6261. all nested break and continue flags&per.)
  6262. :p.
  6263. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  6264. .br
  6265. :font facename='System VIO' size=14x8.looploopbreak:font facename=default size=0x0.
  6266. :p.
  6267. There is a break inside a while, for or iterator loop that is inside a while,
  6268. for or iterator loop&per. Mark with :font facename='System VIO' size=14x8./*@innerbreak@*/:font facename=default size=0x0. to suppress the message&per.
  6269. :p.
  6270. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  6271. .br
  6272. :font facename='System VIO' size=14x8.switchloopbreak:font facename=default size=0x0.
  6273. :p.
  6274. There is a break inside a while, for or iterator loop that is inside a switch
  6275. statement&per.  Mark with :font facename='System VIO' size=14x8./*@loopbreak@*/:font facename=default size=0x0.&per.
  6276. :p.
  6277. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6278. .br
  6279. :font facename='System VIO' size=14x8.loopswitchbreak:font facename=default size=0x0.
  6280. :p.
  6281. There is a break inside a switch statement that is inside a while, for or
  6282. iterator loop&per.  Mark with :font facename='System VIO' size=14x8./*@switchbreak@*/:font facename=default size=0x0.&per.
  6283. :p.
  6284. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6285. .br
  6286. :font facename='System VIO' size=14x8.switchswitchbreak:font facename=default size=0x0.
  6287. :p.
  6288. There is a break inside a switch statement that is inside another switch
  6289. statement&per.  Mark with  :font facename='System VIO' size=14x8./*@innerbreak@*/:font facename=default size=0x0.&per.
  6290. :p.
  6291. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6292. .br
  6293. :font facename='System VIO' size=14x8.looploopcontinue:font facename=default size=0x0.
  6294. :p.
  6295. There is a continue inside a while, for or iterator loop that is inside a
  6296. while, for or iterator loop&per.  Mark with :font facename='System VIO' size=14x8./*@innercontinue@*/:font facename=default size=0x0.&per.
  6297. :p.
  6298. :hp2.Loop and if Bodies  :ehp2.(:link reftype=hd res=13.Section 10&per.2&per.4:elink.):hp2.:hp1.:ehp1.:ehp2.
  6299. :p.
  6300. :hp2.:hp1.:ehp1.:ehp2.:link reftype=hd res=18.shortcut:elink.
  6301. .br
  6302. :font facename='System VIO' size=14x8.allempty:font facename=default size=0x0.
  6303. :p.
  6304. An if, while or for statement has no body (sets 
  6305. :link reftype=hd res=18.:font facename='System VIO' size=14x8.ifempty:font facename=default size=0x0.:elink., 
  6306. :link reftype=hd res=18.:font facename='System VIO' size=14x8.whileempty:font facename=default size=0x0.:elink. and
  6307. :link reftype=hd res=18.:font facename='System VIO' size=14x8.forempty:font facename=default size=0x0.:elink.&per.)
  6308. :p.
  6309. :link reftype=hd res=18.shortcut:elink.
  6310. .br
  6311. :font facename='System VIO' size=14x8.allblock:font facename=default size=0x0.
  6312. :p.
  6313. The body of an if, while or for statement is not a block (sets ifblock,
  6314. whileblock and forblock&per.)
  6315. :p.
  6316. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  6317. .br
  6318. :font facename='System VIO' size=14x8.whileempty:font facename=default size=0x0.
  6319. :p.
  6320. A while statement has no body&per.
  6321. :p.
  6322. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6323. .br
  6324. :font facename='System VIO' size=14x8.whileblock:font facename=default size=0x0.
  6325. :p.
  6326.  The body of a while statement is not a :font facename='System VIO' size=14x8.block:font facename=default size=0x0.
  6327. :p.
  6328. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6329. .br
  6330. :font facename='System VIO' size=14x8.forempty:font facename=default size=0x0.
  6331. :p.
  6332. A for statement has no body&per.
  6333. :p.
  6334. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6335. .br
  6336. :font facename='System VIO' size=14x8.forblock:font facename=default size=0x0.
  6337. :p.
  6338. The body of a for statement is not a block&per.
  6339. :p.
  6340. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++++:font facename=default size=0x0.
  6341. .br
  6342. :font facename='System VIO' size=14x8.ifempty:font facename=default size=0x0.
  6343. :p.
  6344. An if statement has no body&per.
  6345. :p.
  6346. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6347. .br
  6348. :font facename='System VIO' size=14x8.ifblock:font facename=default size=0x0.
  6349. :p.
  6350. The body of an if statement is not a block&per.
  6351. :p.
  6352. :hp2.Suspicious Statements  :ehp2.(:link reftype=hd res=13.Section 10&per.3:elink.):hp2.:ehp2.
  6353. :p.
  6354. :hp2.:ehp2.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6355. .br
  6356. :font facename='System VIO' size=14x8.unreachable:font facename=default size=0x0.
  6357. :p.
  6358. Code is not reached on any possible execution&per.
  6359. :p.
  6360. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6361. .br
  6362. :font facename='System VIO' size=14x8.noeffect:font facename=default size=0x0.
  6363. :p.
  6364. Statement has no effect&per.
  6365. :p.
  6366. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6367. .br
  6368. :font facename='System VIO' size=14x8.noeffectuncon:font facename=default size=0x0.
  6369. :p.
  6370. Statement involving call to unconstrained function may have no effect&per.
  6371. :p.
  6372. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6373. .br
  6374. :font facename='System VIO' size=14x8.noret:font facename=default size=0x0.
  6375. :p.
  6376. There is a path with no return in a function declared to return a non-void
  6377. value&per.
  6378. :p.
  6379. :hp2.Ignored Return Values  :ehp2.(:link reftype=hd res=13.Section 10&per.3&per.2:elink.):hp1.:ehp1.
  6380. :p.
  6381. :hp1.:ehp1.These flags control when errors are reported for function calls that do
  6382. not use the return value&per.  Casting the function call to void or declaring the
  6383. called function to return :font facename='System VIO' size=14x8./*@alt void@*/:font facename=default size=0x0.&per.
  6384. :p.
  6385. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6386. .br
  6387. :font facename='System VIO' size=14x8.retvalbool:font facename=default size=0x0.
  6388. :p.
  6389. Return value of type bool ignored&per. 
  6390. :p.
  6391. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6392. .br
  6393. :font facename='System VIO' size=14x8.retvalint:font facename=default size=0x0.
  6394. :p.
  6395. Return value of type int ignored&per. 
  6396. :p.
  6397. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++++:font facename=default size=0x0.
  6398. .br
  6399. :font facename='System VIO' size=14x8.retvalother:font facename=default size=0x0.
  6400. :p.
  6401. Return value of type other than bool or int ignored&per.
  6402. :p.
  6403. :link reftype=hd res=18.shortcut:elink.
  6404. .br
  6405. :font facename='System VIO' size=14x8.retval:font facename=default size=0x0.
  6406. :p.
  6407. Return value ignored  (Sets retvalbool, retvalint, retvalother&per.)
  6408. :p.
  6409. :hp2.Unused Declarations  :ehp2.(:link reftype=hd res=13.Section 10&per.4:elink.):hp2.:ehp2.
  6410. :p.
  6411. :hp2.:ehp2.These flags control when errors are reported for declarations that are
  6412. never used&per.  The unused annotation can be used to prevent unused errors from
  6413. being report for a particular declaration&per.
  6414. :p.
  6415. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6416. .br
  6417. :font facename='System VIO' size=14x8.topuse:font facename=default size=0x0.
  6418. :p.
  6419. A external declaration is not used in any file&per.
  6420. :p.
  6421. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6422. .br
  6423. :font facename='System VIO' size=14x8.constuse:font facename=default size=0x0.
  6424. :p.
  6425. Constant never used&per. 
  6426. :p.
  6427. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6428. .br
  6429. :font facename='System VIO' size=14x8.enummemuse:font facename=default size=0x0.
  6430. :p.
  6431. Member of enumerator never used&per. 
  6432. :p.
  6433. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++++:font facename=default size=0x0.
  6434. .br
  6435. :font facename='System VIO' size=14x8.varuse:font facename=default size=0x0.
  6436. :p.
  6437. Variable never used&per.
  6438. :p.
  6439. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6440. .br
  6441. :font facename='System VIO' size=14x8.paramuse:font facename=default size=0x0.
  6442. :p.
  6443. Function parameter never used&per.
  6444. :p.
  6445. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++++:font facename=default size=0x0.
  6446. .br
  6447. :font facename='System VIO' size=14x8.fcnuse:font facename=default size=0x0.
  6448. :p.
  6449. Function is never used&per.
  6450. :p.
  6451. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.++++:font facename=default size=0x0.
  6452. .br
  6453. :font facename='System VIO' size=14x8.typeuse:font facename=default size=0x0.
  6454. :p.
  6455. Defined type never used&per. 
  6456. :p.
  6457. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6458. .br
  6459. :font facename='System VIO' size=14x8.fielduse:font facename=default size=0x0.
  6460. :p.
  6461. Field of structure or union type is never used&per.
  6462. :p.
  6463. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6464. .br
  6465. :font facename='System VIO' size=14x8.unusedspecial:font facename=default size=0x0.
  6466. :p.
  6467. Declaration in a special file (corresponding to :font facename='System VIO' size=14x8.&per.l:font facename=default size=0x0. or
  6468. :font facename='System VIO' size=14x8.&per.y:font facename=default size=0x0. file) is unused&per.
  6469. :p. 
  6470. :hp2.Complete Programs  :ehp2.(:link reftype=hd res=13.Section 10&per.5:elink.):hp2.:ehp2.
  6471. :p.
  6472. :hp2.:ehp2.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  6473. .br
  6474. :font facename='System VIO' size=14x8.declundef:font facename=default size=0x0.
  6475. :p.
  6476. Function, variable, iterator or constant declared but never defined&per.
  6477. :p.
  6478. :link reftype=hd res=18.shortcut:elink.
  6479. .br
  6480. :font facename='System VIO' size=14x8.partial:font facename=default size=0x0.
  6481. :p.
  6482. Check as partial system (sets 
  6483. :link reftype=hd res=18.:font facename='System VIO' size=14x8.-declundef:font facename=default size=0x0.:elink., 
  6484. :link reftype=hd res=18.:font facename='System VIO' size=14x8.-exportlocal:font facename=default size=0x0.:elink. and prevents checking of
  6485. macros in headers without corresponding :font facename='System VIO' size=14x8.&per.c:font facename=default size=0x0. files&per.)
  6486. :p.
  6487. :hp2.Exports:ehp2.
  6488. :p.
  6489. :hp2.:ehp2.:link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6490. .br
  6491. :font facename='System VIO' size=14x8.export-local:font facename=default size=0x0.
  6492. :p.
  6493. A declaration is exported but not used outside this module&per.  (Declaration can
  6494. use the static qualifier&per.)
  6495. :p.
  6496. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  6497. .br
  6498. :font facename='System VIO' size=14x8.export-header:font facename=default size=0x0.
  6499. :p.
  6500. A declaration (other than a variable) is exported but does not appear in a
  6501. header file&per.
  6502. :p.
  6503. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  6504. .br
  6505. :font facename='System VIO' size=14x8.export-header-var:font facename=default size=0x0.
  6506. :p.
  6507. A variable declaration is exported but does not appear in a header file&per.
  6508. :p.
  6509. :hp2.Unrecognized Identifiers:ehp2.
  6510. :p.
  6511. :hp2.:ehp2.
  6512. :p.
  6513. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6514. .br
  6515. :font facename='System VIO' size=14x8.unrecog:font facename=default size=0x0.
  6516. :p.
  6517. An unrecognized identifier is used&per.
  6518. :p.
  6519. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6520. .br
  6521. :font facename='System VIO' size=14x8.sys-unrecog:font facename=default size=0x0.
  6522. :p.
  6523. Report unrecognized identifiers that start with the system prefix, :font facename='System VIO' size=14x8.__:font facename=default size=0x0. (two
  6524. underscores)&per.
  6525. :p.
  6526. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6527. .br
  6528. :font facename='System VIO' size=14x8.repeat-unrecog:font facename=default size=0x0.
  6529. :p.
  6530. Report multiple messages for unrecognized identifiers&per.  If repeatunrecog is not
  6531. set, an error is reported only the first time a particular unrecognized
  6532. identifier appears in the file&per.
  6533. :p.
  6534. :hp2.Multiple Definition and Declarations:ehp2.
  6535. :p.
  6536. :hp2.:ehp2.
  6537. :p.
  6538. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6539. .br
  6540. :font facename='System VIO' size=14x8.redef:font facename=default size=0x0.
  6541. :p.
  6542. A function or variable is defined more than once&per.
  6543. :p.
  6544. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  6545. .br
  6546. :font facename='System VIO' size=14x8.redecl:font facename=default size=0x0.
  6547. :p.
  6548. An identifier is declared more than once&per.
  6549. :p.
  6550. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6551. .br
  6552. :font facename='System VIO' size=14x8.nested-extern:font facename=default size=0x0.
  6553. :p.
  6554. An extern declaration is used inside a function body&per.
  6555. :p.
  6556.  
  6557. :hp2.ANSI C Conformance:ehp2.
  6558. :p.
  6559.  
  6560.  
  6561.  
  6562. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  6563. .br
  6564. :font facename='System VIO' size=14x8.noparams:font facename=default size=0x0.
  6565. :p.
  6566. A function is declared without a parameter list prototype&per. 
  6567. :p.
  6568. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6569. .br
  6570. :font facename='System VIO' size=14x8.oldstyle:font facename=default size=0x0.
  6571. :p.
  6572. Function definition is in old style syntax&per.  Standard prototype syntax is
  6573. preferred&per.
  6574. :p.
  6575. :p.
  6576. :p.
  6577. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6578. .br
  6579. :font facename='System VIO' size=14x8.exitarg:font facename=default size=0x0.
  6580. :p.
  6581. Argument to exit has implementation defined behavior&per.  The only valid arguments
  6582. to exit are EXIT_SUCCESS, EXIT_FAILURE and 0&per.  An error is reported if LCLint
  6583. can detect statically that the argument to exit is not one of these&per.
  6584. :p.
  6585. :hp2.Limits :ehp2.(:link reftype=hd res=13.Section 10&per.6:elink.):hp2.:ehp2.
  6586. :p.
  6587. :hp2.:ehp2.:link reftype=hd res=18.shortcut:elink.
  6588. .br
  6589. :font facename='System VIO' size=14x8.ansilimits:font facename=default size=0x0.
  6590. :p.
  6591. Check for violations of standard limits (Sets 
  6592. :link reftype=hd res=18.:font facename='System VIO' size=14x8.controlnestdepth:font facename=default size=0x0.:elink.,
  6593. :font facename='System VIO' size=14x8.stringliterallen:font facename=default size=0x0., 
  6594. :link reftype=hd res=18.:font facename='System VIO' size=14x8.includenest:font facename=default size=0x0.:elink., 
  6595. :link reftype=hd res=18.:font facename='System VIO' size=14x8.numstructfields:font facename=default size=0x0.:elink.,
  6596. and 
  6597. :link reftype=hd res=18.:font facename='System VIO' size=14x8.numenummembers:font facename=default size=0x0.:elink.)&per.
  6598. :p.
  6599. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6600. .br
  6601. :p.
  6602.  
  6603. :font facename='System VIO' size=14x8.controlnestdepth :font facename=default size=0x0.:hp1.<number>:ehp1.
  6604. :p.
  6605. Set maximum nesting depth of compound statements, iteration control structures,
  6606. and selection control structures (ANSI minimum is 15)&per.
  6607. :p.
  6608. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6609. .br
  6610.  
  6611. :font facename='System VIO' size=14x8.stringliterallen :font facename=default size=0x0.:hp1.<number>:ehp1.
  6612. :p.
  6613. Set maximum length of string literals (ANSI minimum is 509)&per.
  6614. :p.
  6615. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6616. .br
  6617.  
  6618. :font facename='System VIO' size=14x8.numstructfields :font facename=default size=0x0.:hp1.<number>:ehp1.
  6619. :p.
  6620. Set maximum number of fields in a struct or union (ANSI minimum is 127)&per.
  6621. :p.
  6622. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6623. .br
  6624.  
  6625. :font facename='System VIO' size=14x8.numenummembers :font facename=default size=0x0.:hp1.<number>:ehp1.
  6626. :p.
  6627. Set maximum number of members of an enum type (ANSI minimum is 127)&per.
  6628. :p.
  6629. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.--++:font facename=default size=0x0.
  6630. .br
  6631.  
  6632. :font facename='System VIO' size=14x8.includenest :font facename=default size=0x0.:hp1.<number>:ehp1.
  6633. :p.
  6634. Set maximum number of nested #include files (ANSI minimum is 8)&per.
  6635. :p.
  6636. :hp2.Header Inclusion :ehp2.(:link reftype=hd res=21.Apppendix F:elink.):hp1.:ehp1.
  6637. :p.
  6638.  
  6639. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6640. .br
  6641.  
  6642. :font facename='System VIO' size=14x8.skip-ansi-headers:font facename=default size=0x0.
  6643. :p.
  6644.  
  6645. Prevent inclusion of header files in a system directory with names that
  6646. match standard ANSI headers&per. The symbolic information in the standard
  6647. library is used instead&per.  In effect only if a library that includes the
  6648. ANSI library is used&per.  The ANSI headers are&colon. :font facename='System VIO' size=14x8.assert:font facename=default size=0x0.,
  6649. :font facename='System VIO' size=14x8.ctype:font facename=default size=0x0., :font facename='System VIO' size=14x8.errno:font facename=default size=0x0., :font facename='System VIO' size=14x8.float:font facename=default size=0x0., 
  6650. :font facename='System VIO' size=14x8.limits:font facename=default size=0x0.,
  6651. :font facename='System VIO' size=14x8.locale:font facename=default size=0x0., :font facename='System VIO' size=14x8.math:font facename=default size=0x0., :font facename='System VIO' size=14x8.setjmp:font facename=default size=0x0., 
  6652. :font facename='System VIO' size=14x8.signal:font facename=default size=0x0.,
  6653. :font facename='System VIO' size=14x8.stdarg:font facename=default size=0x0., :font facename='System VIO' size=14x8.stddef:font facename=default size=0x0., :font facename='System VIO' size=14x8.stdio:font facename=default size=0x0., 
  6654. :font facename='System VIO' size=14x8.stdlib:font facename=default size=0x0.,
  6655. :font facename='System VIO' size=14x8.strings:font facename=default size=0x0., :font facename='System VIO' size=14x8.string:font facename=default size=0x0., :font facename='System VIO' size=14x8.time:font facename=default size=0x0., and 
  6656. :font facename='System VIO' size=14x8.wchar:font facename=default size=0x0.&per.
  6657. :p.
  6658.  
  6659. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6660. .br
  6661.  
  6662. :font facename='System VIO' size=14x8.skip-posix-headers:font facename=default size=0x0.
  6663. :p.
  6664.  
  6665. Prevent inclusion of header files in a system directory with names that
  6666. match standard POSIX headers&per. The symbolic information in the standard
  6667. library is used instead&per.  In effect only if a library that includes the
  6668. POSIX library is used&per.  The POSIX headers are&colon. :font facename='System VIO' size=14x8.dirent:font facename=default size=0x0.,
  6669. :font facename='System VIO' size=14x8.fcntl:font facename=default size=0x0., :font facename='System VIO' size=14x8.grp:font facename=default size=0x0., :font facename='System VIO' size=14x8.pwd:font facename=default size=0x0., 
  6670. :font facename='System VIO' size=14x8.termios:font facename=default size=0x0.,
  6671. :font facename='System VIO' size=14x8.sys/stat:font facename=default size=0x0., :font facename='System VIO' size=14x8.sys/times:font facename=default size=0x0., :font facename='System VIO' size=14x8.sys/types:font facename=default size=0x0.,
  6672. :font facename='System VIO' size=14x8.sys/utsname:font facename=default size=0x0., :font facename='System VIO' size=14x8.sys/wait:font facename=default size=0x0., :font facename='System VIO' size=14x8.unistd:font facename=default size=0x0., and
  6673. :font facename='System VIO' size=14x8.utime:font facename=default size=0x0.&per.
  6674.  
  6675. :p.
  6676. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6677. .br
  6678.  
  6679. :font facename='System VIO' size=14x8.warn-posix-headers:font facename=default size=0x0.
  6680. :p.
  6681. Report use of a POSIX header when checking a program with a non-POSIX
  6682. library&per.
  6683. :p.
  6684. :font facename='System VIO' size=14x8.skipsysheaders:font facename=default size=0x0.
  6685. :p.
  6686. Do not include header files in system directories (as set by :font facename='System VIO' size=14x8.-sysdirs:font facename=default size=0x0.)
  6687. :p.
  6688. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6689. .br
  6690.  
  6691. :font facename='System VIO' size=14x8.sys-dir-expand-macros:font facename=default size=0x0.
  6692. :p.
  6693. Expand macros in system directories regardless of other settings, except
  6694. for macros corresponding to names defined in a load library&per. 
  6695. :p.
  6696. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  6697. .br
  6698. :font facename='System VIO' size=14x8.sys-dir-errors:font facename=default size=0x0.
  6699. :p.
  6700. Report errors in files in system directories (set by -systemdirs)&per.   
  6701. :p.
  6702.  
  6703. :font facename='System VIO' size=14x8.single-include:font facename=default size=0x0.
  6704. :p.
  6705. Optimize header inclusion to only include each header file once&per.
  6706. :p.
  6707. :font facename='System VIO' size=14x8.never-include:font facename=default size=0x0.
  6708. :p.
  6709. Use library information instead of including header files&per. 
  6710. :p.
  6711.  
  6712. :hp2.Comments:ehp2.
  6713. :p.
  6714. :hp2.:ehp2.These flags control how syntactic comments are interpreted (see
  6715. :link reftype=hd res=20.Apppendix E:elink.)&per.
  6716. :p.
  6717.  
  6718. :font facename='System VIO' size=14x8.commentchar :font facename=default size=0x0.:hp1.<char>:ehp1.
  6719. :p.
  6720. Set the marker character for syntactic comments&per.  Comments beginning with
  6721. /*:hp1.<char>:ehp1. are interpreted by LCLint&per.  Default&colon. :font facename='System VIO' size=14x8.@:font facename=default size=0x0.
  6722. :p.
  6723. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6724. .br
  6725. :font facename='System VIO' size=14x8.noaccess:font facename=default size=0x0.
  6726. :p.
  6727. Ignore access comments&per.
  6728. :p.
  6729. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6730. .br
  6731. :font facename='System VIO' size=14x8.nocomments:font facename=default size=0x0.
  6732. :p.
  6733. Ignore all stylized comments&per. 
  6734. :p.
  6735. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6736. .br
  6737. :font facename='System VIO' size=14x8.supcounts:font facename=default size=0x0.
  6738. :p.
  6739. Actual number of errors does not match number in :font facename='System VIO' size=14x8./*@i:font facename=default size=0x0.:hp1.<n>:ehp1.:font facename='System VIO' size=14x8.@*/:font facename=default size=0x0.
  6740. :p.
  6741. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6742. .br
  6743. :font facename='System VIO' size=14x8.lintcomments:font facename=default size=0x0.
  6744. :p.
  6745. Interpret traditional lint comments (:font facename='System VIO' size=14x8./*FALLTHROUGH*/:font facename=default size=0x0., :font facename='System VIO' size=14x8./*NOTREACHED*/:font facename=default size=0x0.,
  6746. :font facename='System VIO' size=14x8./*PRINTLIKE*/:font facename=default size=0x0.)&per.
  6747. :p.
  6748. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  6749. .br
  6750. :font facename='System VIO' size=14x8.warnlintcomments:font facename=default size=0x0.
  6751. :p.
  6752. Print a warning and suggest an alternative when a traditional lint comment is
  6753. used&per.   
  6754. :p.
  6755. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6756. .br
  6757.  
  6758. :font facename='System VIO' size=14x8.unrecogcomments:font facename=default size=0x0.
  6759. :p.
  6760. Stylized comment is unrecognized&per.
  6761. :p.
  6762. :hp2.Parsing:ehp2.
  6763. :p.
  6764. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6765. .br
  6766.  
  6767. :font facename='System VIO' size=14x8.continue-comment:font facename=default size=0x0.
  6768. :p.
  6769. A line continuation marker (:font facename='System VIO' size=14x8.\:font facename=default size=0x0.) appears inside a comment on the
  6770. same line as the comment close&per. Preprocessors should handle this correctly, but it causes problems for some preprocessors&per.
  6771.  
  6772. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6773. .br
  6774.  
  6775. :font facename='System VIO' size=14x8.nest-comment:font facename=default size=0x0.
  6776. :p.
  6777. A comment open sequence (:font facename='System VIO' size=14x8./*:font facename=default size=0x0.) appears inside a comment&per.  This usually
  6778. indicates that an earlier comment was not closed&per.
  6779. :p.
  6780.  
  6781.  
  6782. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6783. .br
  6784.  
  6785. :font facename='System VIO' size=14x8.duplicate-quals:font facename=default size=0x0.
  6786. :p.
  6787.  
  6788. Report duplicate type qualifiers (e&per.g&per., :font facename='System VIO' size=14x8.long long:font facename=default size=0x0.)&per.  Duplicate type
  6789. qualifiers not supported by ANSI, but some compilers (e&per.g&per., :font facename='System VIO' size=14x8.gcc:font facename=default size=0x0.) do
  6790. support duplicate qualifiers&per.
  6791.  
  6792. :p.
  6793. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6794. .br
  6795.  
  6796. :font facename='System VIO' size=14x8.gnu-extensions:font facename=default size=0x0.
  6797. :p.
  6798. Support some GNU (gcc) language extensions&per.
  6799. :p.
  6800.  
  6801. :hp2.Array Formal Parameters:ehp2.
  6802. :p.
  6803.  
  6804. These flags control reporting of common errors caused by confusion about
  6805. the semantics of array formal parameters&per.
  6806. :p.
  6807.  
  6808. :hp2.General Checks:ehp2.
  6809. :p.
  6810.  
  6811. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6812. .br
  6813. :font facename='System VIO' size=14x8.sizeof-formal-array:font facename=default size=0x0.
  6814. :p.
  6815. The sizeof operator is used on a parameter declared as an array&per.  (In
  6816. many instances this has unexpected behavior, since the result is the
  6817. size of a pointer to the element type, not the number of elements in the
  6818. array&per.)
  6819. :p.
  6820.  
  6821. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6822. .br
  6823. :font facename='System VIO' size=14x8.fixed-formal-array:font facename=default size=0x0.
  6824. :p.
  6825.  
  6826. An array formal parameter is declared with a fixed size (e&per.g&per., :font facename='System VIO' size=14x8.int
  6827. x[20]:font facename=default size=0x0.)&per.  This is likely to be confusing, since the size is ignored&per.
  6828.  
  6829. :p.
  6830.  
  6831. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6832. .br
  6833. :font facename='System VIO' size=14x8.formal-array:font facename=default size=0x0.
  6834. :p.
  6835. A formal parameter is declared as an array&per.  This is probably not a
  6836. problem, but can be confusing since it is treated as a pointer&per.
  6837. :p.
  6838.  
  6839. :hp2.:ehp2.These flags should probably not be set globally since the turn off
  6840. general checks that should always be done&per.  They may be used locally to
  6841. suppress spurious errors&per.
  6842. :p.
  6843. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6844. .br
  6845. :font facename='System VIO' size=14x8.abstract:font facename=default size=0x0.
  6846. :p.
  6847. A data abstraction barrier is violated&per.
  6848. :p.
  6849. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6850. .br
  6851. :font facename='System VIO' size=14x8.control:font facename=default size=0x0.
  6852. :p.
  6853. A control flow error is detected&per.
  6854. :p.
  6855. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6856. .br
  6857. :font facename='System VIO' size=14x8.syntax:font facename=default size=0x0.
  6858. :p.
  6859. Parse error&per.
  6860. :p.
  6861. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  6862. .br
  6863. :font facename='System VIO' size=14x8.trytorecover:font facename=default size=0x0.
  6864. :p.
  6865. Try to recover from a parse error&per.  If trytorecover is not set, LCLint will
  6866. abort checking after a parse error is detected&per.  If it is set, LCLint will
  6867. attempt to recover, but LCLint does performs only minimal error recovery&per. 
  6868. :p.
  6869. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  6870. .br
  6871. :font facename='System VIO' size=14x8.type:font facename=default size=0x0.
  6872. :p.
  6873. Type mismatch&per.
  6874. :p.
  6875. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  6876. .br
  6877. :link reftype=hd res=18.
  6878. :elink.
  6879. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=18.:eartlink.:link reftype=hd res=18.:elink.
  6880. :link reftype=hd res=1.
  6881. :elink.
  6882. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  6883. :link reftype=hd res=27.
  6884. :elink.
  6885. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  6886.  
  6887. :link reftype=hd res=2.David Evans:elink. 
  6888. .br
  6889. :link reftype=hd res=3.Systematic Program Development:elink.
  6890. .br
  6891. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  6892.  
  6893.  
  6894. :h3 res=1805.Flag Name Abbreviations
  6895. :p.
  6896. :hp2.Flag Name Abbreviations:ehp2.
  6897. :p.
  6898. :hp2.:ehp2.Within a flag name, abbreviations may be used&per. Table 2 shows the flag
  6899. name abbreviations&per.  The expanded and short forms are interchangeable in flag
  6900. names&per.  
  6901. :p.
  6902. For example, globsimpmodsnothing and globalsimpliesmodifiesnothing denote the
  6903. same flag&per.  Abbreviations in flag names allow pronounceable, descriptive names
  6904. to be used without making flag names excessively long (although one must admit
  6905. even globsimpmodsnothing is a bit of a mouthful&per.)
  6906. :p.
  6907.  
  6908. :table cols='38 38'.
  6909. :row.
  6910. :c.:hp2.Expanded Form:ehp2.:c.:hp2.Short Form:ehp2.
  6911.  
  6912. :row.
  6913. :c.constant :c.                       const        
  6914. :row.
  6915. :c.declaration  :c.                   decl               
  6916. :row.
  6917. :c.function                   :c.     fcn                
  6918. :row.
  6919. :c.global:c.                              glob               
  6920. :row.
  6921. :c.implicit, implied       :c.        imp                
  6922. :row.
  6923. :c.iterator                 :c.       iter      
  6924. :row.
  6925. :c.length                       :c.   len                
  6926. :row.
  6927. :c.modifies                :c.        mods           
  6928. :row.
  6929. :c.modify                    :c.      mod                
  6930. :row.
  6931. :c.memory                       :c.   mem                
  6932. :row.
  6933. :c.parameter                   :c.    param              
  6934. :row.
  6935. :c.pointer                     :c.    ptr                
  6936. :row.
  6937. :c.return                      :c.    ret                
  6938. :row.
  6939. :c.variable                     :c.   var                
  6940. :row.
  6941. :c.unconstrained, unconst      :c.    uncon              
  6942. :etable.
  6943.  
  6944.  
  6945.  
  6946. :hp2.Table 2&per.  Flag name abbreviations&per.:ehp2.
  6947.  
  6948. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  6949. .br
  6950. :link reftype=hd res=19.
  6951. :elink.
  6952. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=19.:eartlink.:link reftype=hd res=19.:elink.
  6953. :link reftype=hd res=1.
  6954. :elink.
  6955. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  6956. :link reftype=hd res=27.
  6957. :elink.
  6958. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  6959.  
  6960. :link reftype=hd res=2.David Evans:elink. 
  6961. .br
  6962. :link reftype=hd res=3.Systematic Program Development:elink.
  6963. .br
  6964. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  6965.  
  6966.  
  6967. .* Source filename: appD.html
  6968. :h2 res=19.LCLint User's Guide - Appendix D  Annotations
  6969. :font facename=default size=0x0.
  6970. :p.
  6971.  
  6972.  
  6973. .br
  6974. :font facename='Helv' size=20x12.
  6975. .br
  6976. Appendix D  Annotations:font facename=default size=0x0.
  6977. .br
  6978. .br
  6979. :p.
  6980. The
  6981. grammar below is the C syntax from [:link reftype=hd res=25.K&.R:elink.,A13] modified to show
  6982. the syntax of syntactic comments&per.  Only productions effected by LCLint
  6983. annotations are shown&per.  In the annotations, the :font facename='System VIO' size=14x8.@:font facename=default size=0x0. represents the comment marker
  6984. char, set by :font facename='System VIO' size=14x8.-commentchar:font facename=default size=0x0. (default is :font facename='System VIO' size=14x8.@:font facename=default size=0x0.)&per.
  6985. :p.
  6986. :hp2.:hp1.Functions:ehp1.:ehp2.
  6987. :p.
  6988. :hp2.:hp1.:ehp1.:ehp2.:hp1.direct-declarator&colon.:ehp1.
  6989. :p.
  6990. :cgraphic.
  6991.           direct-declarator (parameter-type-list_opt) globals_opt modifies_opt
  6992.         | direct-declarator (identifier-list_opt) globals_opt modifies_opt
  6993. :ecgraphic.
  6994. :hp1.:ehp1.
  6995. :p.
  6996. :hp1.globals:ehp1.:hp1.&colon. :ehp1.(:link reftype=hd res=7.Section
  6997. 4&per.2:elink.):hp1.:ehp1.
  6998. :p.
  6999. :cgraphic.
  7000.           /*@globals globitem,+ ;_opt @*/
  7001.         | /*@globals declaration-list_opt ;_opt @*/
  7002. :ecgraphic.
  7003. :hp1.globitem&colon. :ehp1.
  7004. :p.
  7005. :cgraphic.
  7006.            globannot* identifier
  7007.         |  internalState
  7008.         |  systemState
  7009. :ecgraphic.
  7010. :hp1.:ehp1.
  7011. :p.
  7012. :hp1.globannot&colon. :ehp1.:font facename='System VIO' size=14x8.undef | killed:font facename=default size=0x0.
  7013. :p.
  7014. :hp1.:ehp1.
  7015. :p.
  7016. :hp1.modifies&colon. :ehp1.(:link reftype=hd res=7.Section 4&per.1:elink.):hp1.:ehp1.
  7017. :p.
  7018. :cgraphic.
  7019.            /*@modifies moditem,+;_opt @*/       
  7020.          | /*@modifies nothing ;_opt @*/
  7021.          | /*@*/  (Abbreviation for no globals and modifies nothing&per.)
  7022. :ecgraphic.
  7023. :hp1.:ehp1.
  7024. :p.
  7025. :hp1.moditem&colon. :ehp1.
  7026. :p.
  7027. :cgraphic.
  7028.            expression   
  7029.          | internalState
  7030.          | systemState
  7031. :ecgraphic.
  7032. :p.
  7033. :hp2.:hp1.Iterators :ehp1.:ehp2.(:link reftype=hd res=11.Section 8&per.4:elink.):hp2.:hp1.:ehp1.:ehp2.
  7034. :p.
  7035. :hp2.:hp1.:ehp1.:ehp2.The globals and modifies clauses for an iterator are the same as
  7036. those for a function, except they are not enclosed by a comment, since the
  7037. iterator is already a comment&per.:hp1.:ehp1.
  7038. :p.
  7039. :hp1.direct-declarator&colon. :ehp1.
  7040. :p.
  7041. :cgraphic.
  7042.        /*@iter identifier (parameter-type-list_opt) globals_opt
  7043. modifies_opt @*/
  7044. :ecgraphic.
  7045. :p.
  7046. :hp2.:hp1.Constants :ehp1.:ehp2.(:link reftype=hd res=11.Section 8&per.1:elink.):hp2.:hp1.:ehp1.:ehp2.
  7047. :p.
  7048. :hp2.:hp1.:ehp1.:ehp2.:hp1.external-declaration&colon.:ehp1.
  7049. :p.
  7050. :cgraphic.
  7051.        /*@constant declaration ;_opt @*/
  7052. :ecgraphic.
  7053.  
  7054. :p.
  7055. :hp1.:hp2.Alternate Types :ehp2.:ehp1.(:link reftype=hd res=11.Section 8&per.2&per.2:elink.):hp1.:ehp1.
  7056. :p.
  7057. :hp1.:ehp1.Alternate types may be used in the type specification of parameters and
  7058. return values&per.
  7059. :p.
  7060. :hp1.extended-type:ehp1.:hp1.&colon. :ehp1.
  7061. :p.
  7062. :cgraphic.
  7063.         type-specifier alt-type_opt
  7064. :ecgraphic.
  7065. :hp1.:ehp1.
  7066. :p.
  7067. :hp1.alt-type:ehp1.:hp1.&colon. :ehp1.
  7068. :p.
  7069. :cgraphic.
  7070.         /*@alt basic-type,+ @*/
  7071. :ecgraphic.
  7072. :p.
  7073. :hp2.:hp1.Declarator Annotations:ehp1.:ehp2.
  7074. :p.
  7075. :hp2.:hp1.:ehp1.:ehp2.General annotations appear after :hp1.storage-class-specifier:ehp1.s
  7076. and before :hp1.type:ehp1.:hp1.-specifier:ehp1.s&per.  Multiple annotations may be used in
  7077. any order&per.  Here, annotations are without the surrounding comment&per.  In a
  7078. declaration, the annotation would be surrounded by :font facename='System VIO' size=14x8./*@:font facename=default size=0x0. and
  7079. :font facename='System VIO' size=14x8.@*/:font facename=default size=0x0.&per.  In a globals or modifies clause or iterator or constant
  7080. declaration, no surrounding comment would be used since they are within
  7081. a comment&per.
  7082. :p.
  7083. :hp2.Type Definitions  :ehp2.(:link reftype=hd res=6.Section 3:elink.):hp2.:ehp2.
  7084. :p.
  7085. :hp2.:ehp2.A type definition may use any either abstract or concrete, either
  7086. mutable or immutable, and refcounted&per.  Only a pointer to a struct may be
  7087. declared with refcounted&per.  Mutability annotations may not be used with concrete
  7088. types since concrete types inherit their mutability from the actual type&per.
  7089. :p.
  7090. :font facename='System VIO' size=14x8.abstract:font facename=default size=0x0.
  7091. :p.
  7092. Type is abstract (representation is hidden from clients)&per.
  7093. :p.
  7094. :font facename='System VIO' size=14x8.concrete:font facename=default size=0x0.
  7095. :p.
  7096. Type is concrete (representation is visible to clients)&per.
  7097. :p.
  7098. :font facename='System VIO' size=14x8.immutable:font facename=default size=0x0.
  7099. :p.
  7100. Instances of the type cannot change value&per.  (:link reftype=hd res=6.Section 3&per.2:elink.)
  7101. :p.
  7102. :font facename='System VIO' size=14x8.mutable:font facename=default size=0x0.
  7103. :p.
  7104. Instances of the type can change value&per.  (:link reftype=hd res=6.Section 3&per.2:elink.)
  7105. :p.
  7106. :font facename='System VIO' size=14x8.refcounted:font facename=default size=0x0.
  7107. :p.
  7108. Reference counted type&per.  (:link reftype=hd res=8.Section 5&per.4:elink.)
  7109. :p.
  7110. :hp2.Global Variables  :ehp2.(:link reftype=hd res=7.Section 4&per.2&per.1:elink.):hp2.:ehp2.
  7111. :p.
  7112. :hp2.:ehp2.One check annotation may be used on a global or file-static variable
  7113. declaration&per.
  7114. :p.
  7115. :font facename='System VIO' size=14x8.unchecked:font facename=default size=0x0.
  7116. :p.
  7117. Weakest checking for global use&per.
  7118. :p.
  7119. :font facename='System VIO' size=14x8.checkmod:font facename=default size=0x0.
  7120. :p.
  7121. Check modification by not use of global&per. 
  7122. :p.
  7123. :font facename='System VIO' size=14x8.checked:font facename=default size=0x0.
  7124. :p.
  7125. Check use and modification of global&per. 
  7126. :p.
  7127. :font facename='System VIO' size=14x8.checkedstrict:font facename=default size=0x0.
  7128. :p.
  7129. Check use of global, even in functions with no global list&per. 
  7130. :p.
  7131. :hp2.Memory Management  :ehp2.(:link reftype=hd res=8.Section 5:elink.):hp1.:ehp1.
  7132. :p.
  7133. :hp1.:ehp1.:font facename='System VIO' size=14x8.dependent:font facename=default size=0x0.
  7134. :p.
  7135. A reference to externally-owned storage&per.  (:link reftype=hd res=8.Section 5&per.2&per.2:elink.)
  7136. :p.
  7137. :font facename='System VIO' size=14x8.keep:font facename=default size=0x0.
  7138. :p.
  7139. A parameter that is kept by the called function&per.  The caller may use the
  7140. storage after the call, but the called function is responsible for making sure
  7141. it is deallocated&per.  (:link reftype=hd res=8.Section 5&per.2&per.4:elink.)
  7142. :p.
  7143. :font facename='System VIO' size=14x8.killref:font facename=default size=0x0.
  7144. :p.
  7145. A refcounted parameter&per.  This reference is killed by the call&per. (:link reftype=hd res=8.Section 5&per.4:elink.)
  7146. :p.
  7147. :font facename='System VIO' size=14x8.only:font facename=default size=0x0.
  7148. :p.
  7149. A unshared reference&per.  Associated memory must be released before reference is
  7150. lost&per.  (:link reftype=hd res=8.Section 5&per.2:elink.)
  7151. :p.
  7152. :font facename='System VIO' size=14x8.owned:font facename=default size=0x0.
  7153. :p.
  7154. Storage may be shared by dependent references, but associated memory must be
  7155. released before this reference is lost&per.  (:link reftype=hd res=8.Section 5&per.2&per.2:elink.)
  7156. :p.
  7157. :font facename='System VIO' size=14x8.shared:font facename=default size=0x0.
  7158. :p.
  7159. Shared reference that is never deallocated&per.  (:link reftype=hd res=8.Section 5&per.2&per.5:elink.)
  7160. :p.
  7161. :font facename='System VIO' size=14x8.temp:font facename=default size=0x0.
  7162. :p.
  7163. A temporary parameter&per.  May not be released, and new aliases to it may not be
  7164. created&per.  (:link reftype=hd res=8.Section 5&per.2&per.2:elink.)
  7165. :p.
  7166. :hp2.Aliasing  :ehp2.(:link reftype=hd res=9.Section 6:elink.):hp2.:hp1.:ehp1.:ehp2.
  7167. :p.
  7168. :hp2.:hp1.:ehp1.:ehp2.Both alias annotations may be used on a parameter
  7169. declaration&per.:hp1.:ehp1.
  7170. :p.
  7171. :hp1.:ehp1.:font facename='System VIO' size=14x8.unique:font facename=default size=0x0.
  7172. :p.
  7173. Parameter that may not be aliased by any other reference visible to the
  7174. function&per. (Section 6&per.1&per.1)
  7175. :p.
  7176. :font facename='System VIO' size=14x8.returned:font facename=default size=0x0.
  7177. :p.
  7178. Parameter that may be aliased by the return value&per.  (:link reftype=hd res=9.Section 6&per.1&per.2:elink.)
  7179. :p.
  7180. :hp2.Exposure  :ehp2.(:link reftype=hd res=9.Section 6&per.2:elink.):hp2.:ehp2.
  7181. :p.
  7182. :hp2.:ehp2.:font facename='System VIO' size=14x8.observer:font facename=default size=0x0.
  7183. :p.
  7184. Reference that cannot be modified&per.  (:link reftype=hd res=9.Section 6&per.2&per.1:elink.)
  7185. :p.
  7186. :font facename='System VIO' size=14x8.exposed:font facename=default size=0x0.
  7187. :p.
  7188. Exposed reference to storage in another object&per. (:link reftype=hd res=9.Section 6&per.2&per.1:elink.)
  7189. :p.
  7190. :hp2.Definition State  :ehp2.(:link reftype=hd res=10.Section 7&per.1:elink.)
  7191. :p.
  7192. :font facename='System VIO' size=14x8.out:font facename=default size=0x0.
  7193. :p.
  7194. Storage reachable from reference need not be defined&per.
  7195. :p.
  7196. :font facename='System VIO' size=14x8.in:font facename=default size=0x0.
  7197. :p.
  7198. All storage reachable from reference must be defined&per.
  7199. :p.
  7200. :font facename='System VIO' size=14x8.partial:font facename=default size=0x0.
  7201. :p.
  7202. Partially defined&per.  A structure may have undefined fields&per.  No errors reported
  7203. when fields are used&per.
  7204. :p.
  7205. :font facename='System VIO' size=14x8.reldef:font facename=default size=0x0.
  7206. :p.
  7207. Relax definition checking&per.  No errors when reference is not defined, or when it
  7208. is used&per.
  7209. :p.
  7210. :hp2.Global State  :ehp2.(:link reftype=hd res=10.Section 7&per.1&per.4:elink.):hp1.:ehp1.
  7211. :p.
  7212. :hp1.:ehp1.These annotations may only be used in globals lists&per.  Both annotations
  7213. may be used for the same variable, to mean the variable is undefined before and
  7214. after the call&per.
  7215. :p.
  7216. :p.
  7217. :font facename='System VIO' size=14x8.undef:font facename=default size=0x0.
  7218. :p.
  7219. Variable is undefined before the call&per.
  7220. :p.
  7221. :font facename='System VIO' size=14x8.killed:font facename=default size=0x0.
  7222. :p.
  7223. Variable is undefined after the call&per.
  7224. :p.
  7225. :hp2.Null State  :ehp2.(:link reftype=hd res=10.Section 7&per.2:elink.):hp1.:ehp1.
  7226. :p.
  7227. :hp1.:ehp1.:font facename='System VIO' size=14x8.null:font facename=default size=0x0.
  7228. :p.
  7229. Possibly null pointer&per.
  7230. :p.
  7231. notnull 
  7232. :p.
  7233. Non-null pointer&per.
  7234. :p.
  7235. :font facename='System VIO' size=14x8.relnull:font facename=default size=0x0.
  7236. :p.
  7237. Relax null checking&per.  No errors when NULL is assigned to it, or when it is used
  7238. as a non-null pointer&per.
  7239. :p.
  7240. :hp2.Null Predicates  :ehp2.(:link reftype=hd res=10.Section 7&per.2&per.1:elink.):hp2.:ehp2.
  7241. :p.
  7242. :hp2.:ehp2.A null predicate annotation may be used of the return value of a
  7243. function returning a boolean type, taking a possibly-null pointer for its first
  7244. argument&per.
  7245. :p.
  7246. :font facename='System VIO' size=14x8.truenull:font facename=default size=0x0.
  7247. :p.
  7248. If result is TRUE, first parameter is NULL&per.
  7249. :p.
  7250. :font facename='System VIO' size=14x8.falsenull:font facename=default size=0x0.
  7251. :p.
  7252. If result is TRUE, first parameter is not NULL&per.
  7253. :p.
  7254. :hp2.Execution  :ehp2.(:link reftype=hd res=10.Section 7&per.3:elink.):hp2.:ehp2.
  7255. :p.
  7256. :hp2.:ehp2.The :font facename='System VIO' size=14x8.exits:font facename=default size=0x0., :font facename='System VIO' size=14x8.mayexit:font facename=default size=0x0. and :font facename='System VIO' size=14x8.neverexits:font facename=default size=0x0.
  7257. annotations may be used on any function&per.  The :font facename='System VIO' size=14x8.trueexit:font facename=default size=0x0. and
  7258. :font facename='System VIO' size=14x8.falseexit:font facename=default size=0x0. annotations may only be used on functions whose first
  7259. argument is a boolean&per.  
  7260. :p. 
  7261. :font facename='System VIO' size=14x8.exits:font facename=default size=0x0.           
  7262. :p.
  7263. Function never returns&per.
  7264. :p.
  7265. :font facename='System VIO' size=14x8.mayexit:font facename=default size=0x0.         
  7266. :p.
  7267. Function may or may not return&per.
  7268. :p.
  7269. :font facename='System VIO' size=14x8.trueexit:font facename=default size=0x0.        
  7270. :p.
  7271. Function does not return if first parameter is TRUE&per.
  7272. :p.
  7273. :font facename='System VIO' size=14x8.falseexit:font facename=default size=0x0.       
  7274. :p.
  7275. Function does not return if first parameter if FALSE&per.
  7276. :p.
  7277. :font facename='System VIO' size=14x8.neverexit:font facename=default size=0x0.
  7278. :p.
  7279. Function always returns&per.
  7280. :p.
  7281. :hp2.Side-Effects  :ehp2.(:link reftype=hd res=11.Section 8&per.2&per.1:elink.):hp2.:ehp2.
  7282. :p.
  7283. :hp2.:ehp2.:font facename='System VIO' size=14x8.sef:font facename=default size=0x0.
  7284. :p.
  7285. Corresponding actual parameter has no side effects&per.
  7286. :p.
  7287. :hp2.Declaration:ehp2.
  7288. :p.
  7289. :hp2.:ehp2.These annotations can be used on a declaration to control unused or
  7290. undefined error reporting&per.:hp1.:ehp1.
  7291. :p.
  7292. :hp1.:ehp1.:font facename='System VIO' size=14x8.unused:font facename=default size=0x0.
  7293. :p.
  7294. Identifier need not be used (no unused errors reported&per.)  (:link reftype=hd res=13.Section 10&per.4:elink.)
  7295. :p.
  7296. :font facename='System VIO' size=14x8.external:font facename=default size=0x0.
  7297. :p.
  7298. Identifier is defined externally (no undefined error reported&per.) (:link reftype=hd res=13.Section 10&per.5:elink.)
  7299. :p.
  7300. :hp2.Case:ehp2.
  7301. :p.
  7302. :hp2.:ehp2.:font facename='System VIO' size=14x8.fallthrough:font facename=default size=0x0.
  7303. :p.
  7304. Fall-through case&per.  No message is reported if the previous case may
  7305. fall-through into the one immediately after the fallthrough&per.
  7306. :p.
  7307. :hp2.Break  :ehp2.(:link reftype=hd res=13.Section 10&per.2&per.3:elink.):hp2.:ehp2.
  7308. :p.
  7309. :hp2.:ehp2.These annotations are used before a break or continue statement&per.
  7310. :p.
  7311. :font facename='System VIO' size=14x8.innerbreak:font facename=default size=0x0.
  7312. :p.
  7313. Break is breaking an inner loop or switch&per.
  7314. :p.
  7315. :font facename='System VIO' size=14x8.loopbreak:font facename=default size=0x0.
  7316. :p.
  7317. Break is breaking a loop&per.
  7318. :p.
  7319. :font facename='System VIO' size=14x8.switchbreak:font facename=default size=0x0.
  7320. :p.
  7321. Break is breaking a switch&per.
  7322. :p.
  7323. :font facename='System VIO' size=14x8.innercontinue:font facename=default size=0x0.
  7324. :p.
  7325. :hp1.:ehp1.Continue is continuing an inner loop&per.
  7326. :p.
  7327. :hp2.Unreachable Code:ehp2.
  7328. :p.
  7329. :hp2.:ehp2.This annotation is used before a statement to prevent unreachable code
  7330. errors&per.
  7331. :p.
  7332. :font facename='System VIO' size=14x8.notreached:font facename=default size=0x0.
  7333. :p.
  7334. Statement may be unreachable&per.
  7335. :p.
  7336. :hp2.Special Functions :ehp2.(:link reftype=hd res=20.Apppendix E:elink.)
  7337. :p.
  7338. These annotations are used immediately before a function declaration&per.
  7339. :p.
  7340. :font facename='System VIO' size=14x8.printflike:font facename=default size=0x0.
  7341. :p.
  7342. Check variable arguments like printf library function&per.   
  7343. :p.
  7344. :font facename='System VIO' size=14x8.scanflike:font facename=default size=0x0.
  7345. :p.
  7346. Check variable arguments like scanf library function&per.
  7347.  
  7348.  
  7349.  
  7350. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  7351. .br
  7352. :link reftype=hd res=20.
  7353. :elink.
  7354. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=20.:eartlink.:link reftype=hd res=20.:elink.
  7355. :link reftype=hd res=1.
  7356. :elink.
  7357. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  7358. :link reftype=hd res=27.
  7359. :elink.
  7360. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  7361.  
  7362. :link reftype=hd res=2.David Evans:elink. 
  7363. .br
  7364. :link reftype=hd res=3.Systematic Program Development:elink.
  7365. .br
  7366. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  7367.  
  7368.  
  7369. .* Source filename: appE.html
  7370. :h2 res=20.LCLint User's Guide - Appendix E  Control Comments
  7371. :font facename=default size=0x0.
  7372. :p.
  7373.  
  7374.  
  7375. .br
  7376. :font facename='Helv' size=20x12.
  7377. .br
  7378. Appendix E  Control Comments:font facename=default size=0x0.
  7379. .br
  7380. .br
  7381.  
  7382.  
  7383. :p.
  7384. :hp2.:hp1.Error Suppression:ehp1.:ehp2.
  7385. :p.
  7386. :hp2.:hp1.:ehp1.:ehp2.Several comments are provided for suppressing messages&per.  In
  7387. general, it is usually better to use specific flags to suppress a particular
  7388. error permanently, but the general error suppression flags may be more
  7389. convenient for quickly suppressing messages for code that will be corrected or
  7390. documented later&per.
  7391. :p.
  7392. :font facename='System VIO' size=14x8.ignore:font facename=default size=0x0.
  7393. .br
  7394. :font facename='System VIO' size=14x8.end:font facename=default size=0x0.
  7395. :p.
  7396. No errors will be reported in code regions between :font facename='System VIO' size=14x8./*@ignore@*/:font facename=default size=0x0.
  7397. and :font facename='System VIO' size=14x8./*@end@*/:font facename=default size=0x0.&per. These comments can be used to easily suppress an
  7398. unlimited number of messages, but are dangerous since if real errors are
  7399. introduced in the :font facename='System VIO' size=14x8.ignore &per.&per.&per. end:font facename=default size=0x0. region they will not be
  7400. reported&per. The ignore and end comments must be matched - a warning is
  7401. printed if the file ends in an ignore region or if ignore is used inside
  7402. ignore region&per.
  7403.  
  7404. :font facename='System VIO' size=14x8.i:font facename=default size=0x0.
  7405. .br
  7406. :p.
  7407. No errors will be reported from an :font facename='System VIO' size=14x8./*@i@*/:font facename=default size=0x0. comment to the end of the line&per.
  7408. :p.
  7409.  
  7410. :font facename='System VIO' size=14x8.i:font facename=default size=0x0.:hp1.<n>:ehp1.
  7411. .br
  7412. :p.
  7413.  No errors will be reported from an /*@i:hp1.<n>:ehp1.@*/ (e&per.g&per.,
  7414. :font facename='System VIO' size=14x8./*@i3@*/:font facename=default size=0x0.) comment to the end of the line&per. If there are not
  7415. exactly :hp1.n :ehp1.errors suppressed from the comment point to the end of
  7416. the line, LCLint will report an error&per.  This is more robust than i or
  7417. ignore since a message is generated if the expected number errors is not
  7418. present&per.  Since errors are not necessarily detected until after this
  7419. file is processed (for example, and unused variable error), suppress
  7420. count errors are reported after all files have been processed&per. The :font facename='System VIO' size=14x8.-supcounts:font facename=default size=0x0. flag may be
  7421. used to suppress these errors&per.  This is useful when a system if being
  7422. rechecked with different flag settings&per.  
  7423.  
  7424. :font facename='System VIO' size=14x8.t:font facename=default size=0x0.
  7425. .br
  7426. :font facename='System VIO' size=14x8.t:font facename=default size=0x0.:hp1.<n>:ehp1.
  7427. .br
  7428. :p.
  7429. Like :font facename='System VIO' size=14x8.i:font facename=default size=0x0. and :font facename='System VIO' size=14x8.i:font facename=default size=0x0.:hp1.<n>:ehp1., except controlled by
  7430. :font facename='System VIO' size=14x8.+tmpcomments:font facename=default size=0x0. flag&per.  These can be used to temporarily suppress
  7431. certain errors&per.  Then, :font facename='System VIO' size=14x8.-tmpcomments:font facename=default size=0x0. can be set to find them
  7432. again&per.
  7433.  
  7434. :p.
  7435. :hp2.:hp1.Type Access:ehp1.:ehp2.
  7436. :p.
  7437. :hp2.:hp1.:ehp1.:ehp2.Control comments may also be used to override type access
  7438. settings&per. The syntax :font facename='System VIO' size=14x8./*@access :font facename=default size=0x0.:hp1.<type>:ehp1.,+:font facename='System VIO' size=14x8.@*/:font facename=default size=0x0. allows the following code to
  7439. access the representation of :hp1.<type>:ehp1.&per.  Similarly,
  7440. :font facename='System VIO' size=14x8./*@noaccess :font facename=default size=0x0.:hp1.<type>:ehp1.,+:font facename='System VIO' size=14x8.@*/:font facename=default size=0x0. restricts access
  7441. to the representation of :hp1.<type>:ehp1.&per.  The type in a noaccess
  7442. comment must have been declared as an abstract type&per.  Type access
  7443. applies from the point of the comment to the end of the file or the next
  7444. access control comment for this type&per. 
  7445. :p.
  7446. :hp2.:hp1.Macro Expansion:ehp1.:ehp2.
  7447. :p.
  7448. :hp2.:hp1.:ehp1.:ehp2.The :font facename='System VIO' size=14x8./*@notfunction@*/:font facename=default size=0x0.indicates that the next macro definition is
  7449. not intended to be a function, and should be expanded in line instead of
  7450. checked as a macro function definition&per.
  7451. :p.
  7452. :hp2.:hp1.Traditional Lint Comments:ehp1.:ehp2.
  7453. :p.
  7454. :hp2.:hp1.:ehp1.:ehp2.Some of the control comments supported by most standard UNIX
  7455. lints are supported by LCLint so legacy systems can be checked more easily&per.
  7456. These comments are not lexically consistent with LCLint comments, and their
  7457. meanings are less precise (and may vary between different lint programs), so we
  7458. recommend that LCLint comments are used instead except for checking legacy
  7459. systems already containing standard lint comments&per.
  7460. :p.
  7461. :p.
  7462. These standard lint comments supported by LCLint&colon.
  7463. :p.
  7464. :font facename='System VIO' size=14x8./*FALLTHROUGH*/:font facename=default size=0x0. (alternate misspelling, :font facename='System VIO' size=14x8./*FALLTHRU*/:font facename=default size=0x0.)
  7465. :p.
  7466. Prevents errors for fall-through cases&per.  Same meaning as :font facename='System VIO' size=14x8./*@fallthrough@*/:font facename=default size=0x0.&per.
  7467.  
  7468. :font facename='System VIO' size=14x8./*NOTREACHED*/:font facename=default size=0x0.
  7469. :p.
  7470. Prevents errors about unreachable code (until the end of the function)&per.  Same
  7471. meaning as :font facename='System VIO' size=14x8./*@notreached@*/:font facename=default size=0x0.&per.  
  7472.  
  7473. :font facename='System VIO' size=14x8./*PRINTFLIKE*/:font facename=default size=0x0.
  7474. :p.
  7475. Arguments similar to the printf library function (there didn't seem to be much
  7476. of a consensus among standard lints as to exactly what this means)&per.  LCLint
  7477. supports&colon.
  7478. :p.
  7479. :font facename='System VIO' size=14x8./*@printflike@*/:font facename=default size=0x0.
  7480. :p.
  7481. Function takes zero or more arguments of any type, an unmodified char * format
  7482. string argument and zero of more arguments of type and number dictated by the
  7483. format string&per.  Format codes are interpreted identically to the printf standard
  7484. library function&per.  May return a result of any type&per.  (LCLint interprets
  7485. :font facename='System VIO' size=14x8./*PRINTFLIKE*/:font facename=default size=0x0. as :font facename='System VIO' size=14x8./*@printflike@*/:font facename=default size=0x0.&per.)
  7486. :p.
  7487.  
  7488. :font facename='System VIO' size=14x8./*@scanflike@*/:font facename=default size=0x0.
  7489. :p.
  7490. Like printflike, except format codes are interpreted as in the scanf library
  7491. function&per.
  7492.  
  7493.  
  7494. :font facename='System VIO' size=14x8./*ARGSUSED*/:font facename=default size=0x0.
  7495. :p.
  7496. Turns off unused parameter messages for this function&per.  The control
  7497. comment, :font facename='System VIO' size=14x8./*@-paramuse@*/:font facename=default size=0x0. can be used to the same effect, or
  7498. :font facename='System VIO' size=14x8./*@unused@*/:font facename=default size=0x0. can be used in individual parameter declarations&per.
  7499.  
  7500. :p.
  7501. LCLint will ignore standard lint comments if :font facename='System VIO' size=14x8.-lintcomments:font facename=default size=0x0. is used&per.
  7502. If :font facename='System VIO' size=14x8.+warnlintcomments:font facename=default size=0x0.
  7503. is used, LCLint generates a message for standard lint comments and suggest replacements,
  7504.  
  7505. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  7506. .br
  7507. :link reftype=hd res=21.
  7508. :elink.
  7509. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=21.:eartlink.:link reftype=hd res=21.:elink.
  7510. :link reftype=hd res=1.
  7511. :elink.
  7512. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  7513. :link reftype=hd res=27.
  7514. :elink.
  7515. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  7516.  
  7517. :link reftype=hd res=2.David Evans:elink. 
  7518. .br
  7519. :link reftype=hd res=3.Systematic Program Development:elink.
  7520. .br
  7521. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  7522.  
  7523.  
  7524. .* Source filename: appF.html
  7525. :h2 res=21.LCLint User's Guide - Appendix F  Libraries
  7526. :font facename=default size=0x0.
  7527. :p.
  7528.  
  7529.  
  7530. .br
  7531. :font facename='Helv' size=20x12.
  7532. .br
  7533. Appendix F  Libraries:font facename=default size=0x0.
  7534. .br
  7535. .br
  7536.  
  7537. :p.
  7538. :hp2.:ehp2.Libraries can be used to record interface information&per.  A library
  7539. containing information about the  Standard C Library is used to enable checking
  7540. of library calls&per.  Program libraries can be created to enable fast checking of
  7541. single modules in a large program&per.
  7542. :p.
  7543. :hp2.:hp1.Standard Libraries:ehp1.:ehp2.
  7544. :p.
  7545. In order to check calls to library functions, LCLint uses an
  7546. annotated standard library&per.  This contains more information about function
  7547. interfaces then is available in the system header files since it uses
  7548. annotations&per.  Further, it contains only those functions documented in the ANSI
  7549. Standard&per.  Many systems include extra functions in their system libraries;
  7550. programs that use these functions cannot be compiled on other systems that do
  7551. not provide them&per.  Certain types defined by the library are treated as abstract
  7552. types (e&per.g&per., a program should not rely on how the FILE type is implemented)&per.
  7553. When checking source code, LCLint does include system headers according to
  7554. include directive in the source code, but instead uses the library description
  7555. of the standard library&per.
  7556. :p.
  7557. :p.
  7558.  
  7559. The LCLint distribution includes several different standard libraries&colon.
  7560. the ANSI standard library, the POSIX standard library , and an ad hoc
  7561. UNIX library&per.  Each library comes in two versions&colon. the standard version
  7562. and the strict version&per.
  7563. :p.
  7564. :hp2.ANSI Library:ehp2.
  7565. :p.
  7566.  
  7567. The default behavior of LCLint is to use the ANSI standard library
  7568. (loaded from :font facename='System VIO' size=14x8.ansi&per.lcd:font facename=default size=0x0.)&per.  This library is based on the standard library
  7569. described in the ANSI C Standard&per.  It includes functions and types added
  7570. by Amendment 1 to the ANSI C Standard&per.
  7571. :p.
  7572.  
  7573. :hp2.POSIX Library:ehp2.
  7574. :p.
  7575.  
  7576. The POSIX library is selected by the :font facename='System VIO' size=14x8.+posixlib:font facename=default size=0x0. flag&per.  The POSIX library
  7577. is based on the IEEE Std 1003&per.1-1990&per.  
  7578. :p.
  7579.  
  7580. :hp2.UNIX Library:ehp2.
  7581. :p.
  7582.  
  7583. The UNIX library is selected by the :font facename='System VIO' size=14x8.+unixlib:font facename=default size=0x0. flag&per.  This
  7584. library is an ad hoc attempt to capture additional functionality
  7585. provided by many UNIX platforms&per. Unfortunately, UNIX systems vary widely
  7586. and very few are consistent with the ANSI Standard&per.
  7587. :p.
  7588. The differences between the UNIX library and the POSIX library are&colon.
  7589. :ul compact.
  7590. :li.In the UNIX library, :font facename='System VIO' size=14x8.free:font facename=default size=0x0. is declared with a non-null
  7591. parameter&per.  ANSI C specifies that :font facename='System VIO' size=14x8.free:font facename=default size=0x0. should handle the
  7592. argument :font facename='System VIO' size=14x8.NULL:font facename=default size=0x0., but several UNIX platforms crash if :font facename='System VIO' size=14x8.NULL:font facename=default size=0x0. is
  7593. passed to :font facename='System VIO' size=14x8.free:font facename=default size=0x0.&per. 
  7594. :li.Extra variables, constants and functions are included in the UNIX
  7595. library&per.  Some declarations are not  part of the POSIX library, but are
  7596. believed to be available on many UNIX systems&per.  See :font facename='System VIO' size=14x8.lib/unix&per.h:font facename=default size=0x0.
  7597. for a list of the UNIX-only declarations&per. 
  7598. :eul.
  7599.  
  7600. :p.
  7601. Code checked using the UNIX library can probably be ported to some UNIX
  7602. systems without difficulty&per.  To enhance the likelihood that a program is
  7603. portable, the POSIX library should be used instead&per.
  7604. :p.
  7605. :hp2.Strict Libraries:ehp2.
  7606. :p.
  7607. Stricter versions of the libraries are used if the
  7608. :font facename='System VIO' size=14x8.-ansi-strict:font facename=default size=0x0., :font facename='System VIO' size=14x8.posix-strict-lib:font facename=default size=0x0. or
  7609. :font facename='System VIO' size=14x8.unix-strct-lib:font facename=default size=0x0. flag is used&per. These libraries use a stricter
  7610. interpretation of the library&per.  They will detect more errors in some programs, but may to produce many spurious errors for typical code&per. 
  7611. :p.
  7612. The differences between the standard libraries and the strict libraries
  7613. are&colon.
  7614. :ul compact.
  7615. :li.The standard libraries declare the printing functions
  7616. (:font facename='System VIO' size=14x8.fprintf:font facename=default size=0x0., :font facename='System VIO' size=14x8.printf:font facename=default size=0x0., and :font facename='System VIO' size=14x8.sprintf:font facename=default size=0x0.) that may
  7617. return error codes to return :font facename='System VIO' size=14x8.int:font facename=default size=0x0. or :font facename='System VIO' size=14x8.void:font facename=default size=0x0.&per.  This prevents typical
  7618. programs from leading to deluge of ignored return value errors, but may
  7619. mean some relevant errors are not detected&per.  In the strict libraries, they
  7620. are declared to return :font facename='System VIO' size=14x8.int:font facename=default size=0x0., so ignored return value errors will
  7621. be reported (depending on other flag settings)&per.  Programs should check
  7622. that this return value is non-negative&per. 
  7623.  
  7624. :li.
  7625. The standard libraries declare some parameters and return values to be
  7626. alternate types (:font facename='System VIO' size=14x8.int:font facename=default size=0x0. or :font facename='System VIO' size=14x8.bool:font facename=default size=0x0., or :font facename='System VIO' size=14x8.int:font facename=default size=0x0. or
  7627. :font facename='System VIO' size=14x8.char:font facename=default size=0x0.)&per.  The ANSI standard specifies these types as int to be
  7628. compatible with older versions of the library, but logically they make
  7629. more sense as :font facename='System VIO' size=14x8.bool:font facename=default size=0x0. or :font facename='System VIO' size=14x8.char:font facename=default size=0x0.&per.  In the strict libraries,
  7630. the stronger type is used&per.  The parameter to :font facename='System VIO' size=14x8.assert:font facename=default size=0x0. is
  7631. :font facename='System VIO' size=14x8.int:font facename=default size=0x0. or :font facename='System VIO' size=14x8.bool:font facename=default size=0x0. in the standard library, and :font facename='System VIO' size=14x8.bool:font facename=default size=0x0.
  7632. in the strict library&per.  The parameter to the character functions
  7633. isalnum, isalpha, iscntrl, isdigit, isgraph, islower, isprint, ispunct,
  7634. isspace, isupper, isxdigit, tolower and toupper is char or int in the
  7635. standard library and char in the strict library&per.  The type of the return
  7636. value of the character classification functions (all of the previous
  7637. character functions except tolower and toupper) is bool or int in the
  7638. standard library and bool in the strict library&per.  The type of the first
  7639. parameter to ungetc is char or int in the standard library and char in
  7640. the strict library (EOF should not be passed to ungetc)&per.  The second
  7641. parameter to strchr and strrchr is char or int in the standard library
  7642. and char in the strict library&per.
  7643.  
  7644. :li.The global variables stdin, stdout and stderr are declared as
  7645. unchecked variables (see :link reftype=hd res=7.Section
  7646. 4&per.2&per.1:elink.) in the standard libraries&per.  In the strict libraries, they are checked&per.  The global variable errno is declared unchecked in the standard
  7647. libraries, but declared checkedstrict in the strict libraries&per.
  7648. :eul.
  7649.  
  7650. :p.
  7651.  
  7652. :hp2.Generating the Standard Libraries:ehp2.
  7653. :p.
  7654.  
  7655. The standard libraries are generated from header files included in the
  7656. LCLint distribution&per.  Some libraries are generated from more than one
  7657. header file&per.  Since the POSIX library includes the ANSI library, the
  7658. headers for the ANSI and POSIX libraries are combined to produce the
  7659. POSIX library&per.  Similarly, the UNIX library is composed of the ANSI,
  7660. POSIX and UNIX headers&per.  The header files include some sections that are
  7661. conditionally selected by defining :font facename='System VIO' size=14x8.STRICT:font facename=default size=0x0.&per.
  7662. :p.
  7663. The commands to generate the standard libraries are&colon.
  7664. :p.
  7665. :cgraphic.
  7666. lclint -nolib ansi&per.h -dump ansi 
  7667. lclint -nolib -DSTRICT ansi&per.h -dump ansistrict
  7668. lclint -nolib ansi&per.h posix&per.h -dump posix
  7669. lclint -nolib -DSTRICT ansi&per.h posix&per.h -dump posixstrict
  7670. lclint -nolib ansi&per.h posix&per.h unix&per.h -dump unix
  7671. lclint -nolib -DSTRICT ansi&per.h posix&per.h unix&per.h -dump unixstrict
  7672. :ecgraphic.
  7673.  
  7674.  
  7675. :p.
  7676. :hp2.:hp1.User Libraries:ehp1.:ehp2.
  7677. :p.
  7678. :hp2.:hp1.:ehp1.:ehp2.To enable running LCLint on large systems, mechanisms are
  7679. provided for creating libraries containing necessary information&per.  This means
  7680. source files can be checked independently, after a library has been created&per.
  7681. The command line option -dump :hp1.library:ehp1. stores information in the file
  7682. :hp1.library:ehp1. (the default extension, :font facename='System VIO' size=14x8.&per.lcd:font facename=default size=0x0.:link reftype=hd res=5.[27]:elink., is
  7683. added)&per. Then, :font facename='System VIO' size=14x8.-load :font facename=default size=0x0.:hp1.library:ehp1. loads the library&per.  The library
  7684. contains interface information from the files checked when the library was
  7685. created&per.
  7686. :p.
  7687.  
  7688. :hp2.:hp1.
  7689. Header File Inclusion
  7690. :ehp1.:ehp2.
  7691. :p.
  7692. The standard behavior of LCLint on encountering 
  7693. :cgraphic.
  7694.    #include <X&per.h>
  7695. :ecgraphic.
  7696.  
  7697. is to search for a file named :font facename='System VIO' size=14x8.X&per.h:font facename=default size=0x0. on the include search path
  7698. (set using :font facename='System VIO' size=14x8.-I:font facename=default size=0x0.) and then the system base include path (usually
  7699. :font facename='System VIO' size=14x8./usr/include:font facename=default size=0x0., default is set when LCLint is compiled)&per.  If :font facename='System VIO' size=14x8.X&per.h:font facename=default size=0x0. is the name of a header file in a loaded
  7700. standard library (either
  7701. ANSI or POSIX) and :font facename='System VIO' size=14x8.X&per.h:font facename=default size=0x0. is found in a directory that is a system
  7702. directory (as set by the :font facename='System VIO' size=14x8.-sysdirs:font facename=default size=0x0. flag; the default is :font facename='System VIO' size=14x8./usr/include:font facename=default size=0x0.),
  7703. :font facename='System VIO' size=14x8.X&per.h:font facename=default size=0x0. will not be included if :font facename='System VIO' size=14x8.skip-ansi-headers:font facename=default size=0x0. or
  7704. :font facename='System VIO' size=14x8.skip-posix-headers:font facename=default size=0x0. (depending on whether :font facename='System VIO' size=14x8.X&per.h:font facename=default size=0x0. is an
  7705. ANSI or POSIX header file) is on (both are on by default)&per.  To force all
  7706. headers to be included normally, use :font facename='System VIO' size=14x8.-skip-ansi-headers:font facename=default size=0x0. and
  7707. :font facename='System VIO' size=14x8.-skip-posix-headers:font facename=default size=0x0.&per.
  7708. :p.
  7709.  
  7710. Sometimes headers in system directories contain non-standard syntax
  7711. which LCLint is unable to parse&per.  The :font facename='System VIO' size=14x8.+skip-sys-headers:font facename=default size=0x0. flag
  7712. may be used to prevent any include file in a system directory from being
  7713. included&per. 
  7714.  
  7715. :p.
  7716. LCLint is fast enough that it can be run on medium-size (10,000
  7717. line) programs without performance concerns&per.  It takes about one second to
  7718. process a thousand source lines on a DEC Alpha&per.  Libraries can be used to
  7719. enable efficient checking of small modules in large programs&per.  To further
  7720. improve performance, header file inclusion can be optimized&per.
  7721. :p.
  7722. :p.
  7723. When processing a complete system in which many files include the same headers,
  7724. a large fraction of processing time is wasted re-reading header files
  7725. unnecessarily&per.  If you are checking a 100-file program, and every file includes
  7726. :font facename='System VIO' size=14x8.utils&per.h:font facename=default size=0x0., LCLint will have to process utils&per.h 100 times (as would most C
  7727. compilers)&per.  If the :link reftype=hd res=18.:font facename='System VIO' size=14x8.+singleinclude:font facename=default size=0x0.:elink. flag is used, each header file is processed
  7728. only once&per.  Single header file processing produces a significant efficiency
  7729. improvement when checking large programs split into many files, but is only
  7730. safe if the same header file included in different contexts always has the same
  7731. meaning (i&per.e&per., it does not depend on preprocessor variable defined differently
  7732. at different inclusion sites)&per.
  7733. :p.
  7734. :p.
  7735. When processing a single file in a large system, a large fraction of the time
  7736. is spent processing included header files&per.  This can be avoided if the
  7737. information in the header files is stored in a library instead&per.  If
  7738. :link reftype=hd res=18.:font facename='System VIO' size=14x8.+neverinclude:font facename=default size=0x0.:elink. is set, inclusion of files ending in &per.h is prevented&per.  Files with
  7739. different suffixes are included normally&per.  To do this the header files must not
  7740. include any expanded macros&per. That is, the header file must be processed with
  7741. :link reftype=hd res=18.:font facename='System VIO' size=14x8.+allmacros:font facename=default size=0x0.:elink., and there must be no :font facename='System VIO' size=14x8./*@notfunction@*/:font facename=default size=0x0. control comments in the
  7742. header&per.  Then, the :link reftype=hd res=18.:font facename='System VIO' size=14x8.+neverinclude:font facename=default size=0x0.:elink. flag may be used to prevent inclusion of header
  7743. files&per.  Alternately, non-function macros can be moved to a different file with
  7744. a name that does not end in :font facename='System VIO' size=14x8.&per.h:font facename=default size=0x0.&per.  Remember, that this file must be included
  7745. directly from the :font facename='System VIO' size=14x8.&per.c:font facename=default size=0x0. file, since if it is included from a :font facename='System VIO' size=14x8.&per.h:font facename=default size=0x0. file indirectly,
  7746. that :font facename='System VIO' size=14x8.&per.h:font facename=default size=0x0. file is ignored so the other file is never included&per.
  7747. :p.
  7748. :p.
  7749. These options can be used for significant performance improvements on large
  7750. systems&per.  The performance depends on how the code is structured, but checking a
  7751. single module in a large program is several times faster if libraries and
  7752. :link reftype=hd res=18.:font facename='System VIO' size=14x8.+neverinclude:font facename=default size=0x0.:elink. are used&per.
  7753. :p.
  7754.  
  7755. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  7756. .br
  7757. :link reftype=hd res=22.
  7758. :elink.
  7759. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=22.:eartlink.:link reftype=hd res=22.:elink.
  7760. :link reftype=hd res=1.
  7761. :elink.
  7762. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  7763. :link reftype=hd res=27.
  7764. :elink.
  7765. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  7766.  
  7767. :link reftype=hd res=2.David Evans:elink. 
  7768. .br
  7769. :link reftype=hd res=3.Systematic Program Development:elink.
  7770. .br
  7771. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  7772.  
  7773.  
  7774. .* Source filename: appG.html
  7775. :h2 res=22.LCLint User's Guide - Appendix G  Specifications
  7776. :font facename=default size=0x0.
  7777. :p.
  7778.  
  7779.  
  7780. .br
  7781. :font facename='Helv' size=20x12.
  7782. .br
  7783. Appendix G  Specifications:font facename=default size=0x0.
  7784. .br
  7785. .br
  7786.  
  7787. :p.
  7788. :hp2.:ehp2.Another way of providing more information about programs is to use
  7789. formal specifications&per.  Although this document has largely ignored
  7790. specifications, LCLint was originally designed to use the information in LCL
  7791. specifications instead of source-code annotations&per.  This document focuses on
  7792. annotations since it takes less effort to add annotations to source code than
  7793. to maintain an additional specification file&per.  Annotations can express
  7794. everything that can be expressed in LCL specifications that is relevant to
  7795. LCLint checking&per.  However, LCL specifications can provide more precise
  7796. documentation on program interfaces than is possible with LCLint annotations&per.
  7797. This
  7798. appendix (extracted from [:link reftype=hd res=25.Evans94:elink.]) is a very brief introduction to LCL
  7799. Specifications&per.
  7800. For more information, consult [:link reftype=hd res=25.GH93:elink.]&per.      
  7801. :p.
  7802. :p.
  7803. The Larch family of languages is a two-tiered approach to formal specification&per.
  7804. A specification is built using two languages -- the :hp1.Larch Shared
  7805. Language:ehp1. (LSL), which is independent of the implementation language, and a
  7806. :hp1.Larch Interface Language:ehp1. designed for the specific implementation
  7807. language&per.  An LSL specification defines :hp1.sorts:ehp1., analogous to abstract
  7808. types in a programming language, and :hp1.operators:ehp1., analogous to procedures&per.
  7809. It expresses the underlying semantics of an abstraction&per.
  7810. :p.
  7811. :p.
  7812. The interface language specifies an interface to an abstraction in a particular
  7813. programming language&per.  It captures the details of the interface needed by a
  7814. client using the abstraction and places constraints on both correct
  7815. implementations and uses of the module&per.  The semantics of the interface are
  7816. described using primitives and sorts and operators defined in LSL
  7817. specifications&per.  Interface languages have been designed for several
  7818. programming languages&per.
  7819. :p. 
  7820. :p.
  7821. LCL
  7822. [GH93, 
  7823. Tan94] is a Larch interface language for Standard C&per.  LCL uses a
  7824. C-like syntax&per.  Traditionally, a C module :hp1.M:ehp1. consists of a source file,
  7825. :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.c:font facename=default size=0x0., and a header file, :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.h:font facename=default size=0x0.&per.  The header
  7826. file contains prototype declarations for functions, variables and constants exported
  7827. by :hp1.M:ehp1., as well as those macro definitions that implement exported
  7828. functions or constants, and definitions of exported types&per. When using LCL, a
  7829. module includes two additional files - :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.lcl:font facename=default size=0x0., a formal specification of
  7830. :hp1.M:ehp1., and  :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.lh:font facename=default size=0x0., which is derived by LCLint (if the
  7831. :link reftype=hd res=22.:font facename='System VIO' size=14x8.lh:font facename=default size=0x0.:elink. flag is on) from
  7832. :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.lcl:font facename=default size=0x0.&per.  Clients use :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.lcl:font facename=default size=0x0. for documentation, and should
  7833. not need to look at any implementation file&per.  The derived file,
  7834. :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.lh:font facename=default size=0x0., contains include directives (if :hp1.M:ehp1. depends on other specified modules), prototypes of functions and declarations of variables as specified in
  7835. :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.lcl:font facename=default size=0x0.&per.  The file :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.h:font facename=default size=0x0. should include
  7836. :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.lh:font facename=default size=0x0. and retain the implementation aspects of the old
  7837. :hp1.M:ehp1.:font facename='System VIO' size=14x8.&per.h:font facename=default size=0x0., but is no longer used for client documentation&per.
  7838. :p.
  7839. :p.
  7840. The LCLint release package includes a grammar for LCL and examples of LCL
  7841. specifications&per.
  7842. :p.
  7843. :hp2.:hp1.Specification Flags:ehp1.:ehp2.
  7844. :p.
  7845. :hp2.:hp1.:ehp1.:ehp2.These flags are relevant only when LCLint is used with LCL
  7846. specifications&per. 
  7847. :p.
  7848. :hp2.Global Flags:ehp2.
  7849. :p.
  7850. :hp2.:ehp2.:font facename='System VIO' size=14x8.lcs:font facename=default size=0x0.
  7851. :p.
  7852. Generate :font facename='System VIO' size=14x8.&per.lcs:font facename=default size=0x0. files containing symbolic state of :font facename='System VIO' size=14x8.&per.lcl:font facename=default size=0x0. files (used for imports)&per.
  7853. By default :font facename='System VIO' size=14x8.&per.lcs:font facename=default size=0x0. files are generated for each :font facename='System VIO' size=14x8.&per.lcl:font facename=default size=0x0. file
  7854. processed&per.  Use :font facename='System VIO' size=14x8.-lcs:font facename=default size=0x0. to
  7855. prevent generation of :font facename='System VIO' size=14x8.&per.lcs:font facename=default size=0x0. files&per.
  7856. :p.
  7857. :font facename='System VIO' size=14x8.lh:font facename=default size=0x0.
  7858. :p.
  7859. Generate :font facename='System VIO' size=14x8.&per.lh:font facename=default size=0x0. files&per.  By default, :font facename='System VIO' size=14x8.-lh:font facename=default size=0x0. is set and no
  7860. :font facename='System VIO' size=14x8.&per.lh:font facename=default size=0x0. files are generated&per. Use :link reftype=hd res=22.:font facename='System VIO' size=14x8.+lh:font facename=default size=0x0.:elink. to enable &per.lh file generation&per.  
  7861. :p.
  7862.  
  7863. :font facename='System VIO' size=14x8.i :font facename=default size=0x0.<file>
  7864. :p.
  7865. Set LCL initialization file to :hp1.<file>:ehp1.&per.  The LCL initialization
  7866. file is read if any :font facename='System VIO' size=14x8.&per.lcl:font facename=default size=0x0. files are listed on the command line&per.  The default
  7867. file is :font facename='System VIO' size=14x8.lclinit&per.lci:font facename=default size=0x0., found on the :font facename='System VIO' size=14x8.LARCH_PATH:font facename=default size=0x0.&per.
  7868. :p.
  7869.  
  7870. :font facename='System VIO' size=14x8.lclexpect :font facename=default size=0x0.:hp1.<number>:ehp1.
  7871. :p.
  7872. Exactly :hp1.<number>:ehp1. specification errors are expected&per.  Specification
  7873. errors are errors detected when checking the specifications&per.  They do not
  7874. depend on the source code&per.
  7875. :p.
  7876. :hp2.Implicit Globals Checking Qualifiers:ehp2.
  7877. :p.
  7878.  
  7879.  
  7880. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  7881. .br
  7882. :font facename='System VIO' size=14x8.impcheckedspecglobs:font facename=default size=0x0.
  7883. .br
  7884. Implicit checked qualifier on global variables specified in an LCL file
  7885. with no checking annotation&per.
  7886. :p.
  7887. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.----:font facename=default size=0x0.
  7888. .br
  7889. :font facename='System VIO' size=14x8.impcheckmodspecglobs:font facename=default size=0x0.
  7890. .br
  7891. Implicit checkmod qualifier on global variables specified in an LCL file with
  7892. no checking annotation&per.
  7893. :p.
  7894. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  7895. .br
  7896. :font facename='System VIO' size=14x8.impcheckedstrictspecglobs:font facename=default size=0x0.
  7897. :p.
  7898. Implicit checked qualifier on global variables specified in an LCL file with no
  7899. checking annotation&per. 
  7900. :p.
  7901. :hp2.Implicit Annotations:ehp2.
  7902. :p.
  7903.  
  7904. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  7905. .br
  7906. :font facename='System VIO' size=14x8.specglobimponly:font facename=default size=0x0.
  7907. :p.
  7908. Implicit only annotation on global variable declaration in an LCL file with no
  7909. allocation annotation&per.
  7910. :p.
  7911.  
  7912. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  7913. .br
  7914. :font facename='System VIO' size=14x8.specretimponly:font facename=default size=0x0.
  7915. :p.
  7916. Implicit only annotation on return value declaration in an LCL file with no
  7917. allocation annotation&per.
  7918. :p.
  7919. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  7920. .br
  7921. :font facename='System VIO' size=14x8.specstructimponly:font facename=default size=0x0.
  7922. :p.
  7923. Implicit only annotation on structure field declarations in an LCL file with no
  7924. allocation annotation&per.
  7925. :p.
  7926. :link reftype=hd res=18.shortcut:elink.
  7927. .br
  7928. :font facename='System VIO' size=14x8.specimponly:font facename=default size=0x0.
  7929. :p.
  7930. Sets :font facename='System VIO' size=14x8.specglobimponly:font facename=default size=0x0., 
  7931. :link reftype=hd res=22.:font facename='System VIO' size=14x8.specretimponly:font facename=default size=0x0.:elink. and
  7932. :link reftype=hd res=22.:font facename='System VIO' size=14x8.specstructimponly:font facename=default size=0x0.:elink.&per.
  7933. :p.
  7934. :p.
  7935. :hp2.Macro Expansion:ehp2.
  7936. :p.
  7937. :hp2.:ehp2.
  7938. :p.
  7939. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.+:font facename=default size=0x0.
  7940. .br
  7941.              
  7942. :font facename='System VIO' size=14x8.specmacros:font facename=default size=0x0.
  7943. :p.
  7944. Macros defining specified identifiers are not expanded and are checked
  7945. according to the specification&per. 
  7946. :p.
  7947. :hp2.Complete Programs and Specifications:ehp2.
  7948. :p.
  7949. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.-+++:font facename=default size=0x0.
  7950. .br
  7951. :hp2.:ehp2.:font facename='System VIO' size=14x8.specundef:font facename=default size=0x0.
  7952. :p.
  7953. Function, variable, iterator or constant specified but never defined&per.
  7954. :p.
  7955. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  7956. .br
  7957.                    
  7958. :font facename='System VIO' size=14x8.specundecl:font facename=default size=0x0.
  7959. :p.
  7960. Function, variable, iterator or constant specified but never declared&per.
  7961. :p.
  7962. :link reftype=hd res=18.plain:elink.&colon. :font facename='System VIO' size=14x8.-:font facename=default size=0x0.
  7963. .br
  7964. :font facename='System VIO' size=14x8.needspec:font facename=default size=0x0.
  7965. :p.
  7966. There is information in the specification that is not duplicated in syntactic
  7967. comments&per.  Normally, this is not an error, but it may be useful to detect it to
  7968. make sure checking incomplete systems without the specifications will still use
  7969. this information&per.
  7970. :p.
  7971. :link reftype=hd res=18.shortcut:elink.
  7972. .br
  7973.        
  7974. :font facename='System VIO' size=14x8.exportany:font facename=default size=0x0.
  7975. :p.
  7976. An error is reported for any identifier that is exported but not specified&per.
  7977. (Sets all export flags below&per.)
  7978. :p.
  7979. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  7980. .br
  7981. :font facename='System VIO' size=14x8.exportconst:font facename=default size=0x0.
  7982. :p.
  7983. Constant exported but not specified&per.
  7984. :p.
  7985. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  7986. .br
  7987. :font facename='System VIO' size=14x8.exportvar:font facename=default size=0x0.
  7988. :p.
  7989. Variable exported but not specified&per.
  7990. :p.
  7991. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  7992. .br
  7993. :font facename='System VIO' size=14x8.exportfcn:font facename=default size=0x0.
  7994. :p.
  7995. Function exported but not specified&per.
  7996. :p.
  7997. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  7998. .br
  7999. :font facename='System VIO' size=14x8.exportiter:font facename=default size=0x0.
  8000. :p.
  8001. Iterator exported but not specified&per.
  8002. :p.
  8003. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  8004. .br
  8005.             
  8006. :font facename='System VIO' size=14x8.exportmacro:font facename=default size=0x0.
  8007. :p.
  8008. An expanded macro exported but not :font facename='System VIO' size=14x8.specified:font facename=default size=0x0.
  8009. :p.
  8010. :link reftype=hd res=18.m&colon. :elink.:font facename='System VIO' size=14x8.---+:font facename=default size=0x0.
  8011. .br
  8012. :font facename='System VIO' size=14x8.exporttype:font facename=default size=0x0.
  8013. :p.            
  8014. Type definition exported but not specified 
  8015. :p.
  8016.  
  8017. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  8018. .br
  8019. :link reftype=hd res=23.
  8020. :elink.
  8021. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=23.:eartlink.:link reftype=hd res=23.:elink.
  8022. :link reftype=hd res=1.
  8023. :elink.
  8024. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  8025. :link reftype=hd res=27.
  8026. :elink.
  8027. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  8028.  
  8029. :link reftype=hd res=2.David Evans:elink. 
  8030. .br
  8031. :link reftype=hd res=3.Systematic Program Development:elink.
  8032. .br
  8033. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  8034.  
  8035.  
  8036. .* Source filename: appH.html
  8037. :h2 res=23.LCLint User's Guide - Appendix H  Emacs
  8038. :font facename=default size=0x0.
  8039. :p.
  8040.  
  8041.  
  8042. .br
  8043. :font facename='Helv' size=20x12.
  8044. .br
  8045. Appendix H  Emacs:font facename=default size=0x0.
  8046. .br
  8047. .br
  8048. :p.
  8049. :hp2.:ehp2.LCLint can be used most productively with the emacs text editor&per.  The
  8050. release package includes emacs files for running LCLint and editing code with
  8051. annotations&per.
  8052. :p.
  8053. :hp2.:hp1.Running LCLint:ehp1.:ehp2.
  8054. :p.
  8055. :hp2.:hp1.:ehp1.:ehp2.LCLint release includes :font facename='System VIO' size=14x8.emacs/lclint&per.elc:font facename=default size=0x0. that defines an emacs
  8056. command, :font facename='System VIO' size=14x8.M-x lclint:font facename=default size=0x0., for running LCLint&per.  To load this file, add this line to
  8057. your :font facename='System VIO' size=14x8.&per.emacs:font facename=default size=0x0. file&colon.
  8058. :p.
  8059. :font facename='System VIO' size=14x8.(load-file ":font facename=default size=0x0.:hp1.<directory>:ehp1.:font facename='System VIO' size=14x8./lclint&per.elc"):font facename=default size=0x0.
  8060. :p.
  8061. The :font facename='System VIO' size=14x8.M-x lclint:font facename=default size=0x0. command is similar to :font facename='System VIO' size=14x8.M-x compile:font facename=default size=0x0.,
  8062. except it jumps to the exact column location of the error message,
  8063. instead of the beginning of the line&per. After typing :font facename='System VIO' size=14x8.M-x lclint:font facename=default size=0x0.,
  8064. you will be prompted for a compile command&per.  Enter the command
  8065. identically to the command that would be used to run LCLint from the
  8066. command line&per.  If errors are found, :font facename='System VIO' size=14x8.M-x next-lclint-error:font facename=default size=0x0. jumps
  8067. to the point where the next error was found&per.  (Note, this only works if
  8068. :link reftype=hd res=18.:font facename='System VIO' size=14x8.+showcolumn:font facename=default size=0x0.:elink.  is set to
  8069. make LCLint include column numbers in error messages&per.)
  8070. :p. 
  8071. :p.
  8072. The command can be bound to a key to enable rapid jumping through the error
  8073. messages&per.  For example, to set the key do :font facename='System VIO' size=14x8.CTRL:font facename=default size=0x0.-backslash add
  8074. this line to your :font facename='System VIO' size=14x8.&per.emacs:font facename=default size=0x0. file&colon. 
  8075. :p.
  8076. :cgraphic.
  8077.    (global-set-key "^\" 'next-lclint-error)
  8078. :ecgraphic.
  8079. :p.
  8080. :hp2.:hp1.Editing Abbreviations:ehp1.:ehp2.
  8081. :p.
  8082. :hp2.:hp1.:ehp1.:ehp2.An additional file, :font facename='System VIO' size=14x8.emacs/lclint-abbrevs:font facename=default size=0x0. contains abbreviations
  8083. for LCLint syntactic comments and annotations&per.  If it is loaded, the comment
  8084. surrounding an LCLint annotation will be added automatically&per.  For example,
  8085. typing ":font facename='System VIO' size=14x8.only:font facename=default size=0x0." and a space, will produce ":font facename='System VIO' size=14x8./*@only@*/:font facename=default size=0x0. "&per.
  8086. Abbreviations are provided for each LCLint syntactic comment&per.  The
  8087. abbreviation of  :font facename='System VIO' size=14x8./*@null@*/:font facename=default size=0x0. is :font facename='System VIO' size=14x8.nll:font facename=default size=0x0. (not null), since
  8088. it is often necessary to type NULL&per.  
  8089. :p. 
  8090. Abbreviations are loaded and used when a :font facename='System VIO' size=14x8.&per.c:font facename=default size=0x0. or :font facename='System VIO' size=14x8.&per.h:font facename=default size=0x0. file is edited by adding
  8091. these lines to your &per.emacs file&colon.
  8092. :p.
  8093. :font facename='System VIO' size=14x8.(quietly-read-abbrev-file ":font facename=default size=0x0.:hp1.<directory>:ehp1.:font facename='System VIO' size=14x8./lclint-abbrevs"):font facename=default size=0x0.
  8094. :p.
  8095. :font facename='System VIO' size=14x8.(setq c-mode-hook (function (lambda nil (abbrev-mode 1)))):font facename=default size=0x0.
  8096.  
  8097. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  8098. .br
  8099. :link reftype=hd res=25.
  8100. :elink.
  8101. :artwork name='right-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=25.:eartlink.:link reftype=hd res=25.:elink.
  8102. :link reftype=hd res=1.
  8103. :elink.
  8104. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  8105. :link reftype=hd res=27.
  8106. :elink.
  8107. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  8108.  
  8109. :link reftype=hd res=2.David Evans:elink. 
  8110. .br
  8111. :link reftype=hd res=3.Systematic Program Development:elink.
  8112. .br
  8113. :link reftype=hd res=28.:hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.:elink.
  8114.  
  8115.  
  8116. .* Source filename: figures.html
  8117. :h2 res=24.Figures
  8118. :font facename=default size=0x0.
  8119. :p.
  8120. .br
  8121. :font facename='Helv' size=32x20.
  8122. .br
  8123. Figures
  8124. .br
  8125. :font facename=default size=0x0.
  8126. .br
  8127. .br
  8128. :p.
  8129. Figure 1&per.  Effort/benefit curve for LCLint&per.     (not available in HTML format)
  8130. .br
  8131. :link reftype=hd res=44.Figure 2:elink.&per.  Violations using abstract types&per.     
  8132. .br
  8133. :link reftype=hd res=45.Figure 3:elink.&per.  Boolean checking&per.    
  8134. .br
  8135. :link reftype=hd res=46.Figure 4:elink.&per.  Modifies checking&per.   
  8136. .br
  8137. :link reftype=hd res=47.Figure 5:elink.&per.  Globals checking&per.    
  8138. .br
  8139. :link reftype=hd res=48.Figure 6:elink.&per.  Deallocation errors&per. 
  8140. .br
  8141. :link reftype=hd res=49.Figure 7:elink.&per.  Stack references&per.    
  8142. .br
  8143. :link reftype=hd res=50.Figure 8:elink.&per.  Implicit annotations&per.        
  8144. .br
  8145. :link reftype=hd res=51.Figure 9:elink.&per.  Reference counting&per.  
  8146. .br
  8147. :link reftype=hd res=52.Figure 10:elink.&per.  Unique parameters&per.  
  8148. .br
  8149. :link reftype=hd res=53.Figure 11:elink.&per.  Returned parameters&per.        
  8150. .br
  8151. :link reftype=hd res=54.Figure 12:elink.&per.  Exposure checking&per.  
  8152. .br
  8153. :link reftype=hd res=55.Figure 13:elink.&per.  Use before definition&per.      
  8154. .br
  8155. :link reftype=hd res=56.Figure 14:elink.&per.  Annotated globals lists&per.    
  8156. .br
  8157. :link reftype=hd res=57.Figure 15:elink.&per.  Null checking&per.      
  8158. .br
  8159. :link reftype=hd res=58.Figure 16:elink.&per.  Using notnull&per.      
  8160. .br
  8161. :link reftype=hd res=59.Figure 17:elink.&per.  Special Clauses&per.    
  8162. .br
  8163. :link reftype=hd res=60.Figure 18:elink.&per.  Naming checks&per.      
  8164. .br
  8165. :link reftype=hd res=61.Figure 19:elink.&per.  Evaluation order    
  8166. .br
  8167. :link reftype=hd res=62.Figure 20:elink.&per.  Infinite loop checking      
  8168. .br
  8169. :link reftype=hd res=63.Figure 21:elink.&per.  Switch checking&per.    
  8170. .br
  8171. :link reftype=hd res=64.Figure 22:elink.&per.  Statements with no effect&per.  
  8172. .br
  8173. :link reftype=hd res=65.Figure 23:elink.&per.  Ignored return values&per.      
  8174. .br
  8175.  
  8176. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  8177. .br
  8178. :link reftype=hd res=1.
  8179. :elink.
  8180. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  8181. :link reftype=hd res=27.
  8182. :elink.
  8183. .br
  8184. :link reftype=hd res=3.Systematic Program Development:elink.
  8185. .br
  8186. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  8187.  
  8188. .* Source filename: fig2.html
  8189. :h3 res=44.Figure 2&per.  Violations using abstract types&per.
  8190. :font facename=default size=0x0.
  8191. :p.
  8192.  
  8193. .br
  8194. :font facename='Tms Rmn' size=18x10.
  8195. .br
  8196. palindrome&per.c:font facename=default size=0x0.
  8197. .br
  8198. .br
  8199. :cgraphic.
  8200. #include ":link reftype=hd res=69.bool&per.h:elink."
  8201. #include ":link reftype=hd res=70.mstring&per.h:elink."
  8202.  
  8203. bool isPalindrome (mstring s)
  8204.    char *current = (char *) s;
  8205.    int i, len = (int) strlen (s);  
  8206.  
  8207.    for (i = 0; i &.lt= (len+1)/2; i++)    
  8208.      {
  8209.         if (current[i] != s[len-i-1])        
  8210.            return FALSE;   
  8211.      }  
  8212.    return TRUE;
  8213. }
  8214.  
  8215. bool callPal (void)
  8216. {
  8217.    return (isPalindrome ("bob"));
  8218. }
  8219.  
  8220.  
  8221.  
  8222.  
  8223.  
  8224. :ecgraphic.
  8225. .br
  8226. :font facename='Tms Rmn' size=18x10.
  8227. .br
  8228. LCLint Output:font facename=default size=0x0.
  8229. .br
  8230. .br
  8231. :cgraphic.
  8232. LCLint 2&per.2 --- 25 Aug 96
  8233.  
  8234. palindrome&per.c&colon. (in function isPalindrome)
  8235. palindrome&per.c&colon.6,29&colon. Cast from underlying abstract type
  8236.                       mstring&colon. (char *)s
  8237.   An abstraction barrier is broken&per. If necessary, use
  8238.   /*@access @*/ to allow access to an abstract
  8239.   type&per. (-abstract will suppress message)
  8240. palindrome&per.c&colon.7,31&colon. Function strlen expects arg 1 to be
  8241.                       char * gets mstring&colon. s
  8242.   Underlying types match, but mstring is an abstract
  8243.   type that is not accessible here&per.
  8244. palindrome&per.c&colon.11,27&colon. Array fetch from non-array
  8245.                        (mstring)&colon. s[len - i - 1]
  8246.   Types are incompatible&per. (-type will suppress
  8247.   message)
  8248. palindrome&per.c&colon. (in function callPal)
  8249. palindrome&per.c&colon.19,26&colon. Function isPalindrome expects arg
  8250.     1 to be mstring gets char *&colon. "bob"
  8251.   Underlying types match, but mstring is an abstract
  8252.   type that is not accessible here&per.
  8253.  
  8254. Finished LCLint checking --- 4 code errors found
  8255. :ecgraphic.
  8256. :link reftype=hd res=27.
  8257. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  8258.  
  8259. :link reftype=hd res=2.David Evans:elink. 
  8260. .br
  8261. :link reftype=hd res=3.Systematic Program Development:elink.
  8262. .br
  8263. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  8264.  
  8265.  
  8266. .* Source filename: bool.h.html
  8267. :h4 res=69.bool&per.h
  8268. :font facename=default size=0x0.
  8269. :p.
  8270.  
  8271. .br
  8272. :font facename='Tms Rmn' size=18x10.
  8273. .br
  8274. bool&per.h:font facename=default size=0x0.
  8275. .br
  8276. .br
  8277. :cgraphic.
  8278. #ifndef BOOL_H
  8279. #define BOOL_H
  8280.  
  8281. #ifndef FALSE
  8282. #define FALSE 0
  8283. #endif
  8284.  
  8285. #ifndef TRUE
  8286. #define TRUE (! FALSE)
  8287. #endif
  8288.  
  8289. typedef int bool;
  8290.  
  8291. # define bool_initMod()
  8292. # define bool_unparse(b) ((b) ? "true" &colon. "false" )
  8293. # define bool_not(b) ((b) ? FALSE &colon. TRUE)
  8294. # define bool_equal(a,b) ((a) ? (b) &colon. !(b))
  8295.  
  8296. # endif
  8297.  
  8298.  
  8299.  
  8300.  
  8301.  
  8302.  
  8303.  
  8304.  
  8305. :ecgraphic.
  8306.  
  8307. .* Source filename: mstring.h.html
  8308. :h4 res=70.mstring&per.h
  8309. :font facename=default size=0x0.
  8310. :p.
  8311.  
  8312. .br
  8313. :font facename='Tms Rmn' size=18x10.
  8314. .br
  8315. mstring&per.h:font facename=default size=0x0.
  8316. .br
  8317. .br
  8318. :cgraphic.
  8319. typedef /*@abstract@*/ char *mstring; 
  8320.  
  8321.  
  8322.  
  8323.  
  8324.  
  8325.  
  8326.  
  8327.  
  8328. :ecgraphic.
  8329.  
  8330.  
  8331. .* Source filename: fig3.html
  8332. :h3 res=45.Figure 3&per.  Boolean checking&per.
  8333. :font facename=default size=0x0.
  8334. :p.
  8335.  
  8336. .br
  8337. :font facename='Tms Rmn' size=18x10.
  8338. .br
  8339. bool&per.c:font facename=default size=0x0.
  8340. .br
  8341. .br
  8342. :cgraphic.
  8343. #include ":link reftype=hd res=69.bool&per.h:elink."
  8344.  
  8345. int f (int i, char *s, 
  8346.        bool b1, bool b2)
  8347. {
  8348.   if (i = 3) 
  8349.     return b1;
  8350.   if (!i || s) 
  8351.     return i;
  8352.   if (s) 
  8353.     return 7;
  8354.   if (b1 == b2) 
  8355.     return 3;
  8356.   return 2;
  8357. }
  8358.       
  8359.  
  8360. :ecgraphic.
  8361. .br
  8362. :font facename='Tms Rmn' size=18x10.
  8363. .br
  8364. LCLint Output:font facename=default size=0x0.
  8365. .br
  8366. .br
  8367. :cgraphic.
  8368. LCLint 2&per.2 --- 25 Aug 96
  8369.  
  8370. bool&per.c&colon. (in function f)
  8371. bool&per.c&colon.7,12&colon. Return value type bool does not match
  8372.                 declared type int&colon. b1
  8373.   To make bool and int types equivalent, use +boolint&per.
  8374. bool&per.c&colon.6,7&colon. Test expression for if is assignment
  8375.                expression&colon. i = 3
  8376.   The condition test is an assignment expression&per.
  8377.   Probably, you mean to use == instead of =&per. If an
  8378.   assignment is intended, add an extra parentheses
  8379.   nesting (e&per.g&per., if ((a = b)) &per.&per.&per.) to suppress this
  8380.   message&per. (-predassign will suppress message)
  8381. bool&per.c&colon.6,7&colon. Test expression for if not bool, type int&colon.
  8382.                i = 3
  8383.   Test expression type is not boolean or int&per.
  8384.   (-predboolint will suppress message)
  8385. bool&per.c&colon.8,8&colon. Operand of ! is non-boolean (int)&colon. !i
  8386.   The operand of a boolean operator is not a boolean&per.
  8387.   Use +ptrnegate to allow ! to be used on pointers&per.
  8388.   (-boolops will suppress message)
  8389. bool&per.c&colon.8,13&colon. Right operand of || is non-boolean (char
  8390.                 *)&colon. !i || s
  8391. bool&per.c&colon.10,7&colon. Test expression for if not bool, type
  8392.                 char *&colon. s
  8393.   Test expression type is not boolean&per. (-predboolptr
  8394.   will suppress message)
  8395. bool&per.c&colon.12,7&colon. Use of == with bool variables (risks
  8396.     inconsistency because of multiple true values)&colon.
  8397.     b1 == b2
  8398.   Two bool values are compared directly using a C
  8399.   primitive&per. This may produce unexpected results since
  8400.   all non-zero values are considered TRUE, so
  8401.   different TRUE values may not be equal&per. The file
  8402.   bool&per.h (included in lclint/lib) provides bool_equal
  8403.   for safe bool comparisons&per. (-boolcompare will
  8404.   suppress message)
  8405.  
  8406. Finished LCLint checking --- 7 code errors found
  8407. :ecgraphic.
  8408. :link reftype=hd res=27.
  8409. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  8410.  
  8411. :link reftype=hd res=2.David Evans:elink. 
  8412. .br
  8413. :link reftype=hd res=3.Systematic Program Development:elink.
  8414. .br
  8415. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  8416.  
  8417.  
  8418. .* Source filename: fig4.html
  8419. :h3 res=46.Figure 4&per.  Modifies checking&per.
  8420. :font facename=default size=0x0.
  8421. :p.
  8422.  
  8423.  
  8424. .br
  8425. :font facename='Tms Rmn' size=18x10.
  8426. .br
  8427. modify&per.c:font facename=default size=0x0.
  8428. .br
  8429. .br
  8430. :cgraphic.
  8431. void setx (int *x, int *y)
  8432.   /*@modifies *x@*/
  8433. {
  8434.   *y = *x;
  8435. }
  8436.  
  8437. void sety (int *x, int *y)   
  8438.    /*@modifies *y@*/
  8439. {   
  8440.    setx (y, x); 
  8441. }
  8442.  
  8443. :ecgraphic.
  8444. .br
  8445. :font facename='Tms Rmn' size=18x10.
  8446. .br
  8447. LCLint Output:font facename=default size=0x0.
  8448. .br
  8449. .br
  8450. :cgraphic.
  8451. LCLint 2&per.2 --- 25 Aug 96
  8452.  
  8453. modify&per.c&colon. (in function setx)
  8454. modify&per.c&colon.4,3&colon. Undocumented modification of *y&colon. *y = *x
  8455.   An externally-visible object is modified by a
  8456.   function, but not listed in its modifies clause&per.
  8457.   (-mods will suppress message)
  8458. modify&per.c&colon.5,1&colon. Suspect object listed in modifies of
  8459.                  setx not modified&colon. *x
  8460.   An object listed in the modifies clause is not
  8461.   modified by the implementation of the function&per. The
  8462.   modification may not be detected if it is done
  8463.   through a call to an unspecified function&per. (-mustmod
  8464.   will suppress message)
  8465.    modify&per.c&colon.1,6&colon. Declaration of setx
  8466. modify&per.c&colon.1,6&colon. Function setx exported but not declared
  8467.                  in header file
  8468.   A declaration is exported, but does not appear in a
  8469.   header file&per. (-exportheader will suppress message)
  8470.    modify&per.c&colon.5,1&colon. Definition of setx
  8471. modify&per.c&colon.7,6&colon. Function sety exported but not declared
  8472.                  in header file
  8473.    modify&per.c&colon.11,1&colon. Definition of sety
  8474.  
  8475. Finished LCLint checking --- 4 code errors found
  8476. :ecgraphic.
  8477. :link reftype=hd res=27.
  8478. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  8479.  
  8480. :link reftype=hd res=2.David Evans:elink. 
  8481. .br
  8482. :link reftype=hd res=3.Systematic Program Development:elink.
  8483. .br
  8484. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  8485.  
  8486.  
  8487. .* Source filename: fig5.html
  8488. :h3 res=47.Figure 5&per.  Globals checking&per.
  8489. :font facename=default size=0x0.
  8490. :p.
  8491.  
  8492.  
  8493. .br
  8494. :font facename='Tms Rmn' size=18x10.
  8495. .br
  8496. globals&per.c:font facename=default size=0x0.
  8497. .br
  8498. .br
  8499. :cgraphic.
  8500. int glob1, glob2;
  8501.  
  8502. int f (void) /*@globals glob1;@*/
  8503. {    
  8504.    return glob2; 
  8505. }
  8506. :ecgraphic.
  8507. .br
  8508. :font facename='Tms Rmn' size=18x10.
  8509. .br
  8510. LCLint Output:font facename=default size=0x0.
  8511. .br
  8512. .br
  8513. :cgraphic.
  8514. LCLint 2&per.2 --- 25 Aug 96
  8515.  
  8516. globals&per.c&colon. (in function f)
  8517. globals&per.c&colon.5,11&colon. Undocumented use of global glob2
  8518.   A checked global variable is used in the function,
  8519.   but not listed in its globals clause&per. By default,
  8520.   only globals specified in &per.lcl files are checked&per. To
  8521.   check all globals, use +allglobals&per. To check globals
  8522.   selectively use /*@checked@*/ in the global
  8523.   declaration&per. (-globs will suppress message)
  8524. globals&per.c&colon.3,5&colon. Global glob1 listed but not used
  8525.   A global variable listed in the function's globals
  8526.   list is not used in the body of the function&per.
  8527.   (-globuse will suppress message)
  8528. globals&per.c&colon.1,5&colon. Variable glob1 exported but not
  8529.                   declared in header file
  8530.   A variable declaration is exported, but does not
  8531.   appear in a header file&per. (Used with exportheader&per.)
  8532.   (-exportheadervar will suppress message)
  8533. globals&per.c&colon.1,12&colon. Variable glob2 exported but not
  8534.                    declared in header file
  8535. globals&per.c&colon.3,5&colon. Function f exported but not declared in
  8536.                   header file
  8537.   A declaration is exported, but does not appear in a
  8538.   header file&per. (-exportheader will suppress message)
  8539.    globals&per.c&colon.6,1&colon. Definition of f
  8540.  
  8541. Finished LCLint checking --- 5 code errors found
  8542. :ecgraphic.
  8543. :link reftype=hd res=27.
  8544. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  8545.  
  8546. :link reftype=hd res=2.David Evans:elink. 
  8547. .br
  8548. :link reftype=hd res=3.Systematic Program Development:elink.
  8549. .br
  8550. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  8551.  
  8552.  
  8553. .* Source filename: fig6.html
  8554. :h3 res=48.Figure 6&per.  Deallocation errors&per.
  8555. :font facename=default size=0x0.
  8556. :p.
  8557.  
  8558. .br
  8559. :font facename='Tms Rmn' size=18x10.
  8560. .br
  8561. only&per.c:font facename=default size=0x0.
  8562. .br
  8563. .br
  8564. :cgraphic.
  8565. extern /*@only@*/ int *glob;
  8566.  
  8567. /*@only@*/ int *
  8568.   f (/*@only@*/ int *x, int *y,
  8569.      int *z)
  8570.   /*@globals int *glob;@*/
  8571. {
  8572.   int *m = (int *)
  8573.     malloc (sizeof (int));
  8574.   
  8575.   glob = y;
  8576.   free (x);
  8577.   *m = *x;
  8578.   return z;
  8579. }
  8580.  
  8581. :ecgraphic.
  8582.  
  8583. .br
  8584. :font facename='Tms Rmn' size=18x10.
  8585. .br
  8586. LCLint Output:font facename=default size=0x0.
  8587. .br
  8588. .br
  8589. :cgraphic.
  8590. LCLint 2&per.2 --- 25 Aug 96
  8591.  
  8592. only&per.c&colon. (in function f)
  8593. only&per.c&colon.11,3&colon. Only storage glob not released before
  8594.                 assignment&colon. glob = y
  8595.   A memory leak has been detected&per. Newly-allocated or
  8596.   only-qualified storage is not released before the
  8597.   last reference to it is lost&per. (-mustfree will
  8598.   suppress message)
  8599.    only&per.c&colon.1,24&colon. Storage glob becomes only
  8600. only&per.c&colon.11,3&colon. Implicitly temp storage y assigned to
  8601.                 only&colon. glob = y
  8602.   Temp storage (associated with a formal parameter) is
  8603.   transferred to a non-temporary reference&per. The
  8604.   storage may be released or new aliases created&per.
  8605.   (-temptrans will suppress message)
  8606. only&per.c&colon.13,4&colon. Dereference of possibly null pointer m&colon.
  8607.                 *m
  8608.   A possibly null pointer is dereferenced&per.  Value is
  8609.   either the result of a function which may return
  8610.   null (in which case, code should check it is not
  8611.   null), or a global, parameter or structure field
  8612.   declared with the null qualifier&per. (-nullderef will
  8613.   suppress message)
  8614.    only&per.c&colon.8,12&colon. Storage m may become null
  8615. only&per.c&colon.13,9&colon. Variable x used after being released
  8616.   Memory is used after it has been released (either by
  8617.   passing as an only param or assigning to and only
  8618.   global&per. (-usereleased will suppress message)
  8619.    only&per.c&colon.12,9&colon. Storage x released
  8620. only&per.c&colon.14,10&colon. Implicitly temp storage z returned as
  8621.                  only&colon. z
  8622. only&per.c&colon.14,12&colon. Fresh storage m not released before
  8623.                  return
  8624.    only&per.c&colon.9,27&colon. Fresh storage m allocated
  8625.  
  8626. Finished LCLint checking --- 6 code errors found
  8627. :ecgraphic.
  8628. :link reftype=hd res=27.
  8629. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  8630.  
  8631. :link reftype=hd res=2.David Evans:elink. 
  8632. .br
  8633. :link reftype=hd res=3.Systematic Program Development:elink.
  8634. .br
  8635. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  8636.  
  8637.  
  8638. .* Source filename: fig7.html
  8639. :h3 res=49.Figure 7&per.  Stack references&per.
  8640. :font facename=default size=0x0.
  8641. :p.
  8642.  
  8643. .br
  8644. :font facename='Tms Rmn' size=18x10.
  8645. .br
  8646. stack&per.c:font facename=default size=0x0.
  8647. .br
  8648. .br
  8649. :cgraphic.
  8650. int *glob;
  8651.  
  8652. /*@dependent@*/
  8653. int *f (int **x)
  8654. {
  8655.   int sa[2] = { 0, 1 };
  8656.   int loc = 3;
  8657.  
  8658.   glob = &.loc;
  8659.   *x = &.sa[0];
  8660.  
  8661.   return &.loc; 
  8662. }
  8663.  
  8664. :ecgraphic.
  8665.  
  8666. .br
  8667. :font facename='Tms Rmn' size=18x10.
  8668. .br
  8669. LCLint Output:font facename=default size=0x0.
  8670. .br
  8671. .br
  8672. :cgraphic.
  8673. LCLint 2&per.2 --- 25 Aug 96
  8674.  
  8675. stack&per.c&colon. (in function f)
  8676. stack&per.c&colon.12,10&colon. Stack-allocated storage &.loc reachable
  8677.                   from return value&colon. &.loc
  8678.   A stack reference is pointed to by an external
  8679.   reference when the function returns&per. The
  8680.   stack-allocated storage is destroyed after the call,
  8681.   leaving a dangling reference&per. (-stackref will
  8682.   suppress message)
  8683. ;stack&per.c&colon.12,15&colon. Stack-allocated storage *x reachable
  8684.                   from parameter x
  8685.    stack&per.c&colon.10,3&colon. Storage *x becomes stack
  8686. stack&per.c&colon.12,15&colon. Stack-allocated storage glob reachable
  8687.                   from global glob
  8688.    stack&per.c&colon.9,3&colon. Storage glob becomes stack
  8689.  
  8690. Finished LCLint checking --- 3 code errors found
  8691. :ecgraphic.
  8692. :link reftype=hd res=27.
  8693. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  8694.  
  8695. :link reftype=hd res=2.David Evans:elink. 
  8696. .br
  8697. :link reftype=hd res=3.Systematic Program Development:elink.
  8698. .br
  8699. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  8700.  
  8701.  
  8702. .* Source filename: fig8.html
  8703. :h3 res=50.Figure 8&per.  Implicit Annotations&per.
  8704. :font facename=default size=0x0.
  8705. :p.
  8706.  
  8707. .br
  8708. :font facename='Tms Rmn' size=18x10.
  8709. .br
  8710. implicit&per.c:font facename=default size=0x0.
  8711. .br
  8712. .br
  8713. :cgraphic.
  8714. typedef struct {
  8715.   /* only */ char *name;  /* implicit only annotation if :link reftype=hd res=18.+structimponly:elink. */
  8716.   int val;
  8717. } *rec;
  8718.  
  8719. extern /* only */ rec rec_last ; /* implicit only
  8720. annotation if :link reftype=hd res=18.+globimponly:elink. */
  8721.  
  8722. extern /* only */ rec   /* implicit if :link reftype=hd res=18.+retimponly:elink. */
  8723.   rec_create (/* temp */ char *name, /* implicit if :link reftype=hd res=18.+paramimptemp:elink. */ 
  8724.               int val);
  8725. :ecgraphic.
  8726.  
  8727. .* Source filename: fig9.html
  8728. :h3 res=51.Figure 9&per.  Reference counting&per.
  8729. :font facename=default size=0x0.
  8730. :p.
  8731.  
  8732. .br
  8733. :font facename='Tms Rmn' size=18x10.
  8734. .br
  8735. rstring&per.c:font facename=default size=0x0.
  8736. .br
  8737. .br
  8738. :cgraphic.
  8739. #include ":link reftype=hd res=71.rstring&per.h:elink."
  8740.  
  8741. static rstring rstring_ref (rstring r)
  8742. {  
  8743.   r-&.gtrefs++;
  8744.   return r;
  8745. }
  8746.  
  8747. rstring rstring_first (rstring r1, rstring r2)
  8748. {
  8749.   if (strcmp (r1-&.gtcontents, r2-&.gtcontents) &.lt 0)    
  8750. ;    { 
  8751.       return r1;    
  8752.     }
  8753.   else 
  8754.     { 
  8755.       return rstring_ref (r2);    
  8756.     }
  8757. }
  8758. :ecgraphic.
  8759.  
  8760. .br
  8761. :font facename='Tms Rmn' size=18x10.
  8762. .br
  8763. LCLint Output:font facename=default size=0x0.
  8764. .br
  8765. .br
  8766. :cgraphic.
  8767. LCLint 2&per.2 --- 25 Aug 96
  8768.  
  8769. rstring&per.c&colon. (in function rstring_first)
  8770. rstring&per.c&colon.13,14&colon. Reference counted storage returned
  8771.     without modifying reference count&colon. r1
  8772.   Reference counted storage is transferred in a way
  8773.   that may not be consistent with the reference count&per.
  8774.   (-refcounttrans will suppress message)
  8775.  
  8776. Finished LCLint checking --- 1 code error found
  8777. :ecgraphic.
  8778. :link reftype=hd res=27.
  8779. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  8780.  
  8781. :link reftype=hd res=2.David Evans:elink. 
  8782. .br
  8783. :link reftype=hd res=3.Systematic Program Development:elink.
  8784. .br
  8785. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  8786.  
  8787.  
  8788. .* Source filename: rstring.h.html
  8789. :h4 res=71.rstring&per.h
  8790. :font facename=default size=0x0.
  8791. :p.
  8792.  
  8793. .br
  8794. :font facename='Tms Rmn' size=18x10.
  8795. .br
  8796. rstring&per.h:font facename=default size=0x0.
  8797. .br
  8798. .br
  8799. :cgraphic.
  8800. typedef /*@abstract@*/ /*@refcounted@*/ struct {
  8801.    /*@refs@*/ int refs;
  8802.    char *contents;
  8803. } *rstring;
  8804.  
  8805.  
  8806.  
  8807.  
  8808.  
  8809.  
  8810.  
  8811.  
  8812.  
  8813.  
  8814.  
  8815.  
  8816.  
  8817.  
  8818.  
  8819.  
  8820.  
  8821.  
  8822.  
  8823.  
  8824.  
  8825.  
  8826.  
  8827.  
  8828.  
  8829.  
  8830.  
  8831.  
  8832.  
  8833.  
  8834.  
  8835.  
  8836.  
  8837.  
  8838.  
  8839.  
  8840.  
  8841.  
  8842.  
  8843.  
  8844.  
  8845.  
  8846.  
  8847.  
  8848.  
  8849.  
  8850.  
  8851.  
  8852.  
  8853.  
  8854.  
  8855.  
  8856.  
  8857.  
  8858.  
  8859.  
  8860.  
  8861.  
  8862.  
  8863.  
  8864.  
  8865.  
  8866. :ecgraphic.
  8867.  
  8868.  
  8869.  
  8870.  
  8871. .* Source filename: fig10.html
  8872. :h3 res=52.Figure 10&per.  Unique parameters&per.
  8873. :font facename=default size=0x0.
  8874. :p.
  8875.  
  8876. .br
  8877. :font facename='Tms Rmn' size=18x10.
  8878. .br
  8879. unique&per.c:font facename=default size=0x0.
  8880. .br
  8881. .br
  8882. :cgraphic.
  8883. # include &.ltstring&per.h&.gt
  8884. void  
  8885. capitalize (/*@out@*/ char *s,
  8886.             char *t)
  8887. {
  8888.   strcpy (s, t);
  8889.   *s = toupper (*s);
  8890. }
  8891. :ecgraphic.
  8892. .br
  8893. :font facename='Tms Rmn' size=18x10.
  8894. .br
  8895. LCLint Output:font facename=default size=0x0.
  8896. .br
  8897. .br
  8898. :cgraphic.
  8899. LCLint 2&per.2 --- 25 Aug 96
  8900.  
  8901. unique&per.c&colon. (in function capitalize)
  8902. unique&per.c&colon.7,11&colon. Parameter 1 (s) to function strcpy is
  8903.     declared unique but may be aliased externally by
  8904.     parameter 2 (t)
  8905.   A unique or only parameter may be aliased by some
  8906.   other parameter or visible global&per. (-mayaliasunique
  8907.   will suppress message)
  8908.  
  8909. Finished LCLint checking --- 1 code error found
  8910. :ecgraphic.
  8911. :link reftype=hd res=27.
  8912. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  8913.  
  8914. :link reftype=hd res=2.David Evans:elink. 
  8915. .br
  8916. :link reftype=hd res=3.Systematic Program Development:elink.
  8917. .br
  8918. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  8919.  
  8920.  
  8921. .* Source filename: fig11.html
  8922. :h3 res=53.Figure 11&per.  Returned parameters&per.
  8923. :font facename=default size=0x0.
  8924. :p.
  8925.  
  8926. .br
  8927. :font facename='Tms Rmn' size=18x10.
  8928. .br
  8929. returned&per.c:font facename=default size=0x0.
  8930. .br
  8931. .br
  8932. :cgraphic.
  8933. #include ":link reftype=hd res=66.intSet&per.h:elink."
  8934.  
  8935. extern intSet intSet_insert  
  8936.    (/*@returned@*/ intSet s, int x);
  8937.  
  8938. /*
  8939. ** with returned, no error is reported, since the same
  8940. ** storage is returned from insert, and returned 
  8941. ** from intSet_singleton as an implicit only result&per.
  8942. */
  8943.  
  8944. intSet intSet_singleton (int x)
  8945. {
  8946.    return (intSet_insert (intSet_new (), x));
  8947.  }
  8948.  
  8949. /*
  8950. ** without returned&colon.
  8951. */
  8952.  
  8953. extern intSet intSet_insert2 (intSet s, int x);
  8954.  
  8955. intSet intSet_singleton2 (int x)
  8956. {
  8957.   return (intSet_insert2 (intSet_new (), x));
  8958. }
  8959. :ecgraphic.
  8960. .br
  8961. :font facename='Tms Rmn' size=18x10.
  8962. .br
  8963. LCLint Output:font facename=default size=0x0.
  8964. .br
  8965. .br
  8966. :cgraphic.
  8967. LCLint 2&per.2 --- 25 Aug 96
  8968.  
  8969. returned&per.c&colon. (in function intSet_singleton2)
  8970. returned&per.c&colon.25,27&colon. New fresh storage passed as
  8971.     implicitly temp (not released)&colon. intSet_new()
  8972.   A memory leak has been detected&per. Newly-allocated or
  8973.   only-qualified storage is not released before the
  8974.   last reference to it is lost&per. (-mustfree will
  8975.   suppress message)
  8976.  
  8977. Finished LCLint checking --- 1 code error found
  8978. :ecgraphic.
  8979. :link reftype=hd res=27.
  8980. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  8981.  
  8982. :link reftype=hd res=2.David Evans:elink. 
  8983. .br
  8984. :link reftype=hd res=3.Systematic Program Development:elink.
  8985. .br
  8986. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  8987.  
  8988.  
  8989. .* Source filename: intSet.h.html
  8990. :h4 res=66.intSet&per.h
  8991. :font facename=default size=0x0.
  8992. :p.
  8993.  
  8994. .br
  8995. :font facename='Tms Rmn' size=18x10.
  8996. .br
  8997. intSet&per.h:font facename=default size=0x0.
  8998. .br
  8999. .br
  9000. :cgraphic.
  9001. typedef /*@abstract@*/ struct
  9002. {
  9003.   int nelements;
  9004.   int *elements;
  9005. } *intSet ;
  9006.  
  9007. extern intSet intSet_new (void);
  9008.  
  9009.  
  9010.  
  9011.  
  9012.  
  9013.  
  9014.  
  9015.  
  9016.  
  9017.  
  9018.  
  9019.  
  9020.  
  9021.  
  9022.  
  9023.  
  9024.  
  9025.  
  9026.  
  9027.  
  9028.  
  9029.  
  9030.  
  9031.  
  9032.  
  9033.  
  9034.  
  9035.  
  9036.  
  9037.  
  9038.  
  9039.  
  9040.  
  9041.  
  9042.  
  9043.  
  9044.  
  9045.  
  9046.  
  9047.  
  9048.  
  9049.  
  9050.  
  9051.  
  9052.  
  9053.  
  9054.  
  9055.  
  9056.  
  9057.  
  9058.  
  9059.  
  9060.  
  9061.  
  9062.  
  9063.  
  9064.  
  9065.  
  9066.  
  9067.  
  9068. :ecgraphic.
  9069.  
  9070. .* Source filename: fig12.html
  9071. :h3 res=54.Figure 12&per.  Exposure checking&per.
  9072. :font facename=default size=0x0.
  9073. :p.
  9074.  
  9075. .br
  9076. :font facename='Tms Rmn' size=18x10.
  9077. .br
  9078. exposure&per.c:font facename=default size=0x0.
  9079. .br
  9080. .br
  9081. :cgraphic.
  9082. #include ":link reftype=hd res=67.employee&per.h:elink."
  9083.  
  9084. char *
  9085. employee_getName (employee e) 
  9086.   return e-&.gtname; 
  9087. }
  9088.  
  9089. /*@observer@*/ char *
  9090. employee_obsName (employee e) 
  9091. { return e-&.gtname; }
  9092.  
  9093. /*@exposed@*/ char *
  9094. employee_exposeName (employee e)
  9095. { return e-&.gtname; }
  9096.  
  9097. void 
  9098. employee_capName (employee e)
  9099. {
  9100.   char *name;
  9101.   
  9102.   name = employee_obsName (e);
  9103.   *name = toupper (*name);
  9104. }
  9105.  
  9106.  
  9107. :ecgraphic.
  9108. .br
  9109. :font facename='Tms Rmn' size=18x10.
  9110. .br
  9111. LCLint Output:font facename=default size=0x0.
  9112. .br
  9113. .br
  9114. :cgraphic.
  9115. LCLint 2&per.2 --- 25 Aug 96
  9116.  
  9117. exposure&per.c&colon. (in function employee_getName)
  9118. exposure&per.c&colon.6,10&colon. Function returns reference to
  9119.                     parameter e&colon. e->name
  9120.   The returned value shares storage with a parameter
  9121.   or global&per. If a parameter is to be returned, use the
  9122.   returned qualifier&per. If the result is not modified,
  9123.   use the observer qualifier on the result type&per.
  9124.   Otherwise, exposed can be used, but limited checking
  9125.   is done&per. (-retalias will suppress message)
  9126. exposure&per.c&colon.6,10&colon. Return value exposes rep of employee&colon.
  9127.                     e->name
  9128.   The return value shares storage with an instance of
  9129.   an abstract type&per. This means clients may have access
  9130.   to a pointer into the abstract representation&per. Use
  9131.   the observer qualifier to return exposed storage
  9132.   that may not be modified by the client&per. Use the
  9133.   exposed qualifier to return modifiable (but not
  9134.   deallocatable) exposed storage (dangerous)&per.
  9135.   (-retexpose will suppress message)
  9136. exposure&per.c&colon.6,18&colon. Released storage e->name reachable
  9137.                     from parameter at return point
  9138.   Memory is used after it has been released (either by
  9139.   passing as an only param or assigning to and only
  9140.   global&per. (-usereleased will suppress message)
  9141.    exposure&per.c&colon.6,10&colon. Storage e->name is released
  9142. exposure&per.c&colon. (in function employee_capName)
  9143. exposure&per.c&colon.23,3&colon. Suspect modification of observer
  9144.                     name&colon. *name = toupper(*name)
  9145.   Storage declared with observer is possibly modified&per.
  9146.   Observer storage may not be modified&per. (-modobserver
  9147.   will suppress message)
  9148. exposure&per.c&colon.4,1&colon. Function employee_getName exported but
  9149.                    not declared in header file
  9150.   A declaration is exported, but does not appear in a
  9151.   header file&per. (-exportheader will suppress message)
  9152.    exposure&per.c&colon.7,1&colon. Definition of employee_getName
  9153. exposure&per.c&colon.10,1&colon. Function employee_obsName exported
  9154.                     but not declared in header file
  9155.    exposure&per.c&colon.11,19&colon. Definition of employee_obsName
  9156. exposure&per.c&colon.14,1&colon. Function employee_exposeName exported
  9157.                     but not declared in header file
  9158.    exposure&per.c&colon.15,19&colon. Definition of employee_exposeName
  9159. exposure&per.c&colon.18,1&colon. Function employee_capName exported
  9160.                     but not declared in header file
  9161.    exposure&per.c&colon.24,1&colon. Definition of employee_capName
  9162.  
  9163. Finished LCLint checking --- 8 code errors found
  9164. :ecgraphic.
  9165. :link reftype=hd res=27.
  9166. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  9167.  
  9168. :link reftype=hd res=2.David Evans:elink. 
  9169. .br
  9170. :link reftype=hd res=3.Systematic Program Development:elink.
  9171. .br
  9172. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  9173.  
  9174.  
  9175. .* Source filename: employee.h.html
  9176. :h4 res=67.employee&per.h
  9177. :font facename=default size=0x0.
  9178. :p.
  9179.  
  9180. .br
  9181. :font facename='Tms Rmn' size=18x10.
  9182. .br
  9183. employee&per.h:font facename=default size=0x0.
  9184. .br
  9185. .br
  9186. :cgraphic.
  9187. typedef /*@abstract@*/ struct
  9188. {
  9189.   char *name;
  9190.   int *id;
  9191. } *employee;
  9192.  
  9193.  
  9194.  
  9195.  
  9196.  
  9197.  
  9198.  
  9199.  
  9200.  
  9201.  
  9202.  
  9203.  
  9204.  
  9205.  
  9206.  
  9207.  
  9208.  
  9209.  
  9210.  
  9211.  
  9212.  
  9213.  
  9214.  
  9215.  
  9216.  
  9217.  
  9218.  
  9219.  
  9220.  
  9221.  
  9222.  
  9223.  
  9224.  
  9225.  
  9226.  
  9227.  
  9228.  
  9229.  
  9230.  
  9231.  
  9232.  
  9233.  
  9234.  
  9235.  
  9236.  
  9237.  
  9238.  
  9239.  
  9240.  
  9241.  
  9242.  
  9243.  
  9244.  
  9245.  
  9246.  
  9247.  
  9248.  
  9249.  
  9250.  
  9251.  
  9252. :ecgraphic.
  9253.  
  9254. .* Source filename: fig13.html
  9255. :h3 res=55.Figure 13&per.  Use before definition&per.
  9256. :font facename=default size=0x0.
  9257. :p.
  9258.  
  9259. .br
  9260. :font facename='Tms Rmn' size=18x10.
  9261. .br
  9262. usedef&per.c:font facename=default size=0x0.
  9263. .br
  9264. .br
  9265. :cgraphic.
  9266. extern void 
  9267.   setVal (/*@out@*/ int *x);
  9268. extern int 
  9269.   getVal (/*@in@*/ int *x);
  9270. extern int mysteryVal (int *x);
  9271.  
  9272. int 
  9273. dumbfunc (/*@out@*/ int *x, int i)
  9274. {
  9275.   if (i &.gt 3) 
  9276. ;    return *x;
  9277.   else if (i &.gt 1) 
  9278. ;    return getVal (x);
  9279.   else if (i == 0) 
  9280.     return mysteryVal (x);
  9281.   else
  9282.     { 
  9283.       setVal (x);
  9284.       return *x;
  9285.     }     
  9286. }
  9287. :ecgraphic.
  9288. .br
  9289. :font facename='Tms Rmn' size=18x10.
  9290. .br
  9291. LCLint Output:font facename=default size=0x0.
  9292. .br
  9293. .br
  9294. :cgraphic.
  9295. LCLint 2&per.2 --- 25 Aug 96
  9296.  
  9297. usedef&per.c&colon. (in function dumbfunc)
  9298. usedef&per.c&colon.11,12&colon. Value *x used before definition
  9299.   An rvalue is used that may not be initialized to a
  9300.   value on some execution path&per. (-usedef will suppress
  9301.   message)
  9302. usedef&per.c&colon.13,20&colon. Passed storage x not completely
  9303.     defined (*x is undefined)&colon. getVal (x)
  9304.   Storage derivable from a parameter, return value or
  9305.   global is not defined&per. Use /*@out@*/ to denote
  9306.   passed or returned storage which need not be
  9307.   defined&per. (-compdef will suppress message)
  9308. usedef&per.c&colon.15,24&colon. Passed storage x not completely
  9309.     defined (*x is undefined)&colon. mysteryVal (x)
  9310.  
  9311. Finished LCLint checking --- 3 code errors found
  9312. :ecgraphic.
  9313. :link reftype=hd res=27.
  9314. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  9315.  
  9316. :link reftype=hd res=2.David Evans:elink. 
  9317. .br
  9318. :link reftype=hd res=3.Systematic Program Development:elink.
  9319. .br
  9320. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  9321.  
  9322.  
  9323. .* Source filename: fig14.html
  9324. :h3 res=56.Figure 14&per.  Annotated Globals Lists&per.
  9325. :font facename=default size=0x0.
  9326. :p.
  9327.  
  9328. .br
  9329. :font facename='Tms Rmn' size=18x10.
  9330. .br
  9331. annotglobs&per.c:font facename=default size=0x0.
  9332. .br
  9333. .br
  9334. :cgraphic.
  9335. int globnum;
  9336.  
  9337. struct { 
  9338.   char *firstname;
  9339.   char *lastname;
  9340.   int id; 
  9341. } globname;
  9342.  
  9343. void 
  9344. initialize (/*@only@*/ char *name)
  9345.   /*@globals undef globnum,
  9346.              undef globname @*/
  9347. {
  9348.   globname&per.id = globnum;
  9349.   globname&per.lastname = name;
  9350. }
  9351.  
  9352. void finalize (void)
  9353.    /*@globals killed globname@*/
  9354. {
  9355.   free (globname&per.lastname);
  9356. }
  9357. :ecgraphic.
  9358. .br
  9359. :font facename='Tms Rmn' size=18x10.
  9360. .br
  9361. LCLint Output:font facename=default size=0x0.
  9362. .br
  9363. .br
  9364. :cgraphic.
  9365. LCLint 2&per.2 --- 25 Aug 96
  9366.  
  9367. annotglobs&per.c&colon. (in function initialize)
  9368. annotglobs&per.c&colon.14,17&colon. Undef global globnum used before
  9369.                        definition
  9370.   An rvalue is used that may not be initialized to a
  9371.   value on some execution path&per. (-usedef will suppress
  9372.   message)
  9373. annotglobs&per.c&colon.16,2&colon. Global storage globname contains 1
  9374.     undefined field when call returns&colon. firstname
  9375.   Storage derivable from a parameter, return value or
  9376.   global is not defined&per. Use /*@out@*/ to denote
  9377.   passed or returned storage which need not be
  9378.   defined&per. (-compdef will suppress message)
  9379. annotglobs&per.c&colon. (in function finalize)
  9380. annotglobs&per.c&colon.22,2&colon. Only storage globname&per.firstname
  9381.     (type char *) derived from killed global is not
  9382.     released (memory leak)
  9383.   A storage leak due to incomplete deallocation of a
  9384.   structure or deep pointer is suspected&per. Unshared
  9385.   storage that is reachable from a reference that is
  9386.   being deallocated has not yet been deallocated&per.
  9387.   LCLint assumes when an object is passed as an out
  9388.   only void pointer that the outer object will be
  9389.   deallocated, but the inner objects will not&per.
  9390.   (-compdestroy will suppress message)
  9391.  
  9392. Finished LCLint checking --- 3 code errors found
  9393. :ecgraphic.
  9394. :link reftype=hd res=27.
  9395. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  9396.  
  9397. :link reftype=hd res=2.David Evans:elink. 
  9398. .br
  9399. :link reftype=hd res=3.Systematic Program Development:elink.
  9400. .br
  9401. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  9402.  
  9403.  
  9404. .* Source filename: fig15.html
  9405. :h3 res=57.Figure 15&per.  Null checking&per.
  9406. :font facename=default size=0x0.
  9407. :p.
  9408.  
  9409. .br
  9410. :font facename='Tms Rmn' size=18x10.
  9411. .br
  9412. null&per.c:font facename=default size=0x0.
  9413. .br
  9414. .br
  9415. :cgraphic.
  9416. char firstChar1 (/*@null@*/ char *s)
  9417. {
  9418.   return *s;
  9419. }
  9420.  
  9421. char firstChar2 (/*@null@*/ char *s)
  9422. {
  9423.   if (s == NULL) return '\0';
  9424.   return *s;
  9425. }
  9426. :ecgraphic.
  9427. .br
  9428. :font facename='Tms Rmn' size=18x10.
  9429. .br
  9430. LCLint Output:font facename=default size=0x0.
  9431. .br
  9432. .br
  9433. :cgraphic.
  9434. LCLint 2&per.2 --- 25 Aug 96
  9435.  
  9436. null&per.c&colon. (in function firstChar1)
  9437. null&per.c&colon.3,11&colon. Dereference of possibly null pointer s&colon.
  9438.                 *s
  9439.   A possibly null pointer is dereferenced&per.  Value is
  9440.   either the result of a function which may return
  9441.   null (in which case, code should check it is not
  9442.   null), or a global, parameter or structure field
  9443.   declared with the null qualifier&per. (-nullderef will
  9444.   suppress message)
  9445.    null&per.c&colon.1,35&colon. Storage s may become null
  9446.  
  9447. Finished LCLint checking --- 1 code error found
  9448. :ecgraphic.
  9449. :link reftype=hd res=27.
  9450. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  9451.  
  9452. :link reftype=hd res=2.David Evans:elink. 
  9453. .br
  9454. :link reftype=hd res=3.Systematic Program Development:elink.
  9455. .br
  9456. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  9457.  
  9458. .* Source filename: fig16.html
  9459. :h3 res=58.Figure 16&per.  Using notnull&per.
  9460. :font facename=default size=0x0.
  9461. :p.
  9462.  
  9463. .br
  9464. :font facename='Tms Rmn' size=18x10.
  9465. .br
  9466. mstringnn&per.c:font facename=default size=0x0.
  9467. .br
  9468. .br
  9469. :cgraphic.
  9470. typedef /*@abstract@*/ /*@null@*/ char *mstring;
  9471.  
  9472. static mstring mstring_createNew (int x) ;
  9473.  
  9474. mstring mstring_space1 (void)
  9475. {
  9476.   mstring m = mstring_createNew (1);
  9477.  
  9478.   /* error, since m could be NULL */
  9479.   *m = ' '; *(m + 1) = '\0';
  9480.   return m;
  9481. }
  9482.  
  9483. static /*@notnull@*/ mstring mstring_createNewNN (int x) ;
  9484.  
  9485. mstring mstring_space2 (void)
  9486. {
  9487.   mstring m = mstring_createNewNN (1);
  9488.  
  9489.   /* no error, because of notnull annotation */
  9490.   *m = ' '; *(m + 1) = '\0';
  9491.   return m;
  9492. }
  9493. :ecgraphic.
  9494. .br
  9495. :font facename='Tms Rmn' size=18x10.
  9496. .br
  9497. LCLint Output:font facename=default size=0x0.
  9498. .br
  9499. .br
  9500. :cgraphic.
  9501. LCLint 2&per.2 --- 25 Aug 96
  9502.  
  9503. mstringnn&per.c&colon. (in function mstring_space1)
  9504. mstringnn&per.c&colon.10,4&colon. Dereference of possibly null pointer
  9505.                      m&colon. *m
  9506.   A possibly null pointer is dereferenced&per.  Value is
  9507.   either the result of a function which may return
  9508.   null (in which case, code should check it is not
  9509.   null), or a global, parameter or structure field
  9510.   declared with the null qualifier&per. (-nullderef will
  9511.   suppress message)
  9512.    mstringnn&per.c&colon.7,15&colon. Storage m may become null
  9513.  
  9514. Finished LCLint checking --- 1 code error found
  9515. :ecgraphic.
  9516. :link reftype=hd res=27.
  9517. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  9518.  
  9519. :link reftype=hd res=2.David Evans:elink. 
  9520. .br
  9521. :link reftype=hd res=3.Systematic Program Development:elink.
  9522. .br
  9523. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  9524.  
  9525.  
  9526.  
  9527. .* Source filename: fig17.html
  9528. :h3 res=59.Figure 17&per.  Special Clauses
  9529. :font facename=default size=0x0.
  9530. :p.
  9531.  
  9532. .br
  9533. :font facename='Tms Rmn' size=18x10.
  9534. .br
  9535. special&per.c:font facename=default size=0x0.
  9536. .br
  9537. .br
  9538. :cgraphic.
  9539. typedef struct 
  9540. {
  9541.   int id;
  9542.   /*@only@*/ char *name;
  9543. } *record;
  9544.  
  9545. static /*@special@*/ record record_new (void)
  9546.   /*@defines result->id@*/
  9547. {
  9548.   record r = (record) malloc (sizeof (*r));
  9549.  
  9550.   assert (r != NULL);
  9551.   r->id = 3;
  9552.   return r;
  9553. }
  9554.  
  9555. static void record_setName (/*@special@*/ record r, /*@only@*/ char *name)
  9556.    /*@defines r->name@*/
  9557. {
  9558.   r->name = name;
  9559. }
  9560.  
  9561. record record_create (/*@only@*/ char *name)
  9562. {
  9563.   record r = record_new ();
  9564.   record_setName (r, name);
  9565.   return r;
  9566. }
  9567.  
  9568. void record_clearName (/*@special@*/ record r)
  9569.    /*@releases r->name@*/
  9570.    /*@post&colon.isnull r->name@*/
  9571. {
  9572.   free (r->name);
  9573.   r->name = NULL;
  9574. }
  9575.  
  9576. void record_free (/*@only@*/ record r)
  9577. {
  9578.   record_clearName (r);
  9579.   free (r);
  9580. }
  9581.  
  9582.  
  9583.  
  9584.  
  9585.  
  9586. :ecgraphic.
  9587. :link reftype=hd res=27.
  9588. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  9589.  
  9590. :link reftype=hd res=2.David Evans:elink. 
  9591. .br
  9592. :link reftype=hd res=3.Systematic Program Development:elink.
  9593. .br
  9594. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  9595.  
  9596.  
  9597. .* Source filename: fig18.html
  9598. :h3 res=60.Figure 18&per.  Naming Checks
  9599. :font facename=default size=0x0.
  9600. :p.
  9601.  
  9602. .br
  9603. :font facename='Tms Rmn' size=18x10.
  9604. .br
  9605. names&per.c:font facename=default size=0x0.
  9606. .br
  9607. .br
  9608. :cgraphic.
  9609. char *stringreverse (char *s);
  9610.  
  9611. int f (int x)
  9612. {
  9613.   int lookalike = 1;
  9614.   int looka1ike = 2;
  9615.  
  9616.   if (x &.gt 3)
  9617. ;    {
  9618.       int x = lookalike;
  9619.       x += looka1ike;
  9620.     }
  9621.  
  9622.   return x;
  9623. }
  9624. :ecgraphic.
  9625. .br
  9626. :font facename='Tms Rmn' size=18x10.
  9627. .br
  9628. LCLint Output:font facename=default size=0x0.
  9629. .br
  9630. .br
  9631. :cgraphic.
  9632. LCLint 2&per.2 --- 25 Aug 96
  9633.  
  9634. names&per.c&colon.1,7&colon. Name stringreverse is reserved for future
  9635.     ANSI library extensions&per.  Functions that begin
  9636.     with "str" and a lowercase letter may be added to
  9637.      or &per. (See ANSI, Section
  9638.     4&per.13&per.7)
  9639.   External name is reserved for system in ANSI
  9640.   standard&per. (-ansireserved will suppress message)
  9641. names&per.c&colon. (in function f)
  9642. names&per.c&colon.6,7&colon. Internal identifier looka1ike is not
  9643.     distinguishable from lookalike except by lookalike
  9644.     characters
  9645.   An internal name is not distinguishable from another
  9646.   internal name using the number of significant
  9647.   characters&per. According to ANSI Standard (3&per.1), an
  9648.   implementation may only consider the first 31
  9649.   characters significant&per. The +internalnamelen 
  9650.   flag changes the number of significant characters,
  9651.   -internalnamecaseinsensitive to makes alphabetical
  9652.   case significant, and +internalnamelookalike to make
  9653.   similar-looking characters non-distinct&per.
  9654.   (-distinctinternalnames will suppress message)
  9655.    names&per.c&colon.5,7&colon. Declaration of lookalike
  9656. names&per.c&colon.10,11&colon. Variable x shadows outer declaration
  9657.   An outer declaration is shadowed by the local
  9658.   declaration&per. (-shadow will suppress message)
  9659.    names&per.c&colon.3,12&colon. Previous declaration of x&colon. int
  9660.  
  9661. Finished LCLint checking --- 3 code errors found
  9662. :ecgraphic.
  9663. :link reftype=hd res=27.
  9664. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  9665.  
  9666. :link reftype=hd res=2.David Evans:elink. 
  9667. .br
  9668. :link reftype=hd res=3.Systematic Program Development:elink.
  9669. .br
  9670. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  9671.  
  9672.  
  9673. .* Source filename: fig19.html
  9674. :h3 res=61.Figure 19&per.  Evaluation Order
  9675. :font facename=default size=0x0.
  9676. :p.
  9677.  
  9678. .br
  9679. :font facename='Tms Rmn' size=18x10.
  9680. .br
  9681. order&per.c:font facename=default size=0x0.
  9682. .br
  9683. .br
  9684. :cgraphic.
  9685. extern int glob;
  9686.  
  9687. extern int mystery (void);
  9688.  
  9689. extern int modglob (void)
  9690.    /*@globals glob@*/
  9691.    /*@modifies glob@*/ ;
  9692.  
  9693. int f (int x, int y[])
  9694. {
  9695.   int i = x++ * x;
  9696.  
  9697.   y[i] = i++;
  9698.   i += modglob() * glob;
  9699.   i += mystery() * glob;
  9700.   return i;
  9701. }
  9702. :ecgraphic.
  9703. .br
  9704. :font facename='Tms Rmn' size=18x10.
  9705. .br
  9706. LCLint Output:font facename=default size=0x0.
  9707. .br
  9708. .br
  9709. :cgraphic.
  9710. LCLint 2&per.2 --- 25 Aug 96
  9711.  
  9712. order&per.c&colon. (in function f)
  9713. order&per.c&colon.11,17&colon. Expression has undefined behavior
  9714.     (value of right operand modified by left operand)&colon.
  9715.     x++ * x
  9716.   Code has unspecified behavior&per. Order of evaluation
  9717.   of function parameters or subexpressions is not
  9718.   defined, so if a value is used and modified in
  9719.   different places not separated by a sequence point
  9720.   constraining evaluation order, then the result of
  9721.   the expression is unspecified&per. (-evalorder will
  9722.   suppress message)
  9723. order&per.c&colon.13,11&colon. Expression has undefined behavior (left
  9724.     operand uses i, modified by right operand)&colon.
  9725.     y[i] = i++
  9726. order&per.c&colon.14,20&colon. Expression has undefined behavior
  9727.     (value of right operand modified by left operand)&colon.
  9728.     modglob() * glob
  9729. order&per.c&colon.15,20&colon. Expression has undefined behavior
  9730.     (unconstrained function mystery used in left
  9731.     operand may set global variable glob used in right
  9732.     operand)&colon. mystery() * glob
  9733.   Code involving a call to function with no modifies
  9734.   or globals clause may have undefined or
  9735.   implementation-dependent behavior (LCLint assumes
  9736.   the unconstrained call may modify any reachable
  9737.   state or use any global)&per. Add a specification for
  9738.   the function&per. (-evalorderuncon will suppress
  9739.   message)
  9740.  
  9741. Finished LCLint checking --- 4 code errors found
  9742. :ecgraphic.
  9743. :link reftype=hd res=27.
  9744. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  9745.  
  9746. :link reftype=hd res=2.David Evans:elink. 
  9747. .br
  9748. :link reftype=hd res=3.Systematic Program Development:elink.
  9749. .br
  9750. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  9751.  
  9752.  
  9753.  
  9754. .* Source filename: fig20.html
  9755. :h3 res=62.Figure 20&per.  Infinite loop checking
  9756. :font facename=default size=0x0.
  9757. :p.
  9758.  
  9759. .br
  9760. :font facename='Tms Rmn' size=18x10.
  9761. .br
  9762. loop&per.c:font facename=default size=0x0.
  9763. .br
  9764. .br
  9765. :cgraphic.
  9766. extern int glob1, glob2;
  9767.  
  9768. extern int f (void) 
  9769.   /*@globals glob1@*/ 
  9770.   /*@modifies nothing@*/ ;
  9771.  
  9772. extern void g (void) 
  9773.   /*@modifies glob2@*/ ;
  9774.  
  9775. extern void h (void) ; 
  9776.  
  9777. void upto (int x) 
  9778. {
  9779.   while (x &.gt f()) g();
  9780.   while (f() &.lt 3) h();
  9781. }
  9782. :ecgraphic.
  9783. .br
  9784. :font facename='Tms Rmn' size=18x10.
  9785. .br
  9786. LCLint Output:font facename=default size=0x0.
  9787. .br
  9788. .br
  9789. :cgraphic.
  9790. LCLint 2&per.2 --- 25 Aug 96
  9791.  
  9792. loop&per.c&colon. (in function upto)
  9793. loop&per.c&colon.14,10&colon. Suspected infinite loop&per.  No value used
  9794.     in loop test (x, glob1) is modified by test or
  9795.     loop body&per.
  9796.   This appears to be an infinite loop&per. Nothing in the
  9797.   body of the loop or the loop test modifies the value
  9798.   of the loop test&per. Perhaps the specification of a
  9799.   function called in the loop body is missing a
  9800.   modification&per. (-infloops will suppress message)
  9801.  
  9802. Finished LCLint checking --- 1 code error found
  9803. :ecgraphic.
  9804. :link reftype=hd res=27.
  9805. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  9806.  
  9807. :link reftype=hd res=2.David Evans:elink. 
  9808. .br
  9809. :link reftype=hd res=3.Systematic Program Development:elink.
  9810. .br
  9811. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  9812.  
  9813.  
  9814. .* Source filename: fig21.html
  9815. :h3 res=63.Figure 21&per.  Switch checking&per.
  9816. :font facename=default size=0x0.
  9817. :p.
  9818.  
  9819. .br
  9820. :font facename='Tms Rmn' size=18x10.
  9821. .br
  9822. switch&per.c:font facename=default size=0x0.
  9823. .br
  9824. .br
  9825. :cgraphic.
  9826. typedef enum {
  9827.   YES, NO, DEFINITELY,
  9828.   PROBABLY, MAYBE } ynm;
  9829.  
  9830. void decide (ynm y)
  9831. {
  9832.   switch (y)
  9833.     {
  9834.     case PROBABLY&colon.
  9835.     case NO&colon. printf ("No!");
  9836.     case MAYBE&colon. printf ("Maybe");    
  9837.          /*@fallthrough@*/
  9838.     case YES&colon. printf ("Yes!");
  9839.     }
  9840. }
  9841. :ecgraphic.
  9842. .br
  9843. :font facename='Tms Rmn' size=18x10.
  9844. .br
  9845. LCLint Output:font facename=default size=0x0.
  9846. .br
  9847. .br
  9848. :cgraphic.
  9849. LCLint 2&per.2 --- 25 Aug 96
  9850.  
  9851. noeffect&per.c&colon. (in function noeffect)
  9852. noeffect&per.c&colon.6,3&colon. Statement has no effect&colon. y == *x
  9853.   Statement has no visible effect --- no values are
  9854.   modified&per. (-noeffect will suppress message)
  9855. noeffect&per.c&colon.7,3&colon. Statement has no effect&colon. nomodcall(x)
  9856. noeffect&per.c&colon.8,3&colon. Statement has no effect (possible
  9857.     undected modification through call to
  9858.     unconstrained function mysterycall)&colon.
  9859.     mysterycall(x)
  9860.   Statement has no visible effect --- no values are
  9861.   modified&per. It may modify something through a call to
  9862.   an unconstrained function&per. (-noeffectuncon will
  9863.   suppress message)
  9864.  
  9865. Finished LCLint checking --- 3 code errors found
  9866. :ecgraphic.
  9867. :link reftype=hd res=27.
  9868. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  9869.  
  9870. :link reftype=hd res=2.David Evans:elink. 
  9871. .br
  9872. :link reftype=hd res=3.Systematic Program Development:elink.
  9873. .br
  9874. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  9875.  
  9876.  
  9877. .* Source filename: fig22.html
  9878. :h3 res=64.Figure 22&per.  Statements with no effect&per.
  9879. :font facename=default size=0x0.
  9880. :p.
  9881.  
  9882. .br
  9883. :font facename='Tms Rmn' size=18x10.
  9884. .br
  9885. noeffect&per.c:font facename=default size=0x0.
  9886. .br
  9887. .br
  9888. :cgraphic.
  9889. extern void nomodcall (int *x) /*@*/;
  9890. extern void mysterycall (int *x);
  9891.  
  9892. int noeffect (int *x, int y)
  9893. {
  9894.   y == *x;
  9895.   nomodcall (x);  
  9896.   mysterycall (x); 
  9897.   return *x;
  9898. }
  9899. :ecgraphic.
  9900. .br
  9901. :font facename='Tms Rmn' size=18x10.
  9902. .br
  9903. LCLint Output:font facename=default size=0x0.
  9904. .br
  9905. .br
  9906. :cgraphic.
  9907. LCLint 2&per.2 --- 25 Aug 96
  9908.  
  9909. noeffect&per.c&colon. (in function noeffect)
  9910. noeffect&per.c&colon.6,3&colon. Statement has no effect&colon. y == *x
  9911.   Statement has no visible effect --- no values are
  9912.   modified&per. (-noeffect will suppress message)
  9913. noeffect&per.c&colon.7,3&colon. Statement has no effect&colon. nomodcall(x)
  9914. noeffect&per.c&colon.8,3&colon. Statement has no effect (possible
  9915.     undected modification through call to
  9916.     unconstrained function mysterycall)&colon.
  9917.     mysterycall(x)
  9918.   Statement has no visible effect --- no values are
  9919.   modified&per. It may modify something through a call to
  9920.   an unconstrained function&per. (-noeffectuncon will
  9921.   suppress message)
  9922.  
  9923. Finished LCLint checking --- 3 code errors found
  9924. :ecgraphic.
  9925. :link reftype=hd res=27.
  9926. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  9927.  
  9928. :link reftype=hd res=2.David Evans:elink. 
  9929. .br
  9930. :link reftype=hd res=3.Systematic Program Development:elink.
  9931. .br
  9932. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  9933.  
  9934.  
  9935. /html>
  9936.  
  9937. .* Source filename: fig23.html
  9938. :h3 res=65.Figure 23&per.  Ignored return values&per.
  9939. :font facename=default size=0x0.
  9940. :p.
  9941.  
  9942. .br
  9943. :font facename='Tms Rmn' size=18x10.
  9944. .br
  9945. ignore&per.c:font facename=default size=0x0.
  9946. .br
  9947. .br
  9948. :cgraphic.
  9949. extern int fi (void);
  9950. extern bool fb (void);
  9951. extern int /*@alt void@*/ 
  9952.   fv (void);
  9953.  
  9954. int ignore (void)
  9955. {
  9956.   fi ();                
  9957.   (void) fi ();
  9958.   fb ();
  9959.   fv ();
  9960.   return fv ();
  9961. }
  9962. :ecgraphic.
  9963. .br
  9964. :font facename='Tms Rmn' size=18x10.
  9965. .br
  9966. LCLint Output:font facename=default size=0x0.
  9967. .br
  9968. .br
  9969. :cgraphic.
  9970. LCLint 2&per.0 --- 28 Feb 96
  9971.  
  9972. ignore&per.c&colon. (in function ignore)
  9973. ignore&per.c&colon.8,3&colon. Return value (type int) ignored&colon. fi()
  9974.   Result returned by function call is not used&per.  If
  9975.   this is intended, can cast result to (void) to
  9976.   eliminate message&per.  Use -retvalint to suppress
  9977.   message&per.
  9978. ignore&per.c&colon.10,3&colon. Return value (type bool) ignored&colon. fb()
  9979.   Result returned by function call is not used&per.  If
  9980.   this is intended, can cast result to (void) to
  9981.   eliminate message&per.  Use -retvalbool to suppress
  9982.   message&per.
  9983.  
  9984. Finished LCLint checking --- 2 code errors found
  9985. :ecgraphic.
  9986. :link reftype=hd res=27.
  9987. :elink.:artwork name='lclint-home-small.bmp' align=left.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.
  9988.  
  9989. :link reftype=hd res=2.David Evans:elink. 
  9990. .br
  9991. :link reftype=hd res=3.Systematic Program Development:elink.
  9992. .br
  9993. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  9994.  
  9995.  
  9996.  
  9997. .* Source filename: references.html
  9998. :h2 res=25.LCLint User's Guide - References
  9999. :font facename=default size=0x0.
  10000. :p.
  10001.  
  10002.  
  10003. .br
  10004. :font facename='Helv' size=20x12.
  10005. .br
  10006. References
  10007. :font facename=default size=0x0.
  10008. .br
  10009. .br
  10010. .br
  10011. :font facename='Tms Rmn' size=16x8.
  10012. .br
  10013. LCLint:font facename=default size=0x0.
  10014. .br
  10015. .br
  10016.  
  10017. [Evans94]
  10018. David Evans&per. :link reftype=hd res=73.:hp1.Using specifications to check source code:ehp1.:elink.&per.
  10019. MIT/LCS/TR 628, Laboratory for Computer Science, MIT, June 1994&per.
  10020. :p.
  10021. :p.
  10022. SM Thesis&per.  Describes research behind LCLint, focusing on how specifications
  10023. can be exploited to do lightweight checking&per.  Includes case studies using
  10024. LCLint&per.
  10025.  
  10026. :p.
  10027.  
  10028. [EGHT94]
  10029. David Evans, John Guttag, Jim Horning and Yang Meng Tan&per.  
  10030. :link reftype=hd res=72.:hp1.LCLint&colon. A
  10031. tool for using specifications to check code:ehp1.:elink.&per.  SIGSOFT Symposium on the
  10032. Foundations of Software Engineering, December 1994&per.
  10033. :p.
  10034. :p.
  10035. Introduction to LCLint&per.  Shows how LCLint is used to find errors in a sample
  10036. program&per.
  10037.  
  10038. :p.
  10039.  
  10040. [Evans96]
  10041. David Evans&per.  
  10042. :link reftype=hd res=68.
  10043. :hp1.Static Detection of Dynamic Memory Errors:ehp1.:elink.&per.  In SIGPLAN Conference on Programming Language Design and Implementation
  10044. (PLDI '96), Philadelphia, PA&per., May 1996&per.
  10045. :p.
  10046. :p.
  10047. Describes approach for exploiting annotations added to code to detect a wide
  10048. class of errors&per.  Focuses on checks described in Sections 5-7 of this guide&per.  
  10049.  
  10050. .br
  10051. :font facename='Tms Rmn' size=16x8.
  10052. .br
  10053. Larch:font facename=default size=0x0.
  10054. .br
  10055. .br
  10056.  
  10057. [GH93] Guttag, John V&per. and Horning, James J&per., with Stephen J&per. Garland, Kevin D&per.
  10058. Jones, Andr╔s Modet, and Jeannette M&per. Wing, :hp5.Larch&colon. Languages and
  10059. Tools for Formal Specification:ehp5., Springer-Verlag, Texts and Monographs in
  10060. Computer Science, 1993&per.
  10061. :p.
  10062. :p.
  10063. Overview of the Larch family of specification languages and related tools&per.
  10064. Includes a chapter on LCL, the Larch C interface language, on which LCLint is
  10065. based&per.
  10066.  
  10067. :p.
  10068.  
  10069. [Tan95] Tan, Yang Meng&per.  :hp5.Formal Specification Techniques for
  10070. Engineering Modular C:ehp5., Kluwer International Series in Software
  10071. Engineering, Volume 1, Kluwer Academic Publishers, Boston, 1995&per.
  10072. :p.
  10073. :p.
  10074. Modified and updated version of MIT Ph&per. D&per. dissertation, previously
  10075. published as MIT/LCS/TR-619, 1994&per.  Includes presentation of the
  10076. semantics of LCL and a case study using LCL&per.
  10077.  
  10078. .br
  10079. :font facename='Tms Rmn' size=16x8.
  10080. .br
  10081. C:font facename=default size=0x0.
  10082. .br
  10083. .br
  10084.  
  10085. [ANSI] American National Standard for Information Systems, Programming
  10086. Language, C&per.  ANSI X3&per.159-1989&per.  (Believed to be identical to ISO/IEC
  10087. 9899&colon.1990)&per.  
  10088. :p.
  10089. Specification for C programming language&per.  LCLint aims to be consistent with
  10090. this
  10091. document&per.
  10092.  
  10093.  
  10094.  
  10095. [Hat95] Hatton, Les&per.  :hp5.Safer C&colon. Developing Software for High-integrity and
  10096. Safety-critical
  10097. Systems&per.:ehp5.
  10098. McGraw-Hill International Series in Software Engineering, 1995&per.
  10099. :p.
  10100. A broad work on all aspects of developing safety-critical software, focusing on
  10101. the C language&per.  Provides good justification for the use of C in
  10102. safety-critical systems, and the necessity of tool-supported programming
  10103. standards&per.  LCLint users will be interested to see how many of the errors
  10104. listed as only being dynamically detectable can be detected statically by
  10105. LCLint&per.
  10106.  
  10107.  
  10108.  
  10109. [KR88] Kernighan, Brian W&per. and Ritchie, Dennis M&per.  :hp5.The C Programming
  10110. Language:ehp5., second edition&per.  Prentice Hall, New Jersey, 1988&per.
  10111. :p.
  10112. Standard reference for ANSI C&per.  If you haven't heard of this one, you probably
  10113. didn't get this far (unless you started at the back)&per.
  10114.  
  10115.  
  10116. [vdL94] Van der Linden, Peter&per.  :hp5.Expert C Programming&colon.  Deep C Secrets:ehp5.&per.
  10117. SunSoft Press, Prentice Hall, New Jersey,  1994&per.
  10118. :p.
  10119. Filled with useful information on the darker corners of C, as well as lots of
  10120. industry anecdotes and humor&per.  LCLint's reserved name checking is loosely based
  10121. on the list of reserved names in this book&per.
  10122.  
  10123. .br
  10124. :font facename='Tms Rmn' size=16x8.
  10125. .br
  10126. Abstract
  10127. Types
  10128. :font facename=default size=0x0.
  10129. .br
  10130. .br
  10131.  
  10132. [LG86] Liskov, Barbara&per. and Guttag, John V&per.  :hp5.Abstraction and Specification
  10133. in
  10134. Program Development:ehp5., MIT Press, Cambridge, MA, 1986&per.
  10135. :p.
  10136. Describes a programming methodology using abstract types and specified
  10137. interfaces&per.  Much of the methodology upon which LCLint is based comes from this
  10138. book&per.
  10139. Uses the CLU programming language&per.
  10140.  
  10141.  
  10142.  
  10143.  
  10144. :p.
  10145. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  10146. .br
  10147. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  10148. :link reftype=hd res=27.
  10149. :elink.
  10150. .br
  10151. :link reftype=hd res=3.Systematic Program Development:elink.
  10152. .br
  10153. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  10154.  
  10155. .* Source filename: acknowledgements.html
  10156. :h2 res=26.Acknowledgements
  10157. :font facename=default size=0x0.
  10158. :p.
  10159.  
  10160. .br
  10161. :font facename='Helv' size=32x20.
  10162. .br
  10163. Acknowledgements
  10164. .br
  10165. :font facename=default size=0x0.
  10166. .br
  10167. .br
  10168.  
  10169. :link reftype=hd res=29.John Guttag:elink. and
  10170. :link reftype=hd res=30.Jim
  10171. Horning:elink. had the original idea for LCLint, have provided valuable
  10172. advice on its functionality and design, and been instrumental in its
  10173. development&per.  This work has also benefited greatly from discussions with
  10174. Mike Burrows, Stephen Garland,
  10175. Colin Godfrey, Steve Harrison, Daniel Jackson, Angelika Leeb, Ulana Legedza, Raymie Stata, Yang Meng Tan, and
  10176. :link reftype=hd res=31.Mark Vandevoorde:elink.&per.
  10177. I especially thank Angelika Leeb for many constructive comments on
  10178. improving the User's Guide, Raymie Stata for help designing and setting
  10179. up the web site and Mark Vandevoorde for technical assistance&per.  
  10180. :p. Much
  10181. of LCLint's development has been driven by feedback from users in
  10182. academia and industry&per.  Many more people than I can mention here have
  10183. made contributions by suggesting improvements, reporting bugs, porting
  10184. early versions of LCLint to other platforms&per.  Particularly heroic
  10185. contributions have been made by Eric Bloodworth, Jutta Degener, Rick
  10186. Farnbach, Chris Flatters, Huver Hu, John Gerard Malecki, Thomas G&per.
  10187. McWilliams, Michael Meskes, Richard O'Keefe, Jens Schweikhardt, and
  10188. Albert L&per. Ting&per.  Martin "Herbert" Dietze and Mike Smith performed
  10189. valiantly in producing the Win32 and OS2 ports&per.
  10190.  
  10191.  
  10192. :p. LCLint incorporates the original LCL checker developed by Yang Meng
  10193. Tan&per.  This was built on the DECspec Project (Joe Wild, Gary Feldman,
  10194. Steve Garland, and Bill McKeeman)&per.  The LSL checker used by LCLint was
  10195. developed by Steve Garland&per.  The original C grammar for LCLint was
  10196. provided by Nate Osgood&per.
  10197.  
  10198. :p.
  10199.  
  10200. This research was supported by grants from ARPA (N0014-92-J-1795), NSF
  10201. (9115797-CCR) and DEC ERP&per.  David Evans is supported by an Intel
  10202. Foundation Fellowship&per.  LCLint is developed on DEC 3000/500 and
  10203. DECmips machines provided by :link reftype=hd res=32.Digital
  10204. Equipment Corporation:elink. and Pentium Pro (tm) machines donated by Intel Corporation&per.  This document was produced using
  10205. Pentium (tm) and Pentium Pro (tm) Computers donated by Intel Corporation and Microsoft
  10206. Office (tm) software donated by Microsoft&per. 
  10207.  
  10208. :p.
  10209. :hp3.If you are listed here, and want me to add a link to your homepage,
  10210. send :link reftype=hd res=28.me:elink. email&per.:ehp3.
  10211. :p.
  10212.  
  10213.  
  10214. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  10215. .br
  10216. :link reftype=hd res=1.
  10217. :elink.
  10218. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.
  10219. :link reftype=hd res=27.
  10220. :elink.
  10221. .br
  10222. :link reftype=hd res=3.Systematic Program Development:elink.
  10223. .br
  10224. :hp3.evs@larch&per.lcs&per.mit&per.edu:ehp3.
  10225.  
  10226.  
  10227.  
  10228. .* Source filename: guide_fn.html
  10229. :h1 res=5.Footnotes
  10230. :font facename=default size=0x0.
  10231. :p.
  10232.  
  10233.  
  10234.  
  10235. .br
  10236. :font facename='Helv' size=20x12.
  10237. .br
  10238. Footnotes:font facename=default size=0x0.
  10239. .br
  10240. .br
  10241.  
  10242. 1 Lint is a common programming tool for detecting anomalies in C
  10243. programs&per.  The original lint was developed by S&per. C&per. Johnson in the late
  10244. seventies, mainly because early versions of C did not support function prototypes&per.
  10245. :p.
  10246.  
  10247. 2 Another way to provide extra information about code is to use formal
  10248. specifications (:link reftype=hd res=22.Appendix G:elink.)&per.
  10249. :p.
  10250.  
  10251. 3 Unlike regular C comments, control comments should not be used within a
  10252. single token&per.  They may introduce new separators in the code during parsing&per.
  10253. :p.
  10254.  
  10255. 4 For abstract types whose instances can change value, a client does need to
  10256. know if assignment has copy or sharing semantics (see Section 3&per.2)&per.
  10257. :p.
  10258.  
  10259. 5 :hp3.Does not apply to HTML version&per.:ehp3.
  10260. :hp1.italics:ehp1.&per. 
  10261. :p.
  10262.  
  10263. 6 The meta-notation, item,+ is used to denote a comma separated list of items&per.
  10264. For example, :font facename='System VIO' size=14x8./*@access mstring, intSet@*/:font facename=default size=0x0. provides access to
  10265. the representations of both :font facename='System VIO' size=14x8.mstring:font facename=default size=0x0. and :font facename='System VIO' size=14x8.intSet:font facename=default size=0x0.&per.)   
  10266. :p.
  10267.  
  10268. 7 Through the parameter&per.  Modifications using some other variable that has a
  10269. pointer to the location of this parameter are not considered&per.
  10270. :p.
  10271.  
  10272. 8 The flag :link reftype=hd res=18.:font facename='System VIO' size=14x8.-booltype:font facename=default size=0x0.:elink.
  10273. can be used to select a different name for the boolean type&per.  To change
  10274. the names of :font facename='System VIO' size=14x8.TRUE:font facename=default size=0x0. and :font facename='System VIO' size=14x8.FALSE:font facename=default size=0x0., use :font facename='System VIO' size=14x8.-booltrue:font facename=default size=0x0.
  10275.  and :link reftype=hd res=18.:font facename='System VIO' size=14x8.-boolfalse:font facename=default size=0x0.:elink.&per.  The
  10276. LCLint distribution includes an implementation of :font facename='System VIO' size=14x8.bool:font facename=default size=0x0., in :font facename='System VIO' size=14x8.lib/bool&per.h:font facename=default size=0x0.&per.
  10277. However, it isn't necessary to use this implementation to get the
  10278. benefits of boolean checking&per.
  10279. :p. 
  10280.  
  10281. 9 This means that theoreticians can prove that no algorithm exists that solves
  10282. the problem correctly for all possible programs&per.
  10283. :p.
  10284.  
  10285. 10 This section is largely based on [Evans96]&per.  It semi-formally defines
  10286. some of the terms needed to describe memory management checking;  if you are satisfied with an intuitive understanding of these terms, this section may be
  10287. skipped&per.
  10288. :p.
  10289.  
  10290. 11 This is similar to the LISP storage model, except that objects are typed&per.
  10291. :p.
  10292.  
  10293. 12 Except :font facename='System VIO' size=14x8.sizeof:font facename=default size=0x0., which does not need the value of its argument&per.
  10294. :p.
  10295.  
  10296. 13 If the storage is not assigned to a reference, an internal reference
  10297. is created to track the storage&per.
  10298. :p.
  10299.  
  10300. 14 The full declaration of :font facename='System VIO' size=14x8.malloc:font facename=default size=0x0. also includes a :font facename='System VIO' size=14x8.null:font facename=default size=0x0.
  10301. annotation (:link reftype=hd res=10.Section 7&per.2:elink.) to
  10302. indicate that the result may be :font facename='System VIO' size=14x8.NULL:font facename=default size=0x0. (as it is when the requested storage
  10303. cannot be allocated) and an :font facename='System VIO' size=14x8.out:font facename=default size=0x0. annotation (Section 7&per.1) to indicate that the result
  10304. points to undefined storage&per.
  10305. :p. 
  10306.  
  10307. 15 The full declaration of :font facename='System VIO' size=14x8.free:font facename=default size=0x0. also has :font facename='System VIO' size=14x8.out:font facename=default size=0x0. and
  10308. :font facename='System VIO' size=14x8.null:font facename=default size=0x0. annotations on the parameter to indicate that the argument
  10309. may be :font facename='System VIO' size=14x8.NULL:font facename=default size=0x0. and need not point to defined storage&per.  According
  10310. to [:link reftype=hd res=1.ANSI:elink., 4&per.10&per.3&per.2], :font facename='System VIO' size=14x8.NULL:font facename=default size=0x0. may
  10311. be passed to :font facename='System VIO' size=14x8.free:font facename=default size=0x0. without an error&per.  On some UNIX platforms,
  10312. passing :font facename='System VIO' size=14x8.NULL:font facename=default size=0x0. to :font facename='System VIO' size=14x8.free:font facename=default size=0x0. causes a program crash so the
  10313. UNIX version of the standard library (Appendix F) specifies :font facename='System VIO' size=14x8.free:font facename=default size=0x0. without the
  10314. :font facename='System VIO' size=14x8.null:font facename=default size=0x0. annotation on its parameter&per. To check that allocated
  10315. objects are completely destroyed (e&per.g&per., all unshared objects inside a
  10316. structure are deallocated before the structure is deallocated), LCLint
  10317. checks that any parameter passed as an :font facename='System VIO' size=14x8.out only void *:font facename=default size=0x0. does not
  10318. contain references to live, unshared objects&per.  This makes sense, since
  10319. such a parameter could not be used sensibly in any way other than
  10320. deallocating its storage&per. 
  10321. :p.
  10322.  
  10323. 16 If an exposure qualifier is used (see Section 6&per.2), the implied dependent
  10324. annotation is used instead of the more generally implied only
  10325. annotation&per.  
  10326. :p. 
  10327.  
  10328. 17 Strictly, we should also check that the returned :font facename='System VIO' size=14x8.observer:font facename=default size=0x0. storage is not
  10329. used again after any other calls to the abstract type module using the same
  10330. parameter&per.  LCLint does not attempt to check this, and in practice it is not
  10331. usually a problem&per.
  10332. :p.
  10333.  
  10334. 18 Note that if the parameter is annotated with :font facename='System VIO' size=14x8.only:font facename=default size=0x0., it is not an error to
  10335. assign it to part of an abstract representation, since the caller may not use
  10336. the storage after the call returns&per.
  10337. :p.
  10338.  
  10339. 19 That is, the return type is :font facename='System VIO' size=14x8.bool:font facename=default size=0x0., or :font facename='System VIO' size=14x8.int:font facename=default size=0x0. if +boolint is used&per. 
  10340. :p. 
  10341.  
  10342. 20 The sef annotation denotes a parameter as side-effect free (see Section 8&per.2&per.1)&per. 
  10343. By declaring the argument to assert to be side-effect free, LCLint will report
  10344. errors if the parameter to assert produces a side-effect&per.  This is especially
  10345. pertinent if assertions are turned off when the production version is compiled&per.
  10346. The :font facename='System VIO' size=14x8.bool /*@alt int@*/:font facename=default size=0x0. type specifier for the parameter means
  10347. the parameter type must match either :font facename='System VIO' size=14x8.bool:font facename=default size=0x0. or :font facename='System VIO' size=14x8.int:font facename=default size=0x0.&per.
  10348. Alternate types are described in :link reftype=hd res=11.Section
  10349. 8&per.2&per.2:elink.&per.
  10350. :p. 
  10351.  
  10352. 21 To be completely correct, all the macro parameters should be evaluated
  10353. before the macro has any side-effects&per.  Since checking this would require
  10354. extensive analysis for occasional modest gain, it was not considered worth
  10355. implementing&per.
  10356. :p.
  10357.  
  10358. 22 Note that functions which do not produce to the same result each time they
  10359. are called with the same arguments should be declared to modify internalState
  10360. so they  will lead to errors if they are passed as sef parameters&per.
  10361. :p.
  10362.  
  10363. 23 The most renown C naming convention is the Hungarian naming convention,
  10364. introduced by Charles Simonyi [Simonyi, Charles, and Martin Heller&per.  "The
  10365. Hungarian Revolution&per."  :hp1.BYTE:ehp1., August 1991, p&per. 131-38]&per.  The names for
  10366. LCLint naming conventions follow the tradition of using Central European
  10367. nationalities as mnemonics for naming conventions&per.  The LCLint conventions are
  10368. similar to the Hungarian naming convention in that they encode type information
  10369. in names, except that the LCLint conventions encode the names of accessible
  10370. abstract types instead of the type of the declaration of return value&per.
  10371. Prefixes used in the Hungarian naming convention are not supported by LCLint&per.
  10372. :p.
  10373.  
  10374. 24 Namespace prefixes should probably be described by regular expressions&per.
  10375. LCLint uses a simpler, more limited means for describing names, which is
  10376. believed to be adequate for describing most useful naming conventions&per.  If
  10377. there is sufficient interest, regular expressions may be supported in a future
  10378. version of LCLint&per.
  10379. :p.
  10380.  
  10381. 25 Peter van der Linden estimates that default fall through is the wrong
  10382. behavior 97% of the time&per.  [:link reftype=hd res=1.vdL95:elink., p&per. 37]
  10383. :p.
  10384.  
  10385. 26 "Software Glitch Cripples AT&.T Network", Telephony, 22 January 1990&per.
  10386. :p.
  10387.  
  10388. 27 In earlier versions of LCLint, the default extension :font facename='System VIO' size=14x8.&per.lldmp:font facename=default size=0x0. was used&per.  This
  10389. has been shortened to :font facename='System VIO' size=14x8.&per.lcd:font facename=default size=0x0.&per.
  10390. :cgraphic.────────────────────────────────────────────────────────────────────────────────:ecgraphic.
  10391. .br
  10392. :link reftype=hd res=1.:elink.
  10393. :artwork name='up-arrow.bmp' align=left runin.:artlink.:link reftype=hd res=1.:eartlink.:link reftype=hd res=1.:elink.:link reftype=hd res=27.:elink.
  10394. :artwork name='lclint-home-small.bmp' align=left runin.:artlink.:link reftype=hd res=27.:eartlink.:link reftype=hd res=27.:elink.:link reftype=hd res=2.:elink.
  10395. .br
  10396. :link reftype=hd res=3.:elink.
  10397. .br
  10398. :link reftype=hd res=28.:hp3.:ehp3.:elink.
  10399.  
  10400.  
  10401.  
  10402.  
  10403. :h1.External links
  10404. :font facename=default size=0x0.
  10405. :p.This chapter contains all external links referenced in this book -
  10406. either link is an Unified Resource Locator (URL) or simply to a
  10407. local file which is not a part of this book.
  10408. :h2 res=3.http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/
  10409. :font facename=default size=0x0.
  10410. :p.:lines align=center.
  10411. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10412. :font facename='System VIO' size=24x14.
  10413. :p.:link reftype=launch object='explore.exe ' data='http://larch-www.lcs.mit.edu:8001/'.
  10414. http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/
  10415. :elink.:elines.
  10416. :h2 res=27.http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/larch/lclint/index&per.html
  10417. :font facename=default size=0x0.
  10418. :p.:lines align=center.
  10419. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10420. :font facename='System VIO' size=24x14.
  10421. :p.:link reftype=launch object='explore.exe ' data='http://larch-www.lcs.mit.edu:8001/larch/lclint/index.html'.
  10422. http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/larch/lclint/index&per.html
  10423. :elink.:elines.
  10424. :h2 res=28.mailto&colon.evs@larch&per.lcs&per.mit&per.edu
  10425. :font facename=default size=0x0.
  10426. :p.:lines align=center.
  10427. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10428. :font facename='System VIO' size=24x14.
  10429. :p.:link reftype=launch object='explore.exe ' data='mailto:evs@larch.lcs.mit.edu'.
  10430. mailto&colon.evs@larch&per.lcs&per.mit&per.edu
  10431. :elink.:elines.
  10432. :h2 res=39.http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/larch/lclint/run&per.html
  10433. :font facename=default size=0x0.
  10434. :p.:lines align=center.
  10435. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10436. :font facename='System VIO' size=24x14.
  10437. :p.:link reftype=launch object='explore.exe ' data='http://larch-www.lcs.mit.edu:8001/larch/lclint/run.html'.
  10438. http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/larch/lclint/run&per.html
  10439. :elink.:elines.
  10440. :h2 res=2.http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/~evs
  10441. :font facename=default size=0x0.
  10442. :p.:lines align=center.
  10443. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10444. :font facename='System VIO' size=24x14.
  10445. :p.:link reftype=launch object='explore.exe ' data='http://larch-www.lcs.mit.edu:8001/~evs'.
  10446. http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/~evs
  10447. :elink.:elines.
  10448. :h2 res=68.http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/~evs/pldi96-abstract&per.html
  10449. :font facename=default size=0x0.
  10450. :p.:lines align=center.
  10451. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10452. :font facename='System VIO' size=24x14.
  10453. :p.:link reftype=launch object='explore.exe ' data='http://larch-www.lcs.mit.edu:8001/~evs/pldi96-abstract.html'.
  10454. http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/~evs/pldi96-abstract&per.html
  10455. :elink.:elines.
  10456. :h2 res=72.http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/~evs/sigsoft94&per.html
  10457. :font facename=default size=0x0.
  10458. :p.:lines align=center.
  10459. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10460. :font facename='System VIO' size=24x14.
  10461. :p.:link reftype=launch object='explore.exe ' data='http://larch-www.lcs.mit.edu:8001/~evs/sigsoft94.html'.
  10462. http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/~evs/sigsoft94&per.html
  10463. :elink.:elines.
  10464. :h2 res=73.http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/~evs/tr-628&per.html
  10465. :font facename=default size=0x0.
  10466. :p.:lines align=center.
  10467. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10468. :font facename='System VIO' size=24x14.
  10469. :p.:link reftype=launch object='explore.exe ' data='http://larch-www.lcs.mit.edu:8001/~evs/tr-628.html'.
  10470. http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/~evs/tr-628&per.html
  10471. :elink.:elines.
  10472. :h2 res=29.http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/~guttag/
  10473. :font facename=default size=0x0.
  10474. :p.:lines align=center.
  10475. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10476. :font facename='System VIO' size=24x14.
  10477. :p.:link reftype=launch object='explore.exe ' data='http://larch-www.lcs.mit.edu:8001/~guttag/'.
  10478. http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/~guttag/
  10479. :elink.:elines.
  10480. :h2 res=31.http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/~mtv
  10481. :font facename=default size=0x0.
  10482. :p.:lines align=center.
  10483. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10484. :font facename='System VIO' size=24x14.
  10485. :p.:link reftype=launch object='explore.exe ' data='http://larch-www.lcs.mit.edu:8001/~mtv'.
  10486. http&colon.//larch-www&per.lcs&per.mit&per.edu&colon.8001/~mtv
  10487. :elink.:elines.
  10488. :h2 res=30.http&colon.//reality&per.sgi&per.com/employees/horning_mti/home&per.html
  10489. :font facename=default size=0x0.
  10490. :p.:lines align=center.
  10491. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10492. :font facename='System VIO' size=24x14.
  10493. :p.:link reftype=launch object='explore.exe ' data='http://reality.sgi.com/employees/horning_mti/home.html'.
  10494. http&colon.//reality&per.sgi&per.com/employees/horning_mti/home&per.html
  10495. :elink.:elines.
  10496. :h2 res=32.http&colon.//www&per.digital&per.com/
  10497. :font facename=default size=0x0.
  10498. :p.:lines align=center.
  10499. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10500. :font facename='System VIO' size=24x14.
  10501. :p.:link reftype=launch object='explore.exe ' data='http://www.digital.com/'.
  10502. http&colon.//www&per.digital&per.com/
  10503. :elink.:elines.
  10504. :h2 res=4.http&colon.//www&per.lcs&per.mit&per.edu/
  10505. :font facename=default size=0x0.
  10506. :p.:lines align=center.
  10507. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10508. :font facename='System VIO' size=24x14.
  10509. :p.:link reftype=launch object='explore.exe ' data='http://www.lcs.mit.edu/'.
  10510. http&colon.//www&per.lcs&per.mit&per.edu/
  10511. :elink.:elines.
  10512. :h2 res=41.mailto&colon.lclint-bug@larch&per.lcs&per.mit&per.edu
  10513. :font facename=default size=0x0.
  10514. :p.:lines align=center.
  10515. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10516. :font facename='System VIO' size=24x14.
  10517. :p.:link reftype=launch object='explore.exe ' data='mailto:lclint-bug@larch.lcs.mit.edu'.
  10518. mailto&colon.lclint-bug@larch&per.lcs&per.mit&per.edu
  10519. :elink.:elines.
  10520. :h2 res=40.mailto&colon.lclint@larch&per.lcs&per.mit&per.edu
  10521. :font facename=default size=0x0.
  10522. :p.:lines align=center.
  10523. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10524. :font facename='System VIO' size=24x14.
  10525. :p.:link reftype=launch object='explore.exe ' data='mailto:lclint@larch.lcs.mit.edu'.
  10526. mailto&colon.lclint@larch&per.lcs&per.mit&per.edu
  10527. :elink.:elines.
  10528. :h2 res=43.news&colon.comp&per.specification&per.larch
  10529. :font facename=default size=0x0.
  10530. :p.:lines align=center.
  10531. The link you selected points to an external resource&per. Click the URL below to launch IBM Web Explorer
  10532. :font facename='System VIO' size=24x14.
  10533. :p.:link reftype=launch object='explore.exe ' data='news:comp.specification.larch'.
  10534. news&colon.comp&per.specification&per.larch
  10535. :elink.:elines.
  10536. :euserdoc.
  10537.