]> andersk Git - splint.git/blame - src/flags.def
Dave's Updates
[splint.git] / src / flags.def
CommitLineData
885824d3 1/*;-*-C-*-;
2**
3** flags.def
4**
5** This file is used to generate the flag header files.
a0a162cd 6**
7** Don't forget to regenerate flag_codes.gen. (lost the Makefile...bleech!)
885824d3 8*/
885824d3 9 /* spec idem global mode args */
10/*@-namechecks@*/
11/*@notfunction@*/
12# define modeFlag FALSE, FALSE, FALSE, TRUE, ARG_NONE
13/*@notfunction@*/
14# define plainFlag FALSE, FALSE, FALSE, FALSE, ARG_NONE
15/*@notfunction@*/
16# define specialFlag TRUE, FALSE, FALSE, FALSE, ARG_NONE
17/*@notfunction@*/
18# define plainSpecialFlag TRUE, FALSE, FALSE, FALSE, ARG_NONE
19/*@notfunction@*/
20# define idemSpecialFlag TRUE, TRUE, FALSE, FALSE, ARG_NONE
21/*@notfunction@*/
22# define valueFlag FALSE, FALSE, FALSE, FALSE, ARG_VALUE
23/*@notfunction@*/
24# define modeValueFlag FALSE, FALSE, FALSE, TRUE, ARG_VALUE
25/*@notfunction@*/
26# define specialValueFlag TRUE, FALSE, FALSE, FALSE, ARG_VALUE
27/*@notfunction@*/
28# define debugFlag FALSE, TRUE, FALSE, FALSE, ARG_NONE
29/*@notfunction@*/
28bf4b0b 30# define debugValueFlag FALSE, TRUE, FALSE, FALSE, ARG_VALUE
31/*@notfunction@*/
885824d3 32# define specialDebugFlag TRUE, TRUE, FALSE, FALSE, ARG_NONE
33/*@notfunction@*/
34# define globalFlag FALSE, FALSE, TRUE, FALSE, ARG_NONE
35/*@notfunction@*/
36# define idemGlobalFlag FALSE, TRUE, TRUE, FALSE, ARG_NONE
37/*@notfunction@*/
38# define globalValueFlag FALSE, FALSE, TRUE, FALSE, ARG_VALUE
39/*@notfunction@*/
40# define regStringFlag FALSE, FALSE, FALSE, FALSE, ARG_STRING
41/*@notfunction@*/
42# define idemStringFlag FALSE, TRUE, FALSE, FALSE, ARG_STRING
43/*@notfunction@*/
44# define globalStringFlag FALSE, FALSE, TRUE, FALSE, ARG_STRING
45/*@notfunction@*/
46# define extraArgFlag FALSE, FALSE, FALSE, FALSE, ARG_SPECIAL
47/*@notfunction@*/
48# define globalExtraArgFlag FALSE, FALSE, TRUE, FALSE, ARG_SPECIAL
49/*@=namechecks@*/
50
51/*
52** Note: the flag code must be on a separate line, since I'm
53** too stupid to write an awk/sed/whatever script that can separate
54** the lines.
55*/
56
28bf4b0b 57static flaglist flags =
885824d3 58{
28bf4b0b 59 {
60 FK_BOOL, FK_HELP, plainFlag,
61 "likelybool",
62 FLG_LIKELYBOOL,
63 "type name is probably a boolean type but does not match default "
64 "boolean type name, \"bool\", and alternate name is not set",
65 "Use the -booltype, -boolfalse and -booltrue flags to change the "
66 "name of the default boolean type.",
67 0, 0
885824d3 68 },
28bf4b0b 69 {
70 FK_ABSTRACT, FK_IMPLICIT, plainFlag,
71 "impabstract",
72 FLG_IMPABSTRACT,
73 "assume user type definitions are abstract (unless /*@concrete@*/ is used)",
74 NULL,
75 0, 0
76 },
77 {
78 FK_ABSTRACT, FK_NAMES, specialFlag,
79 "accessall",
80 FLG_ACCESSALL,
81 "set accessmodule, accessfile and accessczech",
82 "Sets accessmodule, accessfile and accessczech",
83 0, 0
84 },
85 {
86 FK_ABSTRACT, FK_NAMES, plainFlag,
87 "accessmodule",
88 FLG_ACCESSMODULE,
89 "allow access to abstract types in definition module",
90 "The representation of an abstract type defined in <M>.<x> is "
91 "accessible anywhere in a file named <M>.<y>.",
92 0, 0
93 },
94 {
95 FK_ABSTRACT, FK_NAMES, plainFlag,
96 "accessfile",
97 FLG_ACCESSFILE,
98 "allow access to abstract types by file name convention",
99 "The representation of an abstract type named <t> is "
100 "accessible anywhere in a file named <t>.<x>.",
101 0, 0
102 },
103 {
104 FK_ABSTRACT, FK_NAMES, plainFlag,
105 "accessczech",
106 FLG_ACCESSCZECH,
107 "allow access to abstract types by czech naming convention",
108 "The representation of an abstract type named <t> is accessible "
109 "in the definition of a function or constant named <t>_<name>",
110 0, 0
111 },
112 {
113 FK_ABSTRACT, FK_NAMES, plainFlag,
114 "accessslovak",
115 FLG_ACCESSSLOVAK,
116 "allow access to abstract types by slovak naming convention",
117 "The representation of an abstract type named <t> is accessible "
118 "in the definition of a function or constant named <t><Name>",
119 0, 0
120 },
121 {
122 FK_ABSTRACT, FK_NAMES, plainFlag,
123 "accessczechoslovak",
124 FLG_ACCESSCZECHOSLOVAK,
125 "allow access to abstract types by czechoslovak naming convention",
126 "The representation of an abstract type named <t> is accessible "
127 "in the definition of a function or constant named <t>_<name> or <t><Name>",
128 0, 0
129 },
130 {
131 FK_ABSTRACT, FK_NONE, plainFlag,
132 "abstract",
133 FLG_ABSTRACT,
134 "data abstraction barriers",
135 "An abstraction barrier is broken. If necessary, use /*@access <type>@*/ to allow access to an abstract type.",
136 0, 0
137 },
138 {
139 FK_ABSTRACT, FK_NONE, modeFlag,
140 "mutrep",
141 FLG_MUTREP,
142 "representation of mutable type has sharing semantics",
143 "LCL semantics requires that a mutable type exhibits sharing semantics. In order for objects to be shared a indirection is necessary in the representation. A mutable type may be represented by a pointer or an abstract mutable type. Handles into static data are fine, too, but will generate this error message unless it is suppressed.",
144 0, 0
145 },
146 {
147 FK_ALIAS, FK_GLOBALS, specialFlag,
148 "globalias",
149 FLG_GLOBALIAS,
150 "function returns with global aliasing external state (sets "
151 "checkstrictglobalias, checkedglobalias, checkmodglobalias and "
152 "uncheckedglobalias)",
153 "A global variable aliases externally-visible state when the function returns.",
154 0, 0
155 },
156 {
157 FK_ALIAS, FK_GLOBALS, modeFlag,
158 "checkstrictglobalias",
159 FLG_CHECKSTRICTGLOBALIAS,
160 "function returns with a checkstrict global aliasing external state",
161 "A global variable aliases externally-visible state when the function returns.",
162 0, 0
163 },
164 {
165 FK_ALIAS, FK_GLOBALS, modeFlag,
166 "checkedglobalias",
167 FLG_CHECKEDGLOBALIAS,
168 "function returns with a checked global aliasing external state",
169 "A global variable aliases externally-visible state when the function returns.",
170 0, 0
171 },
172 {
173 FK_ALIAS, FK_GLOBALS, modeFlag,
174 "checkmodglobalias",
175 FLG_CHECKMODGLOBALIAS,
176 "function returns with a checkmod global aliasing external state",
177 "A global variable aliases externally-visible state when the function returns.",
178 0, 0
179 },
180 {
181 FK_ALIAS, FK_GLOBALS, modeFlag,
182 "uncheckedglobalias",
183 FLG_UNCHECKEDGLOBALIAS,
184 "function returns with an unchecked global aliasing external state",
185 "A global variable aliases externally-visible state when the function returns.",
186 0, 0
187 },
188 {
189 FK_ALIAS, FK_MEMORY, modeFlag,
190 "aliasunique",
191 FLG_ALIASUNIQUE,
192 "unique parameter is aliased",
193 "A unique or only parameter is aliased by some other parameter or visible global.",
194 0, 0
195 },
196 {
197 FK_ALIAS, FK_MEMORY, modeFlag,
198 "mayaliasunique",
199 FLG_MAYALIASUNIQUE,
200 "unique parameter may be aliased",
201 "A unique or only parameter may be aliased by some other parameter or visible global.",
202 0, 0
203 },
204 {
205 FK_ALIAS, FK_MEMORY, modeFlag,
206 "mustnotalias",
207 FLG_MUSTNOTALIAS,
208 "temp storage aliased at return point or scope exit",
209 "An alias has been added to a temp-qualifier parameter or global that is visible externally when the function returns. If the aliasing is needed, use the /*@shared@*/ annotation to indicate that new aliases to the parameter may be created.",
210 0, 0
211 },
212 {
213 FK_ALIAS, FK_NONE, modeFlag,
214 "retalias",
215 FLG_RETALIAS,
216 "function returns alias to parameter or global",
217 "The returned value shares storage with a parameter or global. If a parameter is to be returned, use the returned qualifier. If the result is not modified, use the observer qualifier on the result type. Otherwise, exposed can be used, but limited checking is done.", 0, 0
218 },
219 {
220 FK_ANSI, FK_PROTOS, modeFlag,
221 "noparams",
222 FLG_NOPARAMS,
223 "function declaration has no parameter list",
224 "A function declaration does not have a parameter list.",
225 0, 0
226 },
227 {
228 FK_ANSI, FK_PROTOS, modeFlag,
229 "oldstyle",
230 FLG_OLDSTYLE,
231 "old style function definition",
232 "Function definition is in old style syntax. Standard prototype "
233 "syntax is preferred.",
234 0, 0
235 },
236 {
237 FK_ANSI, FK_SYNTAX, plainFlag,
238 "gnuextensions",
239 FLG_GNUEXTENSIONS,
240 "support some gnu (gcc) language extensions",
241 NULL, 0, 0
242 },
243 {
244 FK_ANSI, FK_NONE, plainFlag,
245 "usevarargs",
246 FLG_USEVARARGS,
247 "non-standard <varargs.h> included",
248 "Header <varargs.h> is not part of ANSI Standard. "
249 "Should use <stdarg.h> instead.",
250 0, 0
251 },
252 {
253 FK_ANSI, FK_LIBS, plainFlag,
254 "warnposixheaders",
255 FLG_WARNPOSIX,
256 "a POSIX header is included, but the POSIX library is not used",
257 "Header name matches a POSIX header, but the POSIX library is not selected.",
258 0, 0
259 },
260 {
261 FK_BEHAVIOR, FK_ANSI, modeFlag,
262 "exitarg",
263 FLG_EXITARG,
264 "argument to exit has implementation defined behavior",
265 "The argument to exit should be 0, EXIT_SUCCESS or EXIT_FAILURE",
266 0, 0
267 },
268 {
269 FK_BEHAVIOR, FK_ANSI, modeFlag,
270 "evalorder",
271 FLG_EVALORDER,
272 "code has unspecified or implementation-dependent behavior "
273 "because of order of evaluation",
274 "Code has unspecified behavior. "
275 "Order of evaluation of function parameters or subexpressions "
276 "is not defined, so if a value is used and modified in different "
277 "places not separated by a sequence point constraining "
278 "evaluation order, then the result of the expression is "
279 "unspecified.",
280 0, 0
281 },
282 {
283 FK_BEHAVIOR, FK_ANSI, modeFlag,
284 "evalorderuncon",
285 FLG_EVALORDERUNCON,
286 "code involving call to unspecified function has undefined or implementation-dependent behavior",
287 "Code involving a call to function with no modifies or globals clause "
288 "may have undefined or implementation-dependent behavior (LCLint assumes the "
289 "unconstrained call may modify any reachable state or use any global). Add a "
290 "specification for the function.",
291 0, 0
292 },
293 {
294 FK_BOOL, FK_NONE, regStringFlag,
295 "boolfalse",
296 FLG_BOOLFALSE,
297 "set name of boolean false (default FALSE)",
298 NULL, 0, 0
299 },
300 {
301 FK_BOOL, FK_NONE, regStringFlag,
302 "booltype",
303 FLG_BOOLTYPE,
304 "set name of boolean type (default bool)",
305 NULL, 0, 0
306 },
307 {
308 FK_BOOL, FK_NONE, regStringFlag,
309 "booltrue",
310 FLG_BOOLTRUE,
311 "set name of boolean true (default TRUE)",
312 NULL, 0, 0
313 },
314 {
315 FK_COMMENTS, FK_ABSTRACT, plainFlag,
316 "noaccess",
317 FLG_NOACCESS,
318 "ignore access comments",
319 NULL, 0, 0
320 },
321 {
322 FK_COMMENTS, FK_SUPPRESS, plainFlag,
323 "nocomments",
324 FLG_NOCOMMENTS,
325 "ignore all stylized comments",
326 NULL, 0, 0
327 },
328 {
329 FK_COMMENTS, FK_SYNTAX, plainFlag,
330 "unrecogcomments",
331 FLG_UNRECOGCOMMENTS,
332 "stylized comment is unrecognized",
333 "Word after a stylized comment marker does not correspond to a "
334 "stylized comment.",
335 0, 0
336 },
337 {
338 FK_COMMENTS, FK_SYNTAX, plainFlag,
339 "continuecomment",
340 FLG_CONTINUECOMMENT,
341 "line continuation marker (\\) in comment before */ on same line",
342 "A line continuation marker (\\) appears inside a comment on the same "
343 "line as the comment close. Preprocessors should handle this "
344 "correctly, but it causes problems for some preprocessors.",
345 0, 0
346 },
347 {
348 FK_COMMENTS, FK_SYNTAX, plainFlag,
349 "nestcomment",
350 FLG_NESTCOMMENT,
351 "comment begins inside comment",
352 "A comment open sequence (/*) appears within a comment. This usually "
353 "means an earlier comment was not closed.",
354 0, 0
355 },
356 {
357 FK_COMMENTS, FK_SUPPRESS, modeFlag,
358 "tmpcomments",
359 FLG_TMPCOMMENTS,
360 "interpret t comments (ignore errors in lines marked with /*@t<n>@*/",
361 NULL, 0, 0
362 },
363 {
364 FK_COMMENTS, FK_SUPPRESS, plainFlag,
365 "lintcomments",
366 FLG_LINTCOMMENTS,
367 "interpret traditional lint comments (/*FALLTHROUGH*/, /*NOTREACHED*/)",
368 NULL, 0, 0
369 },
370 {
371 FK_COMMENTS, FK_SUPPRESS, modeFlag,
372 "warnlintcomments",
373 FLG_WARNLINTCOMMENTS,
374 "print a warning and suggest an alternative when a traditional lint "
375 "comment is used",
376 "A traditional lint comment is used. Some traditional lint comments "
377 "are interpreted by LCLint to enable easier checking of legacy "
378 "code. It is preferable to replace these comments with the "
379 "suggested LCLint alternative.",
380 0, 0
381 },
382 {
383 FK_COMPLETE, FK_NONE, modeFlag,
384 "declundef",
385 FLG_DECLUNDEF,
386 "function or variable declared but never defined",
387 "A function or variable is declared, but not defined in any source code file.",
388 0, 0
389 },
390 {
391 FK_COMPLETE, FK_SPEC, modeFlag,
392 "specundef",
393 FLG_SPECUNDEF,
394 "function or variable specified but never defined",
395 "A function or variable is declared in an .lcl file, but not defined in any source code file.",
396 0, 0
397 },
398 {
399 FK_COMPLETE, FK_SPEC, plainFlag,
400 "specundecl",
401 FLG_SPECUNDECL,
402 "function or variable specified but never declared in a source file",
403 "A function or variable is declared in an .lcl file, but not declared "
404 "in any source code file.",
405 0, 0
406 },
407 {
408 FK_CONTROL, FK_MEMORY, modeFlag,
409 "loopexec",
410 FLG_LOOPEXEC,
411 "assume all loops execute at least once",
412 NULL, 0, 0
413 },
414 {
415 FK_CONTROL, FK_NONE, plainFlag,
416 "control",
417 FLG_CONTROL,
418 NULL, NULL,
419 0, 0
420 },
421 {
422 FK_CONTROL, FK_NONE, modeFlag,
423 "infloops",
424 FLG_INFLOOPS,
425 "likely infinite loop is detected",
426 "This appears to be an infinite loop. Nothing in the body of the "
427 "loop or the loop test modifies the value of the loop test. "
428 "Perhaps the specification of a function called in the loop "
429 "body is missing a modification.",
430 0, 0
431 },
432 {
433 FK_CONTROL, FK_NONE, modeFlag,
434 "infloopsuncon",
435 FLG_INFLOOPSUNCON,
436 "likely infinite loop is detected (may result from unconstrained function)",
437 "This appears to be an infinite loop. Nothing in the body of the "
885824d3 438 "loop or the loop test modifies the value of the loop test. "
439 "There may be a modification through a call to an unconstrained "
440 "function, or an unconstrained function in the loop test may use "
441 "a global variable modified by the loop body.",
28bf4b0b 442 0, 0
443 },
444 {
445 FK_CONTROL, FK_NONE, specialFlag,
446 "deepbreak",
447 FLG_DEEPBREAK,
448 "break inside nested while or for or switch",
449 "A break statement appears inside the body of a nested while, for or "
450 "switch statement. Sets looploopbreak, loopswitchbreak, "
451 "switchloopbreak, switchswitchbreak, and looploopcontinue.",
452 0, 0
453 },
454 {
455 FK_CONTROL, FK_NONE, modeFlag,
456 "looploopbreak",
457 FLG_LOOPLOOPBREAK,
458 "break inside nested while or for",
459 "A break statement appears inside the body of a nested while or for "
460 "statement. This is perfectly reasonable code, but check that "
461 "the break is intended to break only the inner loop. The "
462 "break statement may be preceded by /*@innerbreak@*/ to suppress "
463 "the message for this break only.",
464 0, 0
465 },
466 {
467 FK_CONTROL, FK_NONE, modeFlag,
468 "switchloopbreak",
469 FLG_SWITCHLOOPBREAK,
470 "break in loop inside switch",
471 "A break statement appears inside the body of a while or for "
472 "statement within a switch. This is perfectly reasonable code, but check that "
473 "the break is intended to break only the inner loop. The "
474 "break statement may be preceded by /*@loopbreak@*/ to suppress "
475 "the message for this break only.",
476 0, 0
477 },
478 {
479 FK_CONTROL, FK_NONE, modeFlag,
480 "loopswitchbreak",
481 FLG_LOOPSWITCHBREAK,
482 "break in switch inside loop",
483 "A break statement appears inside a switch statement within a while or "
484 "for loop. This is perfectly reasonable code, but check that "
485 "the break is intended to break only the inner loop. The "
486 "break statement may be preceded by /*@switchbreak@*/ to suppress "
487 "the message for this break only.",
488 0, 0
489 },
490 {
491 FK_CONTROL, FK_NONE, modeFlag,
492 "switchswitchbreak",
493 FLG_SWITCHSWITCHBREAK,
494 "break in switch inside switch",
495 "A break statement appears inside a switch statement within another "
496 "switch statement. This is perfectly reasonable code, but check that "
497 "the break is intended to break only the inner switch. The "
498 "break statement may be preceded by /*@innerbreak@*/ to suppress "
499 "the message for this break only.",
500 0, 0
501 },
502 {
503 FK_CONTROL, FK_NONE, modeFlag,
504 "looploopcontinue",
505 FLG_LOOPLOOPCONTINUE,
506 "continue inside nested loop",
507 "A continue statement appears inside a loop within a loop. "
508 "This is perfectly reasonable code, but check that "
509 "the continue is intended to continue only the inner loop. The "
510 "continue statement may be preceded by /*@innercontinue@*/ to suppress "
511 "the message for this continue only.",
512 0, 0
513 },
514 {
515 FK_CONTROL, FK_NONE, modeFlag,
516 "unreachable",
517 FLG_UNREACHABLE,
518 "unreachable code detected",
519 "This code will never be reached on any possible execution.",
520 0, 0
521 },
522 {
523 FK_CONTROL, FK_NONE, modeFlag,
524 "whileempty",
525 FLG_WHILEEMPTY,
526 "a while statement has no body",
527 "While statement has no body.",
528 0, 0
529 },
530 {
531 FK_CONTROL, FK_NONE, modeFlag,
532 "whileblock",
533 FLG_WHILEBLOCK,
534 "the body of a while statement is not a block",
535 "While body is a single statement, not a compound block.",
536 0, 0
537 },
538 {
539 FK_CONTROL, FK_NONE, modeFlag,
540 "forempty",
541 FLG_FOREMPTY,
542 "a for statement has no body",
543 "For statement has no body.",
544 0, 0
545 },
546 {
547 FK_CONTROL, FK_NONE, modeFlag,
548 "forblock",
549 FLG_FORBLOCK,
550 "the body of a for statement is not a block",
551 "Loop body is a single statement, not a compound block.",
552 0, 0
553 },
554 {
555 FK_CONTROL, FK_NONE, modeFlag,
556 "ifempty",
557 FLG_IFEMPTY,
558 "an if statement has no body",
559 "If statement has no body.",
560 0, 0
561 },
562 {
563 FK_CONTROL, FK_NONE, modeFlag,
564 "ifblock",
565 FLG_IFBLOCK,
566 "the body of an if statement is not a block",
567 "If body is a single statement, not a compound block.",
568 0, 0
569 },
570 {
571 FK_CONTROL, FK_NONE, specialFlag,
572 "allempty",
573 FLG_ALLEMPTY,
574 "an if, while or for statement has no body (sets ifempty, "
575 "whileempty and forempty",
576 NULL,
577 0, 0
578 },
579 {
580 FK_CONTROL, FK_NONE, specialFlag,
581 "allblock",
582 FLG_ALLBLOCK,
583 "the body of an if, while or for statement is not a block "
584 "(sets ifblock, whileblock and forblock)",
585 "Body is a single statement, not a compound block.",
586 0, 0
587 },
588 {
589 FK_CONTROL, FK_NONE, modeFlag,
590 "elseifcomplete",
591 FLG_ELSEIFCOMPLETE,
592 "if ... else if chains must have final else",
593 "There is no final else following an else if construct.",
594 0, 0
595 },
596 {
597 FK_CONTROL, FK_NONE, modeFlag,
598 "noret",
599 FLG_NORETURN,
600 "path with no return detected in non-void function",
601 "There is a path through a function declared to return a value on "
602 "which there is no return statement. This means the execution "
603 "may fall through without returning a meaningful result to "
604 "the caller.",
605 0, 0
606 },
607 {
608 FK_CONTROL, FK_NONE, modeFlag,
609 "casebreak",
610 FLG_CASEBREAK,
611 "non-empty case in a switch without preceding break",
612 "Execution falls through from the previous case.", 0, 0
613 },
614 {
615 FK_CONTROL, FK_NONE, modeFlag,
616 "misscase",
617 FLG_MISSCASE,
618 "switch on enum type missing case for some value",
619 "Not all values in an enumeration are present as cases in the switch.",
620 0, 0
621 },
622 {
623 FK_CONTROL, FK_NONE, modeFlag,
624 "firstcase",
625 FLG_FIRSTCASE,
626 "first statement in switch is not a case",
627 "The first statement after a switch is not a case.",
628 0, 0
629 },
630 {
631 FK_DEBUG, FK_NONE, specialDebugFlag,
632 "grammar",
633 FLG_GRAMMAR,
634 NULL, NULL,
635 0, 0
636 },
637 {
638 FK_DEBUG, FK_NONE, debugFlag,
639 "nopp",
640 FLG_NOPP,
641 NULL, NULL,
642 0, 0
643 },
644 {
645 FK_DECL, FK_NONE, modeFlag,
646 "shadow",
647 FLG_SHADOW,
648 "declaration reuses name visible in outer scope",
649 "An outer declaration is shadowed by the local declaration.",
650 0, 0
651 },
652 {
653 FK_DECL, FK_LIBS, modeFlag,
654 "incondefslib",
655 FLG_INCONDEFSLIB,
656 "function, variable or constant defined in a library is redefined with inconsistent type",
657 "A function, variable or constant previously defined in a library is "
658 "redefined with a different type.",
659 0, 0
660 },
661 {
662 FK_DECL, FK_LIBS, modeFlag,
663 "overload",
664 FLG_WARNOVERLOAD,
665 "library function overloaded",
666 "A function, variable or constant defined in the library is redefined "
667 "with a different type.",
668 0, 0
669 },
670 {
671 FK_DECL, FK_NONE, modeFlag,
672 "nestedextern",
673 FLG_NESTEDEXTERN,
674 "an extern declaration is inside a function scope",
675 "An extern declaration is used inside a function scope.",
676 0, 0
885824d3 677 },
28bf4b0b 678 {
679 FK_DECL, FK_NONE, modeFlag,
680 "redecl",
681 FLG_REDECL,
682 "function or variable redeclared",
683 "A function or variable is declared in more than one place. This is "
684 "not necessarily a problem, since the declarations are consistent.",
685 0, 0
885824d3 686 },
28bf4b0b 687 {
688 FK_DECL, FK_NONE, plainFlag,
689 "redef",
690 FLG_REDEF,
691 "function or variable redefined",
692 "A function or variable is redefined. One of the declarations should use extern.",
693 0, 0
694 },
695 {
696 FK_DECL, FK_TYPE, modeFlag,
697 "incondefs",
698 FLG_INCONDEFS,
699 "function, variable or constant redefined with inconsistent type",
700 "A function, variable or constant is redefined with a different type.",
701 0, 0
702 },
703 {
704 FK_DECL, FK_TYPE, modeFlag,
705 "imptype",
706 FLG_IMPTYPE,
707 "variable declaration has unknown (implicitly int) type",
708 "A variable declaration has no explicit type. The type is implicitly int.",
709 0, 0
710 },
711 {
712 FK_DECL, FK_TYPE, modeFlag,
713 "matchfields",
714 FLG_MATCHFIELDS,
715 "struct or enum type redefined with inconsistent fields or members",
716 "A struct, union or enum type is redefined with inconsistent fields or members.",
717 0, 0
718 },
719 {
720 FK_DEF, FK_NONE, modeFlag,
721 "usedef",
722 FLG_USEDEF,
723 "use before definition",
724 "An rvalue is used that may not be initialized to a value on some execution path.",
725 0, 0
726 },
727 {
728 FK_DEF, FK_IMPLICIT, modeFlag,
729 "impouts",
730 FLG_IMPOUTS,
731 "pointer parameters to unspecified functions may be implicit out parameters",
732 NULL, 0, 0
733 },
734 {
735 FK_DIRECT, FK_FILES, globalStringFlag,
736 "tmpdir",
737 FLG_TMPDIR,
738 "set directory for writing temp files",
739 NULL, 0, 0
740 },
741 {
742 FK_DIRECT, FK_FILES, globalStringFlag,
743 "larchpath",
744 FLG_LARCHPATH,
745 "set path for searching for library files (overrides LARCH_PATH environment variable)",
746 NULL, 0, 0
747 },
748 {
749 FK_DIRECT, FK_FILES, globalStringFlag,
750 "lclimportdir",
751 FLG_LCLIMPORTDIR,
752 "set directory to search for LCL import files (overrides LCLIMPORTDIR)",
753 NULL, 0, 0
754 },
755 {
756 FK_DIRECT, FK_FILES, globalStringFlag,
757 "sysdirs",
758 FLG_SYSTEMDIRS,
759 "set directories for system files (default /usr/include). Separate "
760 "directories with colons (e.g., \"/usr/include:/usr/local/lib\"). "
761 "Flag settings propagate to files in a system directory. If "
762 "-sysdirerrors is set, no errors are reported for files in "
763 "system directories.",
764 NULL, 0, 0
765 },
766 {
767 FK_DIRECT, FK_FILES, plainFlag,
768 "skipansiheaders",
769 FLG_SKIPANSIHEADERS,
770 "prevent inclusion of header files in a system directory with "
885824d3 771 "names that match standard ANSI headers. The symbolic information "
772 "in the standard library is used instead. Flag in effect only "
773 "if a library including the ANSI library is loaded. The ANSI "
774 "headers are: assert, ctype, errno, float, limits, locale, math, "
28bf4b0b 775 "setjmp, signal, stdarg, stddef, stdio, stdlib, strings, string, "
776 "time, and wchar.",
777 NULL, 0, 0
778 },
779 {
780 FK_DIRECT, FK_FILES, plainFlag,
781 "skipposixheaders",
782 FLG_SKIPPOSIXHEADERS,
783 "prevent inclusion of header files in a system directory with "
885824d3 784 "names that match standard POSIX headers. The symbolic information "
785 "in the posix library is used instead. The POSIX headers are: "
28bf4b0b 786 "dirent, fcntl, grp, pwd, termios, sys/stat, sys/times, "
787 "sys/types, sys/utsname, sys/wait, unistd, and utime.",
788 NULL, 0, 0
789 },
790 {
791 FK_DIRECT, FK_SUPPRESS, modeFlag,
792 "sysdirerrors",
793 FLG_SYSTEMDIRERRORS,
794 "report errors in files in system directories (set by -sysdirs)",
795 NULL, 0, 0
796 },
797 {
798 FK_HEADERS, FK_MACROS, plainFlag,
799 "sysdirexpandmacros",
800 FLG_SYSTEMDIREXPAND,
801 "expand macros in system directories regardless of other settings, "
802 "except for macros corresponding to names defined in a load library",
803 NULL, 0, 0
885824d3 804 },
805
28bf4b0b 806 {
807 FK_DIRECT, FK_HEADERS, globalExtraArgFlag,
808 "I<directory>",
809 FLG_INCLUDEPATH,
810 "add to C include path",
811 NULL, 0, 0
812 },
813 {
814 FK_DIRECT, FK_SPEC, globalExtraArgFlag,
815 "S<directory>",
816 FLG_SPECPATH,
817 "add to spec path",
818 NULL, 0, 0
819 },
820 {
821 FK_DISPLAY, FK_ERRORS, plainFlag,
822 "quiet",
823 FLG_QUIET,
824 "suppress herald and error count",
825 NULL, 0, 0
826 },
827 {
828 FK_DISPLAY, FK_ERRORS, plainFlag,
829 "usestderr",
830 FLG_USESTDERR,
831 "send error messages to standard error (instead of standard out)",
832 NULL, 0, 0
833 },
834 {
835 FK_DISPLAY, FK_ERRORS, plainFlag,
836 "showsummary",
837 FLG_SHOWSUMMARY,
838 "show summary of all errors reported and suppressed",
839 NULL, 0, 0
840 },
841 {
842 FK_DISPLAY, FK_FILES, plainFlag,
843 "showscan",
844 FLG_SHOWSCAN,
845 "show file names are they are processed",
846 NULL, 0, 0
847 },
848 {
849 FK_DISPLAY, FK_NONE, globalFlag,
850 "stats",
851 FLG_STATS,
852 "display lines processed and time",
853 NULL, 0, 0
854 },
855 {
856 FK_DISPLAY, FK_NONE, globalFlag,
857 "timedist",
858 FLG_TIMEDIST,
859 "display time distribution",
860 NULL, 0, 0
861 },
862 {
863 FK_DISPLAY, FK_USE, globalFlag,
864 "showalluses",
865 FLG_SHOWUSES,
866 "show sorted list of uses of all globals",
867 NULL, 0, 0
868 },
869 {
870 FK_EFFECT, FK_CONTROL, modeFlag,
871 "noeffect",
872 FLG_NOEFFECT,
873 "statement with no effect",
874 "Statement has no visible effect --- no values are modified.",
875 0, 0
876 },
877 {
878 FK_EFFECT, FK_CONTROL, modeFlag,
879 "noeffectuncon",
880 FLG_NOEFFECTUNCON,
881 "statement with no effect (except possibly through call to "
882 "unconstrained function)",
883 "Statement has no visible effect --- no values are modified. It may "
884 "modify something through a call to an unconstrained function.",
885 0, 0
886 },
887 {
888 FK_EXPORT, FK_SPEC, specialFlag,
889 "exportany",
890 FLG_EXPORTANY,
891 "variable, function or type exported but not specified",
892 "A variable, function or type is exported, but not specified.",
893 0, 0
894 },
895 {
896 FK_EXPORT, FK_SPEC, modeFlag,
897 "exportfcn",
898 FLG_EXPORTFCN,
899 "function exported but not specified",
900 "A function is exported, but not specified.", 0, 0
901 },
902 {
903 FK_EXPORT, FK_SPEC, modeFlag,
904 "exportmacro",
905 FLG_EXPORTMACRO,
906 "expanded macro exported but not specified",
907 "A macro is exported, but not specified.", 0, 0
908 },
909 {
910 FK_EXPORT, FK_SPEC, modeFlag,
911 "exporttype",
912 FLG_EXPORTTYPE,
913 "type definition exported but not specified",
914 "A type is exported, but not specified.", 0, 0
915 },
916 {
917 FK_EXPORT, FK_SPEC, modeFlag,
918 "exportvar",
919 FLG_EXPORTVAR,
920 "variable exported but not specified",
921 "A variable is exported, but not specified.", 0, 0
922 },
923 {
924 FK_EXPORT, FK_SPEC, modeFlag,
925 "exportconst",
926 FLG_EXPORTCONST,
927 "constant exported but not specified",
928 "A constant is exported, but not specified.", 0, 0
929 },
930 {
931 FK_EXPORT, FK_SPEC, modeFlag,
932 "exportiter",
933 FLG_EXPORTITER,
934 "constant exported but not specified",
935 "A constant is exported, but not specified.", 0, 0
936 },
937 {
938 FK_EXPOSURE, FK_ABSTRACT, specialFlag,
939 "repexpose",
940 FLG_REPEXPOSE,
941 "abstract representation is exposed (sets assignexpose, retexpose, and castexpose)",
942 "The internal representation of an abstract type is visible to the "
943 "caller. This means clients may have access to a pointer "
944 "into the abstract representation.",
945 0, 0
946 },
947 {
948 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
949 "retexpose",
950 FLG_RETEXPOSE,
951 "abstract representation is exposed (return values only)",
952 "The return value shares storage with an instance of an abstract "
953 "type. This means clients may have access to a pointer into "
954 "the abstract representation. Use the observer qualifier to "
955 "return exposed storage that may not be modified by the "
956 "client. Use the exposed qualifier to return modifiable "
957 "(but not deallocatable) exposed storage (dangerous).",
958 0, 0
959 },
960 {
961 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
962 "assignexpose",
963 FLG_ASSIGNEXPOSE,
964 "abstract representation is exposed (assignments only)",
965 "Storage internal to the representation of an abstract type is "
966 "assigned to an external pointer. This means clients may "
967 "have access to a pointer into the abstract representation. "
968 "If the external pointer is a parameter, the exposed qualifier "
969 "can be used to allow the assignment, however, this is "
970 "considered dangerous programming practice.",
971 0, 0
972 },
973 {
974 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
975 "castexpose",
976 FLG_CASTEXPOSE,
977 "abstract representation is exposed through a cast",
978 "Storage internal to the representation of an abstract type is exposed "
979 "through a type cast. This means clients may have access to a "
980 "pointer into the abstract representation.",
981 0, 0
885824d3 982 },
983
28bf4b0b 984 {
985 FK_FORMAT, FK_DISPLAY, valueFlag,
986 "linelen",
987 FLG_LINELEN,
988 "set length of messages (number of chars)",
989 NULL, 0, 0
990 },
991 {
992 FK_FORMAT, FK_DISPLAY, valueFlag,
993 "indentspaces",
994 FLG_INDENTSPACES,
995 "set number of spaces to indent sub-messages",
996 NULL, 0, 0
997 },
998 {
999 FK_FORMAT, FK_DISPLAY, plainFlag,
1000 "showcolumn",
1001 FLG_SHOWCOL,
1002 "show column number where error is found",
1003 NULL, 0, 0
1004 },
1005 {
1006 FK_FORMAT, FK_DISPLAY, plainFlag,
1007 "parenfileformat",
1008 FLG_PARENFILEFORMAT,
1009 "show column number where error is found",
1010 NULL, 0, 0
1011 },
1012 {
1013 FK_FORMAT, FK_NONE, plainFlag,
1014 "showfunc",
1015 FLG_SHOWFUNC,
1016 "show name of function containing error",
1017 NULL, 0, 0
1018 },
1019 {
1020 FK_FORMAT, FK_NONE, plainFlag,
1021 "showallconjs",
1022 FLG_SHOWALLCONJS,
1023 "show all possible types",
1024 "When a library function is declared with multiple possible type, the "
1025 "alternate types are shown only if +showallconjs.",
1026 0, 0
1027 },
1028 {
1029 FK_LIBS, FK_NONE, plainFlag,
1030 "impconj",
1031 FLG_IMPCONJ,
1032 "make all alternate types implicit (useful for making system libraries",
1033 NULL, 0, 0
885824d3 1034 } ,
28bf4b0b 1035 {
1036 FK_GLOBAL, FK_ERRORS, globalValueFlag,
1037 "expect",
1038 FLG_EXPECT,
1039 "expect <int> code errors",
1040 NULL, 0, 0
1041 },
1042 {
1043 FK_GLOBAL, FK_ERRORS, globalValueFlag,
1044 "lclexpect",
1045 FLG_LCLEXPECT,
1046 "expect <int> spec errors",
1047 NULL, 0, 0
1048 },
1049 {
1050 FK_GLOBAL, FK_USE, idemSpecialFlag,
1051 "partial",
1052 FLG_PARTIAL,
1053 "check as partial system (-specundef, -declundef, -exportlocal, "
1054 "don't check macros in headers without corresponding .c files)",
1055 NULL, 0, 0
1056 },
1057 {
1058 FK_GLOBALS, FK_SPEC, plainFlag,
1059 "globs",
1060 FLG_GLOBALS,
1061 "undocumented use of a checked global variable",
1062 "A checked global variable is used in the function, but not listed in "
1063 "its globals clause. By default, only globals specified in .lcl "
1064 "files are checked. To check all globals, use +allglobals. To "
1065 "check globals selectively use /*@checked@*/ in the global "
1066 "declaration.",
1067 0, 0
1068 },
1069 {
1070 FK_GLOBALS, FK_SPEC, modeFlag,
1071 "globuse",
1072 FLG_USEALLGLOBS,
1073 "global listed for a function not used",
1074 "A global variable listed in the function's globals list is not used "
1075 "in the body of the function.",
1076 0, 0
1077 },
1078 {
1079 FK_GLOBALS, FK_NONE, modeFlag,
1080 "internalglobs",
1081 FLG_INTERNALGLOBS,
1082 "use of internalState",
1083 "A called function uses internal state, but the globals list for the "
1084 "function being checked does not include internalState",
1085 0, 0
1086 },
1087 {
1088 FK_GLOBALS, FK_NONE, modeFlag,
1089 "internalglobsnoglobs",
1090 FLG_INTERNALGLOBSNOGLOBS,
1091 "use of internalState (in function with no globals list)",
1092 "A called function uses internal state, but the function being checked "
1093 "has no globals list",
1094 0, 0
1095 },
1096 {
1097 FK_GLOBALS, FK_MODIFIES, modeFlag,
1098 "warnmissingglobs",
1099 FLG_WARNMISSINGGLOBALS,
1100 "global variable used in modifies clause is not listed in globals list",
1101 "A global variable is used in the modifies clause, but it not listed in "
1102 "the globals list. The variable will be added to the globals list.",
1103 0, 0
885824d3 1104 },
1105
28bf4b0b 1106 {
1107 FK_GLOBALS, FK_MODIFIES, modeFlag,
1108 "warnmissingglobsnoglobs",
1109 FLG_WARNMISSINGGLOBALSNOGLOBS,
1110 "global variable used in modifies clause in a function with no globals list",
1111 "A global variable is used in the modifies clause, but the function "
1112 "has no globals list. The variable will be added to the globals list.",
1113 0, 0
1114 },
1115 {
1116 FK_GLOBALS, FK_UNSPEC, modeFlag,
1117 "globnoglobs",
1118 FLG_GLOBUNSPEC,
1119 "use of checked global in a function with no globals list or specification",
1120 "A specified global variable is used in the function, but not listed "
1121 "in its globals list. Without +globnoglobs, only globals "
1122 "declared with /*@checkedstrict@*/ will produce use "
1123 "errors in functions without globals "
1124 "lists. The /*@globals ... @*/ control comment can be used to give "
1125 "a globals list for an unspecified function.",
1126 0, 0
1127 },
1128 {
1129 FK_GLOBALS, FK_IMPLICIT, modeFlag,
1130 "allglobs",
1131 FLG_ALLGLOBALS,
1132 "report use and modification errors for globals not annotated with unchecked",
1133 NULL, 0, 0
1134 },
1135 {
1136 FK_GLOBALS, FK_UNSPEC, modeFlag,
1137 "checkstrictglobs",
1138 FLG_CHECKSTRICTGLOBALS,
1139 "report use and modification errors for checkedstrict globals",
1140 NULL, 0, 0
1141 },
1142 {
1143 FK_GLOBALS, FK_UNSPEC, modeFlag,
1144 "impcheckedspecglobs",
1145 FLG_IMPCHECKEDSPECGLOBALS,
1146 "assume checked qualifier for unqualified global declarations in .lcl files",
1147 NULL, 0, 0
1148 },
1149 {
1150 FK_GLOBALS, FK_UNSPEC, modeFlag,
1151 "impcheckmodspecglobs",
1152 FLG_IMPCHECKMODSPECGLOBALS,
1153 "assume checkmod qualifier for unqualified global declarations in .lcl files",
1154 NULL, 0, 0
1155 },
1156 {
1157 FK_GLOBALS, FK_UNSPEC, modeFlag,
1158 "impcheckedstrictspecglobs",
1159 FLG_IMPCHECKEDSTRICTSPECGLOBALS,
1160 "assume checkmod qualifier for unqualified global declarations in .lcl files",
1161 NULL, 0, 0
1162 },
1163 {
1164 FK_GLOBALS, FK_UNSPEC, modeFlag,
1165 "impcheckedglobs",
1166 FLG_IMPCHECKEDGLOBALS,
1167 "assume checked qualifier for unqualified global declarations",
1168 NULL, 0, 0
1169 },
1170 {
1171 FK_GLOBALS, FK_UNSPEC, modeFlag,
1172 "impcheckmodglobs",
1173 FLG_IMPCHECKMODGLOBALS,
1174 "assume checkmod qualifier for unqualified global declarations",
1175 NULL, 0, 0
1176 },
1177 {
1178 FK_GLOBALS, FK_UNSPEC, modeFlag,
1179 "impcheckedstrictglobs",
1180 FLG_IMPCHECKEDSTRICTGLOBALS,
1181 "assume checkedstrict qualifier for unqualified global declarations",
1182 NULL, 0, 0
1183 },
1184 {
1185 FK_GLOBALS, FK_UNSPEC, modeFlag,
1186 "impcheckedstatics",
1187 FLG_IMPCHECKEDSTATICS,
1188 "assume checked qualifier for unqualified file static declarations",
1189 NULL, 0, 0
1190 },
1191 {
1192 FK_GLOBALS, FK_UNSPEC, modeFlag,
1193 "impcheckmodstatics",
1194 FLG_IMPCHECKMODSTATICS,
1195 "assume checkmod qualifier for unqualified file static declarations",
1196 NULL, 0, 0
1197 },
1198 {
1199 FK_GLOBALS, FK_UNSPEC, modeFlag,
1200 "impcheckmodinternals",
1201 FLG_IMPCHECKMODINTERNALS,
1202 "assume checkmod qualifier for unqualified local "
1203 "static declarations (for internal state modifications)",
1204 NULL, 0, 0
1205 },
1206 {
1207 FK_GLOBALS, FK_UNSPEC, modeFlag,
1208 "impcheckedstrictstatics",
1209 FLG_IMPCHECKEDSTRICTSTATICS,
1210 "assume checkedstrict qualifier for unqualified file static declarations",
1211 NULL, 0, 0
1212 },
1213 {
1214 FK_GLOBALS, FK_MODIFIES, modeFlag,
1215 "modglobs",
1216 FLG_MODGLOBS,
1217 "undocumented modification of a checked global variable",
1218 "A checked global variable is modified by the function, but not listed in "
1219 "its modifies clause.",
1220 0, 0
1221 },
1222 {
1223 FK_GLOBALS, FK_MODIFIES, modeFlag,
1224 "modglobsnomods",
1225 FLG_MODGLOBSUNSPEC,
1226 "undocumented modification of a checked global variable in a function "
1227 "declared with no modifies clause",
1228 "A checked global variable is modified by the function, but not listed in "
1229 "its modifies clause.",
1230 0, 0
1231 },
1232 {
1233 FK_GLOBALS, FK_MODIFIES, modeFlag,
1234 "modstrictglobsnomods",
1235 FLG_MODSTRICTGLOBSUNSPEC,
1236 "undocumented modification of a strict checked global variable in a "
1237 "function declared with no modifies clause",
1238 "A checked global variable is modified by the function, but not listed in "
1239 "its modifies clause.",
1240 0, 0
1241 },
1242 {
1243 FK_GLOBALS, FK_MODIFIES, modeFlag,
1244 "modglobsunchecked",
1245 FLG_MODGLOBSUNCHECKED,
1246 "undocumented modification of an unchecked checked global variable",
1247 "An unchecked global variable is modified by the function, but not listed in "
1248 "its modifies clause.",
1249 0, 0
1250 },
1251 {
1252 FK_HEADERS, FK_DEBUG, debugFlag,
1253 "keep",
1254 FLG_KEEP,
1255 NULL, NULL,
1256 0, 0
1257 },
1258 {
1259 FK_HEADERS, FK_SPEC, globalFlag,
1260 "lh",
1261 FLG_DOLH,
1262 "generate .lh files", NULL,
1263 0, 0
1264 },
1265 {
1266 FK_HEADERS, FK_SPEC, globalFlag,
1267 "lcs",
1268 FLG_DOLCS,
1269 "generate .lcs files", NULL,
1270 0, 0
1271 },
1272 {
1273 FK_HEADERS, FK_SPEED, globalFlag,
1274 "singleinclude",
1275 FLG_SINGLEINCLUDE,
1276 "optimize header inclusion to eliminate redundant includes",
1277 "When checking multiple files, each header file is processed only "
1278 "once. This may change the meaning of the code, if the "
1279 "same header file is included in different contexts (e.g., the "
1280 "header file includes #if directives and the values are "
1281 "different when it is included in different places.)",
1282 0, 0
1283 },
1284 {
1285 FK_HEADERS, FK_SPEED, globalFlag,
1286 "neverinclude",
1287 FLG_NEVERINCLUDE,
1288 "optimize header inclusion to not include any header files",
1289 "Ignore header includes. Only works if relevant information is "
1290 "loaded from a library.",
1291 0, 0
1292 },
1293 {
1294 FK_HEADERS, FK_SPEED, globalFlag,
1295 "skipsysheaders",
1296 FLG_SKIPSYSHEADERS,
1297 "do not include header files in system directories (set by -sysdirs)",
1298 "Do not include header files in system directories (set by -sysdirs)",
1299 0, 0
1300 },
1301 {
1302 FK_HELP, FK_NONE, plainFlag,
1303 "warnflags",
1304 FLG_WARNFLAGS,
1305 "warn when command line sets flag to default value in mode",
1306 NULL, 0, 0
1307 },
1308 {
1309 FK_HELP, FK_NONE, plainFlag,
1310 "warnunixlib",
1311 FLG_WARNUNIXLIB,
1312 "warn when the unix library is used",
1313 NULL, 0, 0
1314 },
1315 {
1316 FK_HELP, FK_NONE, plainFlag,
1317 "badflag",
1318 FLG_BADFLAG,
1319 "a flag is not recognized or used in an incorrect way",
1320 NULL, 0, 0
1321 },
1322 {
1323 FK_HELP, FK_NONE, plainFlag,
1324 "forcehints",
1325 FLG_FORCEHINTS,
1326 "provide hints for all errors reported",
1327 NULL, 0, 0
1328 },
1329 {
1330 FK_HELP, FK_NONE, globalExtraArgFlag,
1331 "help",
1332 FLG_HELP,
1333 "-help <flags> will describe flags",
1334 NULL, 0, 0
1335 },
1336 {
1337 FK_HELP, FK_FORMAT, plainFlag,
1338 "hints",
1339 FLG_HINTS,
1340 "provide hints on using lclint (hint only reported for first related error)",
1341 NULL, 0, 0
1342 },
1343 {
1344 FK_IGNORERET, FK_NONE, specialFlag,
1345 "retval",
1346 FLG_RETVAL,
1347 "return value ignored (sets retvalint, retvalbool and retvalother)",
1348 "Result returned by function call is not used. If this is intended, "
1349 "cast result to (void) to eliminate message.",
1350 0, 0
1351 },
1352 {
1353 FK_IGNORERET, FK_BOOL, modeFlag,
1354 "retvalother",
1355 FLG_RETVALOTHER,
1356 "return value of type other than bool or int ignored",
1357 "Result returned by function call is not used. If this is intended, "
1358 "can cast result to (void) to eliminate message.",
1359 0, 0
1360 },
1361 {
1362 FK_IGNORERET, FK_BOOL, modeFlag,
1363 "retvalbool",
1364 FLG_RETVALBOOL,
1365 "return value of manifest type bool ignored",
1366 "Result returned by function call is not used. If this is intended, "
1367 "can cast result to (void) to eliminate message.",
1368 0, 0
1369 },
1370 {
1371 FK_IGNORERET, FK_NONE, modeFlag,
1372 "retvalint",
1373 FLG_RETVALINT,
1374 "return value of type int ignored",
1375 "Result returned by function call is not used. If this is intended, "
1376 "can cast result to (void) to eliminate message.",
1377 0, 0
1378 },
1379 {
1380 FK_INIT, FK_FILES, globalExtraArgFlag,
1381 "f",
1382 FLG_OPTF,
1383 "load options file (default ~/.lclintrc not loaded)",
1384 NULL, 0, 0
1385 },
1386 {
1387 FK_INIT, FK_FILES, globalExtraArgFlag,
1388 "i",
1389 FLG_INIT,
1390 "set LCL initilization file",
1391 NULL, 0, 0
1392 },
1393 {
1394 FK_INIT, FK_FILES, globalFlag,
1395 "nof",
1396 FLG_NOF,
1397 "do not read options file",
1398 NULL, 0, 0
1399 },
1400 {
1401 FK_INIT, FK_SPEC, plainFlag,
1402 "needspec",
1403 FLG_NEEDSPEC,
1404 "information in specifications is not also included in syntactic comments",
1405 "There is information in the specification that is not duplicated "
1406 "in syntactic comments. Normally, this is not an "
1407 "error, but it may be useful to detect it to make "
1408 "sure checking incomplete systems without the specifications will "
1409 "still use this information.",
1410 0, 0
1411 },
1412 {
1413 FK_DECL, FK_LIBS, plainFlag,
1414 "newdecl",
1415 FLG_NEWDECL,
1416 "report new global declarations in source files",
1417 "There is a new declaration that is not declared in a loaded library "
1418 "or earlier file. (Use this flag to check for consistency "
1419 "against a library.)",
1420 0, 0
1421 },
1422 {
1423 FK_ITER, FK_NONE, plainFlag,
1424 "iter",
1425 FLG_ITER,
1426 NULL, NULL,
1427 0, 0
1428 },
1429 {
1430 FK_ITER, FK_NONE, plainFlag,
1431 "hasyield",
1432 FLG_HASYIELD,
1433 "iter declaration has no yield parameters",
1434 "An iterator has been declared with no parameters annotated with "
1435 "yield. This may be what you want, if the iterator is meant "
1436 "to do something a fixed number of times, but returns no "
1437 "information to the calling context. Probably, a parameter "
1438 "is missing the yield annotation to indicate that it is "
1439 "assigned a value in the calling context.",
1440 0, 0
1441 },
1442 {
1443 FK_LIBS, FK_FILES, globalStringFlag,
1444 "dump",
1445 FLG_DUMP,
1446 "save state for merging (default suffix .lcd)",
1447 NULL, 0, 0
1448 },
1449 {
1450 FK_LIBS, FK_FILES, globalStringFlag,
1451 "load",
1452 FLG_MERGE,
1453 "load state from dump file (default suffix .lcd)",
1454 NULL, 0, 0
1455 },
1456 {
1457 FK_LIBS, FK_INIT, idemGlobalFlag,
1458 "nolib",
1459 FLG_NOLIB,
1460 "do not load standard library",
1461 NULL, 0, 0
1462 },
1463 {
1464 FK_LIBS, FK_INIT, globalFlag,
1465 "ansilib",
1466 FLG_ANSILIB,
1467 "use ANSI (ISO) standard library",
1468 "Library based on the ANSI standard library specification is used.",
1469 0, 0
1470 },
1471 {
1472 FK_LIBS, FK_INIT, globalFlag,
1473 "strictlib",
1474 FLG_STRICTLIB,
1475 "interpret standard library strictly",
1476 "Stricter version of the standard library is used. (The default "
1477 "library is standard.lcd; strict library is strict.lcd.)",
1478 0, 0
1479 },
1480 {
1481 FK_LIBS, FK_INIT, globalFlag,
1482 "unixlib",
1483 FLG_UNIXLIB,
1484 "use UNIX (sort-of) standard library",
1485 "UNIX version of the standard library is used.",
1486 0, 0
1487 },
1488 {
1489 FK_LIBS, FK_INIT, globalFlag,
1490 "unixstrictlib",
1491 FLG_UNIXSTRICTLIB,
1492 "use strict version of UNIX (sort-of) library",
1493 "strict version of the UNIX library is used.",
1494 0, 0
1495 },
1496 {
1497 FK_LIBS, FK_INIT, globalFlag,
1498 "posixlib",
1499 FLG_POSIXLIB,
1500 "use POSIX standard library",
1501 "POSIX version of the standard library is used.",
1502 0, 0
1503 },
1504 {
1505 FK_LIBS, FK_INIT, globalFlag,
1506 "posixstrictlib",
1507 FLG_POSIXSTRICTLIB,
1508 "use strict POSIX standard library",
1509 "POSIX version of the strict standard library is used.",
1510 0, 0
1511 },
1512 {
1513 FK_LIBS, FK_INIT, globalFlag,
1514 "whichlib",
1515 FLG_WHICHLIB,
1516 "show standard library filename",
1517 NULL, 0, 0
1518 },
1519 {
1520 FK_LIBS, FK_FILES, globalStringFlag,
1521 "mts",
1522 FLG_MTSFILE,
1523 "load meta state declaration and corresponding xh file",
1524 NULL, 0, 0
1525 },
1526 {
1527 FK_INIT, FK_COMMENTS, valueFlag,
1528 "commentchar",
1529 FLG_COMMENTCHAR,
1530 "set marker character for syntactic comments (default is '@')",
1531 "Set the marker character for syntactic comments. Comments beginning "
1532 "with /*<char> are interpreted by lclint, where <char> is the "
1533 "comment marker character.",
1534 0, 0
1535 },
1536 {
1537 FK_MACROS, FK_NONE, plainSpecialFlag,
1538 "allmacros",
1539 FLG_ALLMACROS,
1540 "sets fcnmacros and constmacros",
1541 "All macros (not preceded by /*@notfunction@*/) are checked as functions or "
1542 "constants depending on whether or not they have parameter lists.",
885824d3 1543 0, 0
28bf4b0b 1544 },
1545 {
1546 FK_MACROS, FK_NONE, plainFlag,
1547 "libmacros",
1548 FLG_LIBMACROS,
1549 "check all macros with declarations in library as functions",
1550 "Every macro declared in the load library is checked.",
885824d3 1551 0, 0
28bf4b0b 1552 },
1553 {
1554 FK_MACROS, FK_NONE, plainFlag,
1555 "specmacros",
1556 FLG_SPECMACROS,
1557 "check all macros corresponding to specified functions or constants",
1558 "Every macro declared a specification file is checked.",
885824d3 1559 0, 0
28bf4b0b 1560 },
1561 {
1562 FK_MACROS, FK_NONE, plainFlag,
1563 "fcnmacros",
1564 FLG_FCNMACROS,
1565 "check all macros with parameter lists as functions",
1566 "Every parameterized macro (not preceded by /*@notfunction@*/) "
1567 "is checked as a function.",
885824d3 1568 0, 0
28bf4b0b 1569 },
1570 {
1571 FK_MACROS, FK_NONE, plainFlag,
1572 "constmacros",
1573 FLG_CONSTMACROS,
1574 "check all macros without parameter lists as constants",
1575 "Every non-parameterized macro (not preceded by /*@notfunction@*/) "
1576 "is checked as a constant.",
885824d3 1577 0, 0
885824d3 1578 },
28bf4b0b 1579 {
1580 FK_MACROS, FK_NONE, modeFlag,
1581 "macromatchname",
1582 FLG_MACROMATCHNAME,
1583 "macro definition does not match iter or constant declaration",
1584 "A iter or constant macro is defined using a different name from the "
1585 "one used in the previous syntactic comment",
1586 0, 0
1587 },
1588 {
1589 FK_MACROS, FK_NONE, plainFlag,
1590 "nextlinemacros",
1591 FLG_MACRONEXTLINE,
1592 "the line after a constant or iter declaration must be a macro definition",
1593 "A constant or iter declaration is not immediately followed by a macro definition.",
1594 0, 0
1595 },
1596 {
1597 FK_MACROS, FK_NONE, modeFlag,
1598 "macrostmt",
1599 FLG_MACROSTMT,
1600 "macro definition is syntactically not equivalent to function",
1601 "A macro is defined in a way that may cause syntactic problems. If the macro returns a value, use commas to separate expressions; otherwise, use do { <macro body> } while (FALSE) construct.",
1602 0, 0
1603 },
1604 {
1605 FK_MACROS, FK_NONE, modeFlag,
1606 "macroempty",
1607 FLG_MACROEMPTY,
1608 "macro definition for is empty",
1609 "A macro definition has no body.",
1610 0, 0
1611 },
1612 {
1613 FK_MACROS, FK_PARAMS, modeFlag,
1614 "macroparams",
1615 FLG_MACROPARAMS,
1616 "macro parameter not used exactly once",
1617 "A macro parameter is not used exactly once in all possible "
1618 "invocations of the macro. To behave like a function, "
1619 "each macro parameter must be used exactly once on all "
1620 "invocations of the macro so that parameters with "
1621 "side-effects are evaluated exactly once. Use /*@sef@*/ to "
1622 "denote parameters that must be side-effect free.",
1623 0, 0
1624 },
1625 {
1626 FK_MACROS, FK_PARAMS, modeFlag,
1627 "macroassign",
1628 FLG_MACROASSIGN,
1629 "assignment to a macro parameter",
1630 "A macro parameter is used as the left side of an "
1631 "assignment expression. This exhibits behavior that "
1632 "could not be implemented by a function.",
1633 0, 0
1634 },
1635 {
1636 FK_MACROS, FK_PARAMS, modeFlag,
1637 "sefparams",
1638 FLG_SEFPARAMS,
1639 "a parameter with side-effects is passed as a sef parameter",
1640 "An actual parameter corresponding to a sef parameter may have a side-effect.",
1641 0, 0
1642 },
1643 {
1644 FK_MACROS, FK_PARAMS, modeFlag,
1645 "sefuncon",
1646 FLG_SEFUNSPEC,
1647 "a parameter with unconstrained side-effects is passed as a sef parameter",
1648 "An actual parameter corresponding to a sef parameter involves a call "
1649 "to a procedure with no modifies clause that may have a side-effect.",
1650 0, 0
1651 },
1652 {
1653 FK_MACROS, FK_NONE, modeFlag,
1654 "macroparens",
1655 FLG_MACROPARENS,
1656 "macro parameter used without parentheses (in potentially dangerous context)",
1657 "A macro parameter is used without parentheses. This could be "
1658 "dangerous if the macro is invoked with a complex expression "
1659 "and precedence rules will change the evaluation inside the macro.",
1660 0, 0
1661 },
1662 {
1663 FK_MACROS, FK_PROTOS, modeFlag,
1664 "macrodecl",
1665 FLG_MACRODECL,
1666 "macro without prototype or specification (sets macrofcndecl and macroconstdecl)",
1667 "Argument checking cannot be done well for macros without prototypes "
1668 "or specifications, since the types of the arguments are unknown.",
1669 0, 0
1670 },
1671 {
1672 FK_MACROS, FK_PROTOS, modeFlag,
1673 "macrofcndecl",
1674 FLG_MACROFCNDECL,
1675 "parameterized macro without prototype or specification",
1676 "Function macro has no declaration.",
1677 0, 0
1678 },
1679 {
1680 FK_MACROS, FK_PROTOS, modeFlag,
1681 "macroconstdecl",
1682 FLG_MACROCONSTDECL,
1683 "non-parameterized macro without prototype or specification",
1684 "Macro constant has no declaration. Use /*@constant ...@*/ to "
1685 "declare the macro.",
1686 0, 0
1687 },
1688 {
1689 FK_MACROS, FK_NONE, modeFlag,
1690 "macroredef",
1691 FLG_MACROREDEF,
1692 "macro redefined",
1693 "A macro is defined in more than one place.", 0, 0
1694 },
1695 {
1696 FK_MACROS, FK_UNRECOG, modeFlag,
1697 "macrounrecog",
1698 FLG_MACROUNDEF,
1699 "unrecognized identifier in macro",
1700 "An unrecognized identifier appears in a macro. If the identifier "
1701 "is defined before the macro is used, then this is okay.",
1702 0, 0
1703 },
1704 {
1705 FK_MEMORY, FK_DEAD, modeFlag,
1706 "stackref",
1707 FLG_RETSTACK,
1708 "external reference to stack-allocated storage is created",
1709 "A stack reference is pointed to by an external reference when the "
1710 "function returns. The stack-allocated storage is destroyed "
1711 "after the call, leaving a dangling reference.",
1712 0, 0
1713 },
1714 {
1715 FK_MEMORY, FK_DEAD, modeFlag,
1716 "usereleased",
1717 FLG_USERELEASED,
1718 "storage used after release",
1719 "Memory is used after it has been released (either by passing "
1720 "as an only param or assigning to and only global.",
1721 0, 0
1722 },
1723 {
1724 FK_MEMORY, FK_DEAD, modeFlag,
1725 "strictusereleased",
1726 FLG_STRICTUSERELEASED,
1727 "element used after it may have been released",
1728 "Memory (through fetch) is used after it may have been released "
1729 "(either by passing as an only param or assigning to and only global.",
1730 0, 0
1731 },
1732 {
1733 FK_MEMORY, FK_DEF, modeFlag,
1734 "compdef",
1735 FLG_COMPDEF,
1736 "parameter, return value or global completely defined",
1737 "Storage derivable from a parameter, return value or global is "
1738 "not defined. Use /*@out@*/ to denote passed or returned "
1739 "storage which need not be defined.",
1740 0, 0
1741 },
1742 {
1743 FK_MEMORY, FK_DEF, modeFlag,
1744 "compmempass",
1745 FLG_COMPMEMPASS,
1746 "actual parameter matches alias kind of formal parameter completely ",
1747 "Storage derivable from a parameter does not match the alias kind "
1748 "expected for the formal parameter.",
1749 0, 0
1750 },
1751 {
1752 FK_MEMORY, FK_DEF, modeFlag,
1753 "mustdefine",
1754 FLG_MUSTDEFINE,
1755 "out storage not defined before return or scope exit",
1756 "An out parameter or global is not defined before control is transferred.",
1757 0, 0
1758 },
1759 {
1760 FK_MEMORY, FK_DEF, modeFlag,
1761 "uniondef",
1762 FLG_UNIONDEF,
1763 "at least one field of a union must be defined",
1764 "No field of a union is defined. Generally, one field of a union is "
1765 "expected to be defined.",
1766 0, 0
1767 },
1768 {
1769 FK_MEMORY, FK_IMPLICIT, modeFlag,
1770 "memimp",
1771 FLG_MEMIMPLICIT,
1772 "memory errors for unqualified storage",
1773 NULL, 0, 0
1774 },
1775 {
1776 FK_MEMORY, FK_IMPLICIT, plainFlag,
1777 "paramimptemp",
1778 FLG_PARAMIMPTEMP,
1779 "assume unannotated parameter is temp",
1780 NULL, 0, 0
1781 },
1782 {
1783 FK_MEMORY, FK_IMPLICIT, specialFlag,
1784 "allimponly",
1785 FLG_ALLIMPONLY,
1786 "sets globimponly, retimponly, structimponly, specglobimponly, "
1787 "specretimponly and specstructimponly",
1788 NULL, 0, 0
1789 },
1790 {
1791 FK_MEMORY, FK_IMPLICIT, specialFlag,
1792 "codeimponly",
1793 FLG_CODEIMPONLY,
1794 "sets globimponly, retimponly and structimponly",
1795 NULL, 0, 0
1796 },
1797 {
1798 FK_MEMORY, FK_IMPLICIT, specialFlag,
1799 "specimponly",
1800 FLG_SPECALLIMPONLY,
1801 "sets specglobimponly, specretimponly and specstructimponly",
1802 NULL, 0, 0
1803 },
1804 {
1805 FK_MEMORY, FK_IMPLICIT, plainFlag,
1806 "globimponly",
1807 FLG_GLOBIMPONLY,
1808 "assume unannotated global storage is only",
1809 NULL, 0, 0
1810 },
1811 {
1812 FK_MEMORY, FK_IMPLICIT, plainFlag,
1813 "retimponly",
1814 FLG_RETIMPONLY,
1815 "assume unannotated returned storage is only",
1816 NULL, 0, 0
1817 },
1818 {
1819 FK_MEMORY, FK_IMPLICIT, plainFlag,
1820 "structimponly",
1821 FLG_STRUCTIMPONLY,
1822 "assume unannotated structure field is only",
1823 NULL, 0, 0
1824 },
1825 {
1826 FK_MEMORY, FK_IMPLICIT, plainFlag,
1827 "specglobimponly",
1828 FLG_SPECGLOBIMPONLY,
1829 "assume unannotated global storage is only",
1830 NULL, 0, 0
1831 },
1832 {
1833 FK_MEMORY, FK_IMPLICIT, plainFlag,
1834 "specretimponly",
1835 FLG_SPECRETIMPONLY,
1836 "assume unannotated returned storage is only",
1837 NULL, 0, 0
1838 },
1839 {
1840 FK_MEMORY, FK_IMPLICIT, plainFlag,
1841 "specstructimponly",
1842 FLG_SPECSTRUCTIMPONLY,
1843 "assume unannotated structure field is only",
1844 NULL, 0, 0
1845 },
1846 {
1847 FK_MEMORY, FK_ARRAY, modeFlag,
1848 "deparrays",
1849 FLG_DEPARRAYS,
1850 "array elements are dependent storage",
1851 "When an element is fetched from an array, lclint analysis is "
1852 "not able to determine if the same element is reused. "
1853 "If +deparrays, lclint will mark local storage assigned from "
1854 "array fetches as dependent.",
1855 0, 0
1856 },
1857 {
1858 FK_MEMORY, FK_LEAK, modeFlag,
1859 "compdestroy",
1860 FLG_COMPDESTROY,
1861 "all only references derivable from void pointer out only parameter are released",
1862 "A storage leak due to incomplete deallocation of a structure or deep "
1863 "pointer is suspected. Unshared storage that is reachable from "
1864 "a reference that is being deallocated has not yet been deallocated. "
1865 "LCLint assumes when an object is passed "
1866 "as an out only void pointer that the outer object will be "
1867 "deallocated, but the inner objects will not.",
1868 0, 0
1869 },
1870 {
1871 FK_MEMORY, FK_LEAK, modeFlag,
1872 "strictdestroy",
1873 FLG_STRICTDESTROY,
1874 "report complete destruction errors for array elements that "
1875 "may have been released",
1876 NULL,
1877 0, 0
1878 },
1879 {
1880 FK_MEMORY, FK_LEAK, modeFlag,
1881 "mustfree",
1882 FLG_MUSTFREE,
1883 "only storage not released before return or scope exit",
1884 "A memory leak has been detected. Newly-allocated or "
1885 "only-qualified storage is not released before the last "
1886 "reference to it is lost.",
1887 0, 0
1888 },
1889 {
1890 FK_MEMORY, FK_NONE, modeFlag,
1891 "branchstate",
1892 FLG_BRANCHSTATE,
1893 "storage has inconsistent states of alternate paths through a branch",
1894 "The state of a variable is different depending on which branch "
1895 "is taken. This means no annotation can sensibly be applied "
1896 "to the storage.",
1897 0, 0
1898 },
1899 {
1900 FK_MEMORY, FK_NONE, modeFlag,
1901 "strictbranchstate",
1902 FLG_STRICTBRANCHSTATE,
1903 "storage through array fetch has inconsistent states of alternate "
1904 "paths through a branch",
1905 "The state of a variable through an array fetch is different depending "
1906 "on which branch is taken. This means no annotation can sensibly be applied "
1907 "to the storage.",
1908 0, 0
1909 },
1910 {
1911 FK_MEMORY, FK_NONE, specialFlag,
1912 "memchecks",
1913 FLG_MEMCHECKS,
1914 "sets all dynamic memory checking flags (memimplicit, mustfree, mustdefine, "
1915 "mustnotalias, null, memtrans)",
1916 NULL, 0, 0
1917 },
1918 {
1919 FK_MEMORY, FK_NONE, specialFlag,
1920 "memtrans",
1921 FLG_MEMTRANS,
1922 "memory transfer errors (sets all *trans flags)",
1923 "Memory is transferred in a way that violates annotations.",
1924 0, 0
1925 },
1926 {
1927 FK_MEMORY, FK_NONE, modeFlag,
1928 "exposetrans",
1929 FLG_EXPOSETRANS,
1930 "exposure transfer errors",
1931 "Exposed storage is transferred to a non-exposed, non-observer reference.",
1932 0, 0
1933 },
1934 {
1935 FK_MEMORY, FK_NONE, modeFlag,
1936 "observertrans",
1937 FLG_OBSERVERTRANS,
1938 "observer transfer errors",
1939 "Observer storage is transferred to a non-observer reference.",
1940 0, 0
1941 },
1942 {
1943 FK_MEMORY, FK_NONE, modeFlag,
1944 "dependenttrans",
1945 FLG_DEPENDENTTRANS,
1946 "dependent transfer errors",
1947 "Dependent storage is transferred to a non-dependent reference.",
1948 0, 0
1949 },
1950 {
1951 FK_MEMORY, FK_NONE, modeFlag,
1952 "newreftrans",
1953 FLG_NEWREFTRANS,
1954 "new reference transfer to reference counted reference",
1955 "A new reference is transferred to a reference counted reference.",
1956 0, 0
1957 },
1958 {
1959 FK_MEMORY, FK_NONE, modeFlag,
1960 "onlytrans",
1961 FLG_ONLYTRANS,
1962 "only storage transferred to non-only reference (memory leak)",
1963 "The only reference to this storage is transferred to another "
1964 "reference (e.g., by returning it) that does not have the "
1965 "only annotation. This may lead to a memory leak, since the "
1966 "new reference is not necessarily released.",
1967 0, 0
1968 },
1969 {
1970 FK_MEMORY, FK_NONE, modeFlag,
1971 "onlyunqglobaltrans",
1972 FLG_ONLYUNQGLOBALTRANS,
1973 "only storage transferred to an unqualified global or "
1974 "static reference (memory leak)",
1975 "The only reference to this storage is transferred to another "
1976 "reference that does not have an aliasing annotation. "
1977 "This may lead to a memory leak, since the "
1978 "new reference is not necessarily released.",
1979 0, 0
1980 },
1981 {
1982 FK_MEMORY, FK_NONE, modeFlag,
1983 "ownedtrans",
1984 FLG_OWNEDTRANS,
1985 "owned storage transferred to non-owned reference (memory leak)",
1986 "The owned reference to this storage is transferred to another "
1987 "reference (e.g., by returning it) that does not have the "
1988 "owned annotation. This may lead to a memory leak, since the "
1989 "new reference is not necessarily released.",
1990 0, 0
1991 },
1992 {
1993 FK_MEMORY, FK_NONE, modeFlag,
1994 "freshtrans",
1995 FLG_FRESHTRANS,
1996 "fresh storage transferred to non-only reference (memory leak)",
1997 "Fresh storage (newly allocated in this function) is transferred "
1998 "in a way that the obligation to release storage is not "
1999 "propagated. Use the /*@only@*/ annotation to indicate "
2000 "the a return value is the only reference to the returned "
2001 "storage.",
2002 0, 0
2003 },
2004 {
2005 FK_MEMORY, FK_NONE, modeFlag,
2006 "sharedtrans",
2007 FLG_SHAREDTRANS,
2008 "shared storage transferred to non-shared reference",
2009 "Shared storage is transferred to a non-shared reference. The other "
2010 "reference may release storage needed by this reference.",
2011 0, 0
2012 },
2013 {
2014 FK_MEMORY, FK_NONE, modeFlag,
2015 "temptrans",
2016 FLG_TEMPTRANS,
2017 "temp storage transferred to non-temporary reference",
2018 "Temp storage (associated with a formal parameter) is transferred "
2019 "to a non-temporary reference. The storage may be released "
2020 "or new aliases created.",
2021 0, 0
2022 },
2023 {
2024 FK_MEMORY, FK_NONE, modeFlag,
2025 "kepttrans",
2026 FLG_KEPTTRANS,
2027 "kept storage transferred to non-temporary reference",
2028 "Kept storage is transferred "
2029 "to a non-temporary reference. The storage may be released "
2030 "or new aliases created.",
2031 0, 0
2032 },
2033 {
2034 FK_MEMORY, FK_NONE, modeFlag,
2035 "keeptrans",
2036 FLG_KEEPTRANS,
2037 "keep storage transferred inconsistently",
2038 "Keep storage is transferred inconsistently --- either in a way "
2039 "that may add a new alias to it, or release it.",
2040 0, 0
2041 },
2042 {
2043 FK_MEMORY, FK_NONE, modeFlag,
2044 "immediatetrans",
2045 FLG_IMMEDIATETRANS,
2046 "an immediate address (result of &) is transferred inconsistently",
2047 "An immediate address (result of & operator) is transferred "
2048 "inconsistently.",
2049 0, 0
2050 },
2051 {
2052 FK_MEMORY, FK_NONE, modeFlag,
2053 "refcounttrans",
2054 FLG_REFCOUNTTRANS,
2055 "reference counted storage is transferred in an inconsistent way",
2056 "Reference counted storage is transferred in a way that may not "
2057 "be consistent with the reference count.",
2058 0, 0
2059 },
2060 {
2061 FK_MEMORY, FK_NONE, modeFlag,
2062 "statictrans",
2063 FLG_STATICTRANS,
2064 "static storage is transferred in an inconsistent way",
2065 "Static storage is transferred in an inconsistent way.",
2066 0, 0
2067 },
2068 {
2069 FK_MEMORY, FK_NONE, modeFlag,
2070 "unqualifiedtrans",
2071 FLG_UNKNOWNTRANS,
2072 "unqualified storage is transferred in an inconsistent way",
2073 "Unqualified storage is transferred in an inconsistent way.",
2074 0, 0
2075 },
2076 {
2077 FK_MEMORY, FK_NONE, modeFlag,
2078 "staticinittrans",
2079 FLG_STATICINITTRANS,
2080 "static storage is used as an initial value in an inconsistent way",
2081 "Static storage is used as an initial value in an inconsistent way.",
2082 0, 0
2083 },
2084 {
2085 FK_MEMORY, FK_NONE, modeFlag,
2086 "unqualifiedinittrans",
2087 FLG_UNKNOWNINITTRANS,
2088 "unqualified storage is used as an initial value in an inconsistent way",
2089 "Unqualified storage is used as an initial value in an inconsistent way.",
2090 0, 0
2091 },
2092 {
2093 FK_MEMORY, FK_NONE, modeFlag,
2094 "readonlystrings",
2095 FLG_READONLYSTRINGS,
2096 "string literals are read-only (error if one is modified or released)",
2097 "String literals are read-only (ANSI semantics). An error is reported "
2098 "if a string literal may be modified or released.",
2099 0, 0
2100 },
2101 {
2102 FK_MEMORY, FK_NONE, modeFlag,
2103 "readonlytrans",
2104 FLG_READONLYTRANS,
2105 "report memory transfer errors for initializations to read-only string literals",
2106 "A read-only string literal is assigned to a non-observer reference.",
2107 0, 0
2108 },
2109 {
2110 FK_MEMORY, FK_PARAMS, modeFlag,
2111 "passunknown",
2112 FLG_PASSUNKNOWN,
2113 "passing a value as an un-annotated parameter clears its annotation",
2114 NULL, 0, 0
2115 },
2116 {
2117 FK_MODIFIES, FK_SPEC, plainFlag,
2118 "mods",
2119 FLG_MODIFIES,
2120 "unspecified modification of caller-visible state",
2121 "An externally-visible object is modified by a function, but not "
2122 "listed in its modifies clause.",
2123 0, 0
2124 },
2125 {
2126 FK_MODIFIES, FK_SPEC, modeFlag,
2127 "mustmod",
2128 FLG_MUSTMOD,
2129 "specified modification is not detected",
2130 "An object listed in the modifies clause is not modified by the "
2131 "implementation of the function. The modification may not "
2132 "be detected if it is done through a call to an unspecified "
2133 "function.",
2134 0, 0
2135 },
2136 {
2137 FK_MODIFIES, FK_MEMORY, plainFlag,
2138 "modobserver",
2139 FLG_MODOBSERVER,
2140 "possible modification of observer storage",
2141 "Storage declared with observer is possibly modified. Observer "
2142 "storage may not be modified.",
2143 0, 0
2144 },
2145 {
2146 FK_MODIFIES, FK_MEMORY, modeFlag,
2147 "modobserveruncon",
2148 FLG_MODOBSERVERUNCON,
2149 "possible modification of observer storage through unconstrained call",
2150 "Storage declared with observer may be modified through a call to an "
2151 "unconstrained function.",
2152 0, 0
2153 },
2154 {
2155 FK_MODIFIES, FK_MEMORY, modeFlag,
2156 "modinternalstrict",
2157 FLG_MODINTERNALSTRICT,
2158 "possible modification of internal storage through function call",
2159 "A function that modifies internalState is called from a function that "
2160 "does not list internalState in its modifies clause",
2161 0, 0
2162 },
2163 {
2164 FK_MODIFIES, FK_UNSPEC, modeFlag,
2165 "modfilesys",
2166 FLG_MODFILESYSTEM,
2167 "report undocumented file system modifications (applies to unspecified "
2168 "functions if modnomods is set)",
2169 NULL, 0, 0
2170 },
2171 {
2172 FK_MODIFIES, FK_UNSPEC, specialFlag,
2173 "modunspec",
2174 FLG_MODUNSPEC,
2175 "modification in unspecified functions (sets modnomods, "
2176 "modglobunspec and modstrictglobsunspec)",
2177 NULL, 0, 0
2178 },
2179 {
2180 FK_MODIFIES, FK_UNSPEC, modeFlag,
2181 "modnomods",
2182 FLG_MODNOMODS,
2183 "modification in a function with no modifies clause",
2184 "An externally-visible object is modified by a function with no "
2185 "/*@modifies@*/ comment. The /*@modifies ... @*/ control "
2186 "comment can be used to give a modifies list for an "
2187 "unspecified function.",
2188 0, 0
2189 },
2190 {
2191 FK_MODIFIES, FK_UNSPEC, modeFlag,
2192 "moduncon",
2193 FLG_MODUNCON,
2194 "possible modification through a call to an unconstrained function",
2195 "An unconstrained function is called in a function body where "
2196 "modifications are checked. Since the unconstrained function "
2197 "may modify anything, there may be undetected modifications in "
2198 "the checked function.",
2199 0, 0
2200 },
2201 {
2202 FK_MODIFIES, FK_UNSPEC, modeFlag,
2203 "modunconnomods",
2204 FLG_MODUNCONNOMODS,
2205 "possible modification through a call to an unconstrained function in "
2206 "a function with no modifies clause",
2207 "An unconstrained function is called in a function body where "
2208 "modifications are checked. Since the unconstrained function "
2209 "may modify anything, there may be undetected modifications in "
2210 "the checked function.",
2211 0, 0
2212 },
2213 {
2214 FK_MODIFIES, FK_GLOBALS, modeFlag,
2215 "globsimpmodsnothing",
2216 FLG_GLOBALSIMPMODIFIESNOTHING,
2217 "functions declared with a globals list but no modifies clause are "
2218 "assumed to modify nothing",
2219 "An implicit modifies nothing clause is assumed for a function "
2220 "declared with a globals list but not modifies clause.",
2221 0, 0
2222 },
2223 {
2224 FK_MODIFIES, FK_GLOBALS, modeFlag,
2225 "modsimpnoglobs",
2226 FLG_MODIFIESIMPNOGLOBALS,
2227 "functions declared with a modifies clause but no globals list "
2228 "are assumed to use no globals",
2229 "An implicit empty globals list is assumed for a function "
2230 "declared with a modifies clause but no globals list.",
2231 0, 0
2232 },
2233 {
2234 FK_NAMES, FK_ABSTRACT, plainFlag,
2235 "namechecks",
2236 FLG_NAMECHECKS,
2237 "controls name checking without changing other settings",
2238 NULL, 0, 0
2239 },
2240 {
2241 FK_NAMES, FK_ABSTRACT, specialFlag,
2242 "czech",
2243 FLG_CZECH,
2244 "czech naming convention (sets accessczech, czechfunctions, czechvars, "
2245 "czechconstants, czechenums, and czechmacros)",
2246 "Name is not consistent with Czech naming convention.", 0, 0
2247 },
2248 {
2249 FK_NAMES, FK_ABSTRACT, plainFlag,
2250 "czechfcns",
2251 FLG_CZECHFUNCTIONS,
2252 "czech naming convention violated in a function or iterator declaration",
2253 "Function or iterator name is not consistent with Czech naming convention.", 0, 0
2254 },
2255 {
2256 FK_NAMES, FK_ABSTRACT, plainFlag,
2257 "czechvars",
2258 FLG_CZECHVARS,
2259 "czech naming convention violated in a variable declaration",
2260 "Variable name is not consistent with Czech naming convention.", 0, 0
2261 },
2262 {
2263 FK_NAMES, FK_ABSTRACT, plainFlag,
2264 "czechmacros",
2265 FLG_CZECHMACROS,
2266 "czech naming convention violated in an expanded macro name",
2267 "Expanded macro name is not consistent with Czech naming convention.", 0, 0
2268 },
2269 {
2270 FK_NAMES, FK_ABSTRACT, plainFlag,
2271 "czechconsts",
2272 FLG_CZECHCONSTANTS,
2273 "czech naming convention violated in a constant declaration",
2274 "Constant name is not consistent with Czech naming convention.", 0, 0
2275 },
2276 {
2277 FK_NAMES, FK_ABSTRACT, plainFlag,
2278 "czechtypes",
2279 FLG_CZECHTYPES,
2280 "czech naming convention violated in a user-defined type definition",
2281 "Type name is not consistent with Czech naming convention. Czech type "
2282 "names must not use the underscore character.", 0, 0
2283 },
2284 {
2285 FK_NAMES, FK_ABSTRACT, specialFlag,
2286 "slovak",
2287 FLG_SLOVAK,
2288 "slovak naming convention violated",
2289 "Name is not consistent with Slovak naming convention.", 0, 0
2290 },
2291 {
2292 FK_NAMES, FK_ABSTRACT, plainFlag,
2293 "slovakfcns",
2294 FLG_SLOVAKFUNCTIONS,
2295 "slovak naming convention violated in a function or iterator declaration",
2296 "Function or iterator name is not consistent with Slovak naming convention.", 0, 0
2297 },
2298 {
2299 FK_NAMES, FK_ABSTRACT, plainFlag,
2300 "slovakmacros",
2301 FLG_SLOVAKMACROS,
2302 "slovak naming convention violated in an expanded macro name",
2303 "Expanded macro name is not consistent with Slovak naming convention.", 0, 0
2304 },
2305 {
2306 FK_NAMES, FK_ABSTRACT, plainFlag,
2307 "slovakvars",
2308 FLG_SLOVAKVARS,
2309 "slovak naming convention violated in a variable declaration",
2310 "Variable name is not consistent with Slovak naming convention.", 0, 0
2311 },
2312 {
2313 FK_NAMES, FK_ABSTRACT, plainFlag,
2314 "slovakconsts",
2315 FLG_SLOVAKCONSTANTS,
2316 "slovak naming convention violated in a constant declaration",
2317 "Constant name is not consistent with Slovak naming convention.", 0, 0
2318 },
2319 {
2320 FK_NAMES, FK_ABSTRACT, plainFlag,
2321 "slovaktypes",
2322 FLG_SLOVAKTYPES,
2323 "slovak naming convention violated in a use-defined type definition",
2324 "Type name is not consistent with Slovak naming convention. Slovak type "
2325 "names may not include uppercase letters.", 0, 0
2326 },
2327 {
2328 FK_NAMES, FK_ABSTRACT, specialFlag,
2329 "czechoslovak",
2330 FLG_CZECHOSLOVAK,
2331 "czech or slovak naming convention violated",
2332 "Name is not consistent with either Czech or Slovak naming convention.", 0, 0
2333 },
2334 {
2335 FK_NAMES, FK_ABSTRACT, plainFlag,
2336 "czechoslovakfcns",
2337 FLG_CZECHOSLOVAKFUNCTIONS,
2338 "czechoslovak naming convention violated in a function or iterator declaration",
2339 "Function name is not consistent with Czechoslovak naming convention.", 0, 0
2340 },
2341 {
2342 FK_NAMES, FK_ABSTRACT, plainFlag,
2343 "czechoslovakmacros",
2344 FLG_CZECHOSLOVAKMACROS,
2345 "czechoslovak naming convention violated in an expanded macro name",
2346 "Expanded macro name is not consistent with Czechoslovak naming convention.", 0, 0
2347 },
2348 {
2349 FK_NAMES, FK_ABSTRACT, plainFlag,
2350 "czechoslovakvars",
2351 FLG_CZECHOSLOVAKVARS,
2352 "czechoslovak naming convention violated in a variable declaration",
2353 "Variable name is not consistent with Czechoslovak naming convention.", 0, 0
2354 },
2355 {
2356 FK_NAMES, FK_ABSTRACT, plainFlag,
2357 "czechoslovakconsts",
2358 FLG_CZECHOSLOVAKCONSTANTS,
2359 "czechoslovak naming convention violated in a constant declaration",
2360 "Constant name is not consistent with Czechoslovak naming convention.", 0, 0
2361 },
2362 {
2363 FK_NAMES, FK_ABSTRACT, plainFlag,
2364 "czechoslovaktypes",
2365 FLG_CZECHOSLOVAKTYPES,
2366 "czechoslovak naming convention violated in a user-defined type definition",
2367 "Type name is not consistent with Czechoslovak naming convention. Czechoslovak "
2368 "type names may not include uppercase letters or the underscore character.", 0, 0
2369 },
2370 {
2371 FK_NAMES, FK_ANSI, modeFlag,
2372 "ansireserved",
2373 FLG_ANSIRESERVED,
2374 "external name conflicts with name reserved for system or standard library",
2375 "External name is reserved for system in ANSI standard.",
2376 0, 0
2377 },
2378 {
2379 FK_NAMES, FK_ANSI, modeFlag,
2380 "cppnames",
2381 FLG_CPPNAMES,
2382 "external or internal name is a C++ keyword or reserved word",
2383 "External name is a C++ keyword or reserved word. "
2384 "This could lead to problems if the "
2385 "code is compiled with a C++ compiler.",
2386 0, 0
2387 },
2388 {
2389 FK_NAMES, FK_ANSI, modeFlag,
2390 "ansireservedinternal",
2391 FLG_ANSIRESERVEDLOCAL,
2392 "internal name conflicts with name reserved for system or standard library",
2393 "Internal name is reserved for system in ANSI standard (this should not be necessary unless you are worried about C library implementations that violate the standard and use macros).",
2394 0, 0
2395 },
2396 {
2397 FK_NAMES, FK_ANSI, plainFlag,
2398 "distinctexternalnames",
2399 FLG_DISTINCTEXTERNALNAMES,
2400 "external name is not distinguishable from another external name using "
2401 "the number of significant characters",
2402 "An external name is not distinguishable from another external name "
2403 "using the number of significant characters. According to "
2404 "ANSI Standard (3.1), an implementation may only consider the first 6 "
2405 "characters significant, and ignore alphabetical case "
2406 "distinctions. The "
2407 "+externalnamelen <n> flag may be used to change the number "
2408 "of significant characters, and -externalnamecaseinsensitive to make "
2409 "alphabetical case significant in external names.",
2410 0, 0
2411 },
2412 {
2413 FK_NAMES, FK_ANSI, specialValueFlag,
2414 "externalnamelen",
2415 FLG_EXTERNALNAMELEN,
2416 "set the number of significant characters in an external name",
2417 "Sets the number of significant characters in an external name (ANSI "
2418 "default is 6.) Sets +distinctexternalnames.",
2419 0, 0
2420 },
2421 {
2422 FK_NAMES, FK_ANSI, plainSpecialFlag,
2423 "externalnamecaseinsensitive",
2424 FLG_EXTERNALNAMECASEINSENSITIVE,
2425 "alphabetic comparisons for external names are case-insensitive",
2426 "Make alphabetic case insignificant in external names. By ANSI "
2427 "standard, case need not be significant in an external name. "
2428 "If +distinctexternalnames is not set, sets "
2429 "+distinctexternalnames with unlimited external name length.",
2430 0, 0
2431 },
2432 {
2433 FK_NAMES, FK_ANSI, plainFlag,
2434 "distinctinternalnames",
2435 FLG_DISTINCTINTERNALNAMES,
2436 "internal name is not distinguishable from another internal name using "
2437 "the number of significant characters",
2438 "An internal name is not distinguishable from another internal name "
2439 "using the number of significant characters. According to "
2440 "ANSI Standard (3.1), an implementation may only consider the first 31 "
2441 "characters significant. The "
2442 "+internalnamelen <n> flag changes the number "
2443 "of significant characters, -internalnamecaseinsensitive to makes "
2444 "alphabetical case significant, and "
2445 "+internalnamelookalike to make similar-looking characters "
2446 "non-distinct.",
2447 0, 0
2448 },
2449 {
2450 FK_NAMES, FK_ANSI, specialValueFlag,
2451 "internalnamelen",
2452 FLG_INTERNALNAMELEN,
2453 "set the number of significant characters in an internal name",
2454 "Sets the number of significant characters in an internal name (ANSI "
2455 "default is 31.) Sets +distinctinternalnames.",
2456 0, 0
2457 },
2458 {
2459 FK_NAMES, FK_ANSI, plainSpecialFlag,
2460 "internalnamecaseinsensitive",
2461 FLG_INTERNALNAMECASEINSENSITIVE,
2462 "set whether case is significant an internal names "
2463 "(-internalnamecaseinsensitive means case is significant)" ,
2464 "Set whether case is significant an internal names "
2465 "(-internalnamecaseinsensitive "
2466 "means case is significant). By ANSI default, case is not "
2467 "significant. If +distinctinternalnames is not set, sets "
2468 "+distinctinternalnames with unlimited internal name length.",
2469 0, 0
2470 },
2471 {
2472 FK_NAMES, FK_ANSI, plainSpecialFlag,
2473 "internalnamelookalike",
2474 FLG_INTERNALNAMELOOKALIKE,
2475 "lookalike characters match in internal names",
2476 "Set whether similar looking characters (e.g., \"1\" and \"l\") "
2477 "match in internal names.",
2478 0, 0
2479 },
2480 {
2481 FK_NAMES, FK_PREFIX, idemStringFlag,
2482 "macrovarprefix",
2483 FLG_MACROVARPREFIX,
2484 "set namespace prefix for variables declared in a macro body",
2485 "A variable declared in a macro body does not start with the macrovarprefix.",
2486 0, 0
2487 } ,
2488 {
2489 FK_NAMES, FK_PREFIX, plainFlag,
2490 "macrovarprefixexclude",
2491 FLG_MACROVARPREFIXEXCLUDE,
2492 "the macrovarprefix may not be used for non-macro variables",
2493 "A variable declared outside a macro body starts with the macrovarprefix.",
2494 0, 0
2495 } ,
2496 {
2497 FK_NAMES, FK_PREFIX, idemStringFlag,
2498 "tagprefix",
2499 FLG_TAGPREFIX,
2500 "set namespace prefix for struct, union and enum tags",
2501 "A tag identifier does not start with the tagprefix.",
2502 0, 0
2503 } ,
2504 {
2505 FK_NAMES, FK_PREFIX, plainFlag,
2506 "tagprefixexclude",
2507 FLG_TAGPREFIXEXCLUDE,
2508 "the tagprefix may not be used for non-tag identifiers",
2509 "An identifier that is not a tag starts with the tagprefix.",
2510 0, 0
2511 } ,
2512 {
2513 FK_NAMES, FK_PREFIX, idemStringFlag,
2514 "enumprefix",
2515 FLG_ENUMPREFIX,
2516 "set namespace prefix for enum members",
2517 "An enum member does not start with the enumprefix.",
2518 0, 0
2519 } ,
2520 {
2521 FK_NAMES, FK_PREFIX, plainFlag,
2522 "enumprefixexclude",
2523 FLG_ENUMPREFIXEXCLUDE,
2524 "the enumprefix may not be used for non-enum member identifiers",
2525 "An identifier that is not an enum member starts with the enumprefix.",
2526 0, 0
2527 } ,
2528 {
2529 FK_NAMES, FK_PREFIX, idemStringFlag,
2530 "filestaticprefix",
2531 FLG_FILESTATICPREFIX,
2532 "set namespace prefix for file static declarations",
2533 "A file-static identifier does not start with the filestaticprefix.",
2534 0, 0
2535 } ,
2536 {
2537 FK_NAMES, FK_PREFIX, plainFlag,
2538 "filestaticprefixexclude",
2539 FLG_FILESTATICPREFIXEXCLUDE,
2540 "the filestaticprefix may not be used for identifiers that are not file static",
2541 "An identifier that is not file static starts with the filestaticprefix.",
2542 0, 0
2543 } ,
2544 {
2545 FK_NAMES, FK_PREFIX, idemStringFlag,
2546 "globalprefix",
2547 FLG_GLOBPREFIX,
2548 "set namespace prefix for global variables",
2549 "A global variable does not start with the globalprefix",
2550 0, 0
2551 } ,
2552 {
2553 FK_NAMES, FK_PREFIX, plainFlag,
2554 "globalprefixexclude",
2555 FLG_GLOBPREFIXEXCLUDE,
2556 "the globalprefix may not be used for non-global identifiers",
2557 "An identifier that is not a global variable starts with the globalprefix.",
2558 0, 0
2559 } ,
2560 {
2561 FK_NAMES, FK_PREFIX, idemStringFlag,
2562 "typeprefix",
2563 FLG_TYPEPREFIX,
2564 "set namespace prefix for user-defined types",
2565 "A user-defined type does not start with the typeprefix",
2566 0, 0
2567 } ,
2568 {
2569 FK_NAMES, FK_PREFIX, plainFlag,
2570 "typeprefixexclude",
2571 FLG_TYPEPREFIXEXCLUDE,
2572 "the typeprefix may not be used for identifiers that are not type names",
2573 "An identifier that is not a type name starts with the typeprefix.",
2574 0, 0
2575 } ,
2576 {
2577 FK_NAMES, FK_PREFIX, idemStringFlag,
2578 "externalprefix",
2579 FLG_EXTERNALPREFIX,
2580 "set namespace prefix for external identifiers",
2581 "An external identifier does not start with the externalprefix",
2582 0, 0
2583 } ,
2584 {
2585 FK_NAMES, FK_PREFIX, plainFlag,
2586 "externalprefixexclude",
2587 FLG_EXTERNALPREFIXEXCLUDE,
2588 "the externalprefix may not be used for non-external identifiers",
2589 "An identifier that is not external starts with the externalprefix.",
2590 0, 0
2591 } ,
2592 {
2593 FK_NAMES, FK_PREFIX, idemStringFlag,
2594 "localprefix",
2595 FLG_LOCALPREFIX,
2596 "set namespace prefix for local variables",
2597 "A local variable does not start with the localprefix",
2598 0, 0
2599 } ,
2600 {
2601 FK_NAMES, FK_PREFIX, plainFlag,
2602 "localprefixexclude",
2603 FLG_LOCALPREFIXEXCLUDE,
2604 "the localprefix may not be used for non-local identifiers",
2605 "An identifier that is not a local variable starts with the localprefix.",
2606 0, 0
2607 } ,
2608 {
2609 FK_NAMES, FK_PREFIX, idemStringFlag,
2610 "uncheckedmacroprefix",
2611 FLG_UNCHECKEDMACROPREFIX,
2612 "set namespace prefix for unchecked macros",
2613 "An unchecked macro name does not start with the uncheckedmacroprefix",
2614 0, 0
2615 } ,
2616 {
2617 FK_NAMES, FK_PREFIX, plainFlag,
2618 "uncheckedmacroprefixexclude",
2619 FLG_UNCHECKEDMACROPREFIXEXCLUDE,
2620 "the uncheckmacroprefix may not be used for identifiers that are not "
2621 "unchecked macros",
2622 "An identifier that is not the name of an unchecked macro "
2623 "starts with the uncheckedmacroprefix.",
2624 0, 0
2625 } ,
2626 {
2627 FK_NAMES, FK_PREFIX, idemStringFlag,
2628 "constprefix",
2629 FLG_CONSTPREFIX,
2630 "set namespace prefix for constants",
2631 "A constant does not start with the constantprefix",
2632 0, 0
2633 } ,
2634 {
2635 FK_NAMES, FK_PREFIX, plainFlag,
2636 "constprefixexclude",
2637 FLG_CONSTPREFIXEXCLUDE,
2638 "the constprefix may not be used for non-constant identifiers",
2639 "An identifier that is not a constant starts with the constantprefix.",
2640 0, 0
2641 } ,
2642 {
2643 FK_NAMES, FK_PREFIX, idemStringFlag,
2644 "iterprefix",
2645 FLG_ITERPREFIX,
2646 "set namespace prefix for iterators",
2647 "An iter does not start with the iterator prefix",
2648 0, 0
2649 } ,
2650 {
2651 FK_NAMES, FK_PREFIX, plainFlag,
2652 "iterprefixexclude",
2653 FLG_ITERPREFIXEXCLUDE,
2654 "the iterprefix may not be used for non-iter identifiers",
2655 "An identifier that is not a iter starts with the iterprefix.",
2656 0, 0
2657 } ,
2658 {
2659 FK_NAMES, FK_PREFIX, idemStringFlag,
2660 "protoparamprefix",
2661 FLG_DECLPARAMPREFIX,
2662 "set namespace prefix for parameters in function prototype declarations",
2663 "A parameter name in a function prototype declaration does not start with the "
2664 "declaration parameter prefix",
2665 0, 0
2666 } ,
2667 {
2668 FK_NAMES, FK_PREFIX, modeFlag,
2669 "protoparamname",
2670 FLG_DECLPARAMNAME,
2671 "a parameter in a function prototype has a name",
2672 "A parameter in a function prototype has a name. This is dangerous, "
2673 "since a macro definition could be visible here.",
2674 0, 0
2675 } ,
2676 {
2677 FK_NAMES, FK_PREFIX, modeFlag,
2678 "protoparammatch",
2679 FLG_DECLPARAMMATCH,
2680 "the name of a parameter in a function prototype and corresponding "
2681 "declaration must match (after removing the protoparamprefix",
2682 "A parameter in a function definition does not have the same name as "
2683 "the corresponding in the declaration of the function after "
2684 "removing the protoparamprefix",
2685 0, 0
2686 } ,
2687 {
2688 FK_NAMES, FK_PREFIX, plainFlag,
2689 "protoparamprefixexclude",
2690 FLG_DECLPARAMPREFIXEXCLUDE,
2691 "the protoparamprefix may not be used for non-declaraction parameter identifiers",
2692 "An identifier that is not a parameter name in a function prototype "
2693 "starts with the protoparamprefix.",
2694 0, 0
2695 } ,
2696 {
2697 FK_LIMITS, FK_ANSI, modeValueFlag,
2698 "controlnestdepth",
2699 FLG_CONTROLNESTDEPTH,
2700 "set maximum nesting depth of compound statements, iteration control "
2701 "structures, and selection control structures (ANSI minimum is 15)",
2702 "Maximum number of control levels exceeded.",
2703 0, 0
2704 },
2705 {
2706 FK_LIMITS, FK_ANSI, modeValueFlag,
2707 "stringliterallen",
2708 FLG_STRINGLITERALLEN,
2709 "set maximum length of string literals (ANSI minimum is 509)",
2710 "Maximum length of string literal exceeded.",
2711 0, 0
2712 },
2713 {
2714 FK_LIMITS, FK_ANSI, modeValueFlag,
2715 "numstructfields",
2716 FLG_NUMSTRUCTFIELDS,
2717 "set maximum number of fields in a struct or union (ANSI minimum is 127)",
2718 "Maximum number of fields in a struct or union exceeded.",
2719 0, 0
2720 },
2721 {
2722 FK_LIMITS, FK_ANSI, modeValueFlag,
2723 "numenummembers",
2724 FLG_NUMENUMMEMBERS,
2725 "set maximum number of members of an enum (ANSI minimum is 127)",
2726 "Limit on maximum number of members of an enum is exceeded.",
2727 0, 0
2728 },
2729 {
2730 FK_LIMITS, FK_ANSI, modeValueFlag,
2731 "includenest",
2732 FLG_INCLUDENEST,
2733 "set maximum number of nested #include files",
2734 "Maximum number of nested #include files exceeded.",
2735 0, 0
2736 },
2737 {
2738 FK_LIMITS, FK_ANSI, specialFlag,
2739 "ansilimits",
2740 FLG_ANSILIMITS,
2741 "check for violations of standard limits (controlnestdepth, "
2742 "stringliterallen, includenest, numstructfields, numenummembers)",
2743 NULL,
2744 0, 0
2745 },
2746 {
2747 FK_NAMES, FK_NONE, plainFlag,
2748 "name",
2749 FLG_NAME,
2750 NULL,
2751 "Naming convention is violated.",
2752 0, 0
2753 },
2754 {
2755 FK_NONE, FK_NONE, plainFlag,
2756 "special",
2757 FLG_SPECIAL,
2758 NULL, NULL,
2759 0, 0
2760 },
2761 {
2762 FK_NULL, FK_MEMORY, specialFlag,
2763 "null",
2764 FLG_NULL,
2765 "misuses of null pointer",
2766 "A possibly null pointer is misused (sets nullderef, nullpass, "
2767 "nullref, nullassign, and nullstate).",
2768 0, 0
2769 },
2770 {
2771 FK_NT, FK_MEMORY, modeFlag,
2772 "nullterminated",
2773 FLG_NULLTERMINATED,
2774 "misuse of nullterminated allocation",
2775 "A possibly non-nullterminated string/memory is used/referenced as a nullterminated one, ",
2776 0, 0
2777 },
2778 {
2779 FK_NT, FK_MEMORY, modeFlag,
2780 "arrayread",
2781 FLG_ARRAYREAD,
2782 "possible out of bounds read",
2783 "An array or pointer access references memory beyond the array or buffer, ",
2784 0, 0
2785 },
2786 {
2787 FK_NT, FK_MEMORY, modeFlag,
2788 "arraywrite",
2789 FLG_ARRAYWRITE,
2790 "possible buffer overflow from an out of bounds write",
2791 "Memory is set past the end of an array or or after the allocated buffer, ",
2792 0, 0
2793 },
2794
2795 {
2796 FK_NT, FK_MEMORY, modeFlag,
2797 "fcnpost",
2798 FLG_FUNCTIONPOST,
2799 "Function has the post condition",
2800 "LCLint has determined that the following statement is true after the function, ",
2801 0, 0
2802 },
2803 {
2804 FK_NT, FK_MEMORY, modeFlag,
2805 "fcnconstraint",
2806 FLG_FUNCTIONCONSTRAINT,
2807 "unresolved constraint",
2808 "LCLint was unable to resolve a constraint at the top of the function. If code is correct consider using explict annotation assertions, ",
2809 0, 0
2810 },
2811 /*drl7x added 6/18/01 */
2812 {
2813 FK_NT, FK_MEMORY, modeFlag,
2814 "checkpost",
2815 FLG_CHECKPOST,
2816 "unable to verify ensures annotation",
2817 "LCLint was unable to determine that the function satisfies a post condition given in an ensures annotation, ",
2818 0, 0
885824d3 2819 },
2820
28bf4b0b 2821 {
2822 FK_NT, FK_MEMORY, modeFlag,
2823 "constraintlocation",
2824 FLG_CONSTRAINTLOCATION,
2825 "display full c expression for every constraint generated",
2826 ", ",
2827 0, 0
2828 },/*drl added flag 4/26/01*/
2829 {
2830 FK_NT, FK_MEMORY, modeFlag,
2831 "implictconstraint",
2832 FLG_IMPLICTCONSTRAINT,
2833 "Try to generate implicit constraints for functions",
2834 ", ",
2835 0, 0
2836 },
2837 /*drl7x added 4/29/01 */
2838 {
2839 FK_NT, FK_MEMORY, modeFlag,
2840 "orconstraint",
2841 FLG_ORCONSTRAINT,
2842 "Use limited OR expressions to resolve constraints",
2843 ", ",
2844 0, 0
2845 },
2846
2847 {
2848 FK_NT, FK_MEMORY, modeFlag,
2849 "nullterminated",
2850 FLG_NULLTERMINATEDWARNING,
2851 "misuse of nullterminated allocation",
2852 "WARNING:A user annotated non-nullterminated buffer is used/referenced as a nullterminated one, ",
2853 0, 0
2854 },
2855 {
2856 FK_NULL, FK_MEMORY, modeFlag,
2857 "nullderef",
2858 FLG_NULLDEREF,
2859 "possible dereferencce of null pointer",
2860 "A possibly null pointer is dereferenced. Value is "
2861 "either the result of a function which may return null "
2862 "(in which case, code should check it is not null), or a "
2863 "global, parameter or structure field declared with the "
2864 "null qualifier.",
2865 0, 0
2866 },
2867 {
2868 FK_TYPE, FK_NONE, modeFlag,
2869 "fcnderef",
2870 FLG_FCNDEREF,
2871 "dereferencce of a function type",
2872 "A function type is dereferenced. The ANSI standard allows this "
2873 "because of implicit conversion of function designators, however the "
2874 "dereference is unnecessary.",
2875 0, 0
2876 },
2877 {
2878 FK_NULL, FK_MEMORY, modeFlag,
2879 "nullpass",
2880 FLG_NULLPASS,
2881 "possibly null pointer passed as formal with no null annotation",
2882 "A possibly null pointer is passed as a parameter corresponding to "
2883 "a formal parameter with no /*@null@*/ annotation. If NULL "
2884 "may be used for this parameter, add a /*@null@*/ annotation "
2885 "to the function parameter declaration.",
2886 0, 0
2887 },
2888 {
2889 FK_NULL, FK_MEMORY, modeFlag,
2890 "nullret",
2891 FLG_NULLRET,
2892 "possibly null pointer returned as result with no null annotation",
2893 "Function returns a possibly null pointer, but is not declared "
2894 "using /*@null@*/ annotation of result. If function may "
2895 "return NULL, add /*@null@*/ annotation to the return "
2896 "value declaration.",
2897 0, 0
2898 },
2899 {
2900 FK_NULL, FK_MEMORY, modeFlag,
2901 "nullstate",
2902 FLG_NULLSTATE,
2903 "possibly null pointer reachable from a reference with no null annotation",
2904 "A possibly null pointer is reachable from a parameter or global "
2905 "variable that is not declared using a /*@null@*/ annotation.",
2906 0, 0
2907 },
2908 {
2909 FK_NULL, FK_MEMORY, modeFlag,
2910 "nullassign",
2911 FLG_NULLASSIGN,
2912 "inconsistent assignment or initialization involving null pointer",
2913 "A reference with no null annotation is assigned or initialized "
2914 "to NULL. Use /*@null@*/ to declare the reference as "
2915 "a possibly null pointer.",
2916 0, 0
2917 },
2918 {
2919 FK_OPS, FK_BOOL, modeFlag,
2920 "boolcompare",
2921 FLG_BOOLCOMPARE,
2922 "comparison between bools (dangerous because of multiple TRUE values)",
2923 "Two bool values are compared directly using a C primitive. This "
2924 "may produce unexpected results since all non-zero values are "
2925 "considered TRUE, so different TRUE values may not be equal. "
2926 "The file bool.h (included in lclint/lib) provides bool_equal "
2927 "for safe bool comparisons.", 0, 0
2928 },
2929 {
2930 FK_OPS, FK_NONE, modeFlag,
2931 "realcompare",
2932 FLG_REALCOMPARE,
2933 "dangerous comparison between reals (dangerous because of inexact "
2934 "floating point representations)",
2935 "Two real (float, double, or long double) values are compared "
2936 "directly using a C primitive. "
2937 "This may produce unexpected results since floating point "
2938 "representations are inexact. Instead, compare the difference to "
2939 "FLT_EPSILON or DBL_EPSILON.",
2940 0, 0,
2941 },
2942 {
2943 FK_OPS, FK_POINTER, modeFlag,
2944 "ptrarith",
2945 FLG_POINTERARITH,
2946 "arithmetic involving pointer and integer",
2947 "Pointer arithmetic using pointer and integer.", 0, 0
2948 },
2949 {
2950 FK_OPS, FK_POINTER, modeFlag,
2951 "nullptrarith",
2952 FLG_NULLPOINTERARITH,
2953 "arithmetic involving possibly null pointer and integer",
2954 "Pointer arithmetic using a possibly null pointer and integer.", 0, 0
2955 },
2956 {
2957 FK_OPS, FK_POINTER, modeFlag,
2958 "ptrcompare",
2959 FLG_PTRNUMCOMPARE,
2960 "comparison between pointer and number",
2961 "A pointer is compared to a number.", 0, 0
2962 },
2963 {
2964 FK_OPS, FK_TYPE, modeFlag,
2965 "strictops",
2966 FLG_STRICTOPS,
2967 "primitive operation does not type check strictly",
2968 "A primitive operation does not type check strictly.", 0, 0
2969 },
2970 {
2971 FK_OPS, FK_TYPE, modeFlag,
2972 "bitwisesigned",
2973 FLG_BITWISEOPS,
2974 "a bitwise logical operator does not have unsigned operands",
2975 "An operand to a bitwise operator is not an unsigned values. This "
2976 "may have unexpected results depending on the signed "
2977 "representations.", 0, 0
2978 },
2979 {
2980 FK_OPS, FK_TYPE, modeFlag,
2981 "shiftsigned",
2982 FLG_SHIFTSIGNED,
2983 "a shift operator does not have unsigned operands",
2984 "An operand to a shift operator is not unsigned values. This "
2985 "may have unexpected results depending on the signed "
2986 "representations.", 0, 0
2987 },
2988 {
2989 FK_OPS, FK_BOOL, modeFlag,
2990 "boolops",
2991 FLG_BOOLOPS,
2992 "primitive operation (!, && or ||) does not has a boolean argument",
2993 "The operand of a boolean operator is not a boolean. Use +ptrnegate "
2994 "to allow ! to be used on pointers.",
2995 0, 0
2996 },
2997 {
2998 FK_OPS, FK_POINTER, modeFlag,
2999 "ptrnegate",
3000 FLG_PTRNEGATE,
3001 "allow ! to be used on pointer operand",
3002 "The operand of ! operator is a pointer.", 0, 0
3003 },
3004 {
3005 FK_OPS, FK_TYPE, modeFlag,
3006 "sizeoftype",
3007 FLG_SIZEOFTYPE,
3008 "sizeof operator has a type argument",
3009 "Operand of sizeof operator is a type. (Safer to use expression, "
3010 "int *x = sizeof (*x); instead of sizeof (int).)",
3011 0, 0
3012 },
3013 {
3014 FK_OPS, FK_TYPE, plainFlag,
3015 "sizeofformalarray",
3016 FLG_SIZEOFFORMALARRAY,
3017 "sizeof operator has an array formal parameter argument",
3018 "Operand of a sizeof operator is a function parameter declared as "
3019 "an array. The value of sizeof will be the size of a pointer to the "
3020 "element type, not the number of elements in the array.",
3021 0, 0
3022 },
3023 {
3024 FK_DECL, FK_TYPE, plainFlag,
3025 "fixedformalarray",
3026 FLG_FIXEDFORMALARRAY,
3027 "formal parameter of type array is declared with size",
3028 "A formal parameter is declared as an array with size. The size of the array "
3029 "is ignored in this context, since the array formal parameter is treated "
3030 "as a pointer.",
3031 0, 0
3032 },
3033 {
3034 FK_DECL, FK_TYPE, plainFlag,
3035 "incompletetype",
3036 FLG_INCOMPLETETYPE,
3037 "formal parameter has an incomplete type",
3038 "A formal parameter is declared with an incomplete type.",
3039 0, 0
3040 },
3041 {
3042 FK_DECL, FK_TYPE, plainFlag,
3043 "formalarray",
3044 FLG_FORMALARRAY,
3045 "formal parameter is an array",
3046 "A formal parameter is declared as an array. This can be confusing, since "
3047 "a formal array parameter is treated as a pointer.",
3048 0, 0
3049 },
3050 {
3051 FK_PRED, FK_BOOL, plainFlag,
3052 "predassign",
3053 FLG_PREDASSIGN,
3054 "condition test (if, while or for) is an assignment",
3055 "The condition test is an assignment expression. Probably, you mean "
3056 "to use == instead of =. If an assignment is intended, add an "
3057 "extra parentheses nesting (e.g., if ((a = b)) ...) to suppress "
3058 "this message.",
3059 0, 0
3060 },
3061 {
3062 FK_PRED, FK_BOOL, specialFlag,
3063 "predbool",
3064 FLG_PREDBOOL,
3065 "type of condition test (if, while or for) not bool (sets predboolint, "
3066 "predboolptr and predboolothers)",
3067 "Test expression type is not boolean.", 0, 0
3068 },
3069 {
3070 FK_PRED, FK_BOOL, modeFlag,
3071 "predboolint",
3072 FLG_PREDBOOLINT,
3073 "type of condition test (if, while or for) is an integral type",
3074 "Test expression type is not boolean or int.", 0, 0
3075 },
3076 {
3077 FK_PRED, FK_BOOL, modeFlag,
3078 "predboolothers",
3079 FLG_PREDBOOLOTHERS,
3080 "type of condition test (if, while or for) not bool, int or pointer",
3081 "Test expression type is not boolean.", 0, 0
3082 },
3083 {
3084 FK_PRED, FK_BOOL, modeFlag,
3085 "predboolptr",
3086 FLG_PREDBOOLPTR,
3087 "type of condition test (if, while or for) is a pointer",
3088 "Test expression type is not boolean.", 0, 0
3089 },
3090 {
3091 FK_PREPROC, FK_NONE, globalExtraArgFlag,
3092 "D<initializer>",
3093 FLG_DEFINE,
3094 "passed to pre-processor",
3095 NULL, 0, 0
3096 },
3097 {
3098 FK_PREPROC, FK_NONE, globalExtraArgFlag,
3099 "U<initializer>",
3100 FLG_UNDEFINE,
3101 "passed to pre-processor",
3102 NULL, 0, 0
3103 },
3104 {
3105 FK_GLOBALS, FK_NONE, modeFlag,
3106 "globstate",
3107 FLG_GLOBSTATE,
3108 "returns with global in inconsistent state (null or undefined)",
3109 "A global variable does not satisfy its annotations when control is transferred.",
3110 0, 0
3111 },
3112 {
3113 FK_SUPPRESS, FK_COMMENTS, globalFlag,
3114 "supcounts",
3115 FLG_SUPCOUNTS,
3116 "The number of errors detected does not match number in /*@i<n>@*/.",
3117 NULL, 0, 0
3118 },
3119 {
3120 FK_SUPPRESS, FK_ERRORS, valueFlag,
3121 "limit",
3122 FLG_LIMIT,
3123 "limit <int> consecutive repeated errors",
3124 NULL, 0, 0
3125 },
3126 {
3127 FK_SYNTAX, FK_NONE, plainFlag,
3128 "syntax",
3129 FLG_SYNTAX,
3130 "syntax error in parsing",
3131 "Code cannot be parsed. For help on parse errors, see lclint -help parseerrors.",
3132 0, 0
3133 },
3134 {
3135 FK_SYNTAX, FK_NONE, plainFlag,
3136 "trytorecover",
3137 FLG_TRYTORECOVER,
3138 "try to recover from parse error",
3139 "Try to recover from parse error. It really means try --- this doesn't usually work.", 0, 0
3140 },
3141 {
3142 FK_SYNTAX, FK_PREPROC, plainFlag,
3143 "preproc",
3144 FLG_PREPROC,
3145 NULL, NULL,
3146 0, 0
3147 },
3148 {
3149 FK_TYPE, FK_NONE, plainFlag,
3150 "type",
3151 FLG_TYPE,
3152 "type mismatch",
3153 "Types are incompatible.",
3154 0, 0
3155 },
3156 {
3157 FK_TYPE, FK_NONE, plainFlag,
3158 "fullinitblock",
3159 FLG_FULLINITBLOCK,
3160 "initializer sets all fields",
3161 "Initializer does not set every field in the structure.",
3162 0, 0
3163 },
3164 {
3165 FK_TYPE, FK_NONE, modeFlag,
3166 "enummembers",
3167 FLG_ENUMMEMBERS,
3168 "enum members must be int values",
3169 "Type of initial values for enum members must be int.",
3170 0, 0
3171 },
885824d3 3172
28bf4b0b 3173 {
3174 FK_TYPE, FK_NONE, plainFlag,
3175 "maintype",
3176 FLG_MAINTYPE,
3177 "type of main does not match expected type",
3178 "The function main does not match the expected type.",
3179 0, 0
3180 },
3181 {
3182 FK_TYPE, FK_NONE, plainFlag,
3183 "formattype",
3184 FLG_FORMATTYPE,
3185 "type-mismatch in parameter corresponding to format code in a printf or scanf-like function",
3186 "Type of parameter is not consistent with corresponding code in format string.",
3187 0, 0
3188 },
3189 {
3190 FK_TYPE, FK_NONE, modeFlag,
3191 "formatconst",
3192 FLG_FORMATCONST,
3193 "format parameter is not a string constant (hence variable arguments cannot be typechecked)",
3194 "Format parameter is not known at compile-time. This can lead to security vulnerabilities because the arguments cannot be type checked.",
3195 0, 0
3196 },
3197 {
3198 FK_TYPE, FK_NONE, plainFlag,
3199 "formatcode",
3200 FLG_FORMATCODE,
3201 "invalid format code in format string for printf or scanf-like function",
3202 "Format code in a format string is not valid.",
3203 0, 0
3204 },
3205 {
3206 FK_TYPEEQ, FK_ABSTRACT, modeFlag,
3207 "forwarddecl",
3208 FLG_FORWARDDECL,
3209 "forward declarations of pointers to abstract representation match abstract type",
3210 NULL, 0, 0
3211 },
3212 {
3213 FK_TYPEEQ, FK_ABSTRACT, modeFlag,
3214 "voidabstract",
3215 FLG_ABSTVOIDP,
3216 "void * matches pointers to abstract types, casting ok (dangerous)",
3217 "A pointer to void is cast to a pointer to an abstract type (or vice versa).",
3218 0, 0
3219 },
3220 {
3221 FK_TYPEEQ, FK_POINTER, plainFlag,
3222 "castfcnptr",
3223 FLG_CASTFCNPTR,
3224 "a pointer to a function is cast to a pointer to void (or vice versa)",
3225 "A pointer to a function is cast to (or used as) a pointer to void (or vice versa).",
3226 0, 0
3227 },
3228 {
3229 FK_TYPEEQ, FK_ARRAY, modeFlag,
3230 "charindex",
3231 FLG_CHARINDEX,
3232 "char can be used to index arrays",
3233 "To allow char types to index arrays, use +charindex.", 0, 0
3234 },
3235 {
3236 FK_TYPEEQ, FK_ARRAY, modeFlag,
3237 "enumindex",
3238 FLG_ENUMINDEX,
3239 "enum can be used to index arrays",
3240 "To allow enum types to index arrays, use +enumindex.", 0, 0
3241 },
3242 {
3243 FK_TYPEEQ, FK_BOOL, modeFlag,
3244 "boolint",
3245 FLG_BOOLINT,
3246 "bool and int are equivalent",
3247 "To make bool and int types equivalent, use +boolint.",
3248 0, 0
3249 },
3250 {
3251 FK_TYPEEQ, FK_NONE, modeFlag,
3252 "charint",
3253 FLG_CHARINT,
3254 "char and int are equivalent",
3255 "To make char and int types equivalent, use +charint.",
3256 0, 0
3257 },
3258 {
3259 FK_TYPEEQ, FK_NONE, modeFlag,
3260 "enumint",
3261 FLG_ENUMINT,
3262 "enum and int are equivalent",
3263 "To make enum and int types equivalent, use +enumint.",
3264 0, 0
3265 },
3266 {
3267 FK_TYPEEQ, FK_NONE, modeFlag,
3268 "floatdouble",
3269 FLG_FLOATDOUBLE,
3270 "float and double are equivalent",
3271 "To make float and double types equivalent, use +floatdouble.",
3272 0, 0
3273 },
3274 {
3275 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3276 "ignorequals",
3277 FLG_IGNOREQUALS,
3278 "ignore type qualifiers (long, short, unsigned)",
3279 "To ignore type qualifiers in type comparisons use +ignorequals.",
3280 0, 0
3281 },
3282 {
3283 FK_TYPEEQ, FK_SYNTAX, plainFlag,
3284 "duplicatequals",
3285 FLG_DUPLICATEQUALS,
3286 "report duplicate type qualifiers (e.g., long long)",
3287 "Duplicate type qualifiers not supported by ANSI. Some "
3288 "compilers (e.g., gcc) do support duplicate qualifiers.",
3289 0, 0
3290 },
3291 {
3292 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3293 "ignoresigns",
3294 FLG_IGNORESIGNS,
3295 "ignore signs in type comparisons (unsigned matches signed)",
3296 "To ignore signs in type comparisons use +ignoresigns",
3297 0, 0
3298 },
3299 {
3300 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3301 "numliteral",
3302 FLG_NUMLITERAL,
3303 "int literals can be reals",
3304 "An int literal is used as any numeric type (including float and long long). Use +numliteral to "
3305 "allow int literals to be used as any numeric type.",
3306 0, 0
3307 },
3308 {
3309 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3310 "charintliteral",
3311 FLG_CHARINTLITERAL,
3312 "character constants (e.g., 'a') can be used as ints",
3313 "A character constant is used as an int. Use +charintliteral to "
3314 "allow character constants to be used as ints. (This is safe "
3315 "since the actual type of a char constant is int.)",
3316 0, 0
3317 },
3318 {
3319 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3320 "relaxquals",
3321 FLG_RELAXQUALS,
3322 "report qualifier mismatches only if dangerous",
3323 NULL, 0, 0
3324 },
3325 {
3326 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3327 "relaxtypes",
3328 FLG_RELAXTYPES,
3329 "allow all numeric types to match",
3330 NULL, 0, 0
3331 },
3332 {
3333 FK_TYPEEQ, FK_NONE, modeFlag,
3334 "charunsignedchar",
3335 FLG_CHARUNSIGNEDCHAR,
3336 "allow char and unsigned char types to match",
3337 "To allow char and unsigned char types to match use +charunsignedchar.",
3338 0, 0
3339 },
3340 {
3341 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3342 "matchanyintegral",
3343 FLG_MATCHANYINTEGRAL,
3344 "allow any intergral type to match an arbitrary integral type (e.g., dev_t)",
3345 "To allow arbitrary integral types to match any integral type, use +matchanyintegral.",
3346 0, 0
3347 },
3348 {
3349 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3350 "longunsignedintegral",
3351 FLG_LONGUNSIGNEDINTEGRAL,
3352 "allow long unsigned type to match an arbitrary integral type (e.g., dev_t)",
3353 "To allow arbitrary integral types to match long unsigned, use +longunsignedintegral.",
3354 0, 0
3355 },
3356 {
3357 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3358 "longintegral",
3359 FLG_LONGINTEGRAL,
3360 "allow long type to match an arbitrary integral type (e.g., dev_t)",
3361 "To allow arbitrary integral types to match long unsigned, use +longintegral.",
3362 0, 0
3363 },
3364 {
3365 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3366 "longunsignedunsignedintegral",
3367 FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL,
3368 "allow long unsigned type to match an arbitrary unsigned integral type (e.g., size_t)",
3369 "To allow arbitrary unsigned integral types to match long unsigned, "
3370 "use +longunsignedunsignedintegral.",
3371 0, 0
3372 },
3373 {
3374 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3375 "longsignedintegral",
3376 FLG_LONGSIGNEDINTEGRAL,
3377 "allow long type to match an arbitrary signed integral type (e.g., ssize_t)",
3378 "To allow arbitrary signed integral types to match long unsigned, use +longsignedintegral.",
3379 0, 0
3380 },
3381 {
3382 FK_TYPEEQ, FK_POINTER, plainFlag,
3383 "zeroptr",
3384 FLG_ZEROPTR,
3385 "0 is treated as a pointer",
3386 NULL, 0, 0
3387 },
3388 {
3389 FK_TYPEEQ, FK_BOOL, modeFlag,
3390 "zerobool",
3391 FLG_ZEROBOOL,
3392 "0 is treated as a boolean",
3393 NULL, 0, 0
3394 },
3395 {
3396 FK_UNRECOG, FK_DISPLAY, plainFlag,
3397 "repeatunrecog",
3398 FLG_REPEATUNRECOG,
3399 "do not suppress repeated unrecognized identifier messages (instead of only reporting the first error)",
3400 "Identifier used in code has not been declared. (Message repeated for future uses in this file.)",
3401 0, 0
3402 },
3403 {
3404 FK_UNRECOG, FK_DISPLAY, plainFlag,
3405 "sysunrecog",
3406 FLG_SYSTEMUNRECOG,
3407 "report unrecognized identifiers with system (__) prefix",
3408 "Identifier used in code has not been declared. (Message repeated for "
3409 "future uses in this file.) Use +gnuextensions to make lclint "
3410 "recognize some keywords that are gnu extensions.",
3411 0, 0
3412 },
3413 {
3414 FK_UNRECOG, FK_NONE, plainFlag,
3415 "unrecog",
3416 FLG_UNRECOG,
3417 "unrecognized identifier",
3418 "Identifier used in code has not been declared.", 0, 0
3419 },
3420 {
3421 FK_USE, FK_COMPLETE, modeFlag,
3422 "topuse",
3423 FLG_TOPUNUSED,
3424 "declaration at top level not used",
3425 "An external declaration not used in any source file.", 0, 0
3426 },
3427 {
3428 FK_USE, FK_EXPORT, modeFlag,
3429 "exportlocal",
3430 FLG_EXPORTLOCAL,
3431 "a declaration is exported but not used outside this module",
3432 "A declaration is exported, but not used outside this module. "
3433 "Declaration can use static qualifier.",
3434 0, 0
3435 },
3436 {
3437 FK_USE, FK_EXPORT, modeFlag,
3438 "exportheader",
3439 FLG_EXPORTHEADER,
3440 "a declaration is exported but does not appear in a header file",
3441 "A declaration is exported, but does not appear in a header file.",
3442 0, 0
3443 },
3444 {
3445 FK_USE, FK_EXPORT, modeFlag,
3446 "exportheadervar",
3447 FLG_EXPORTHEADERVAR,
3448 "a variable declaration is exported but does not appear in a header file",
3449 "A variable declaration is exported, but does not appear in a header "
3450 "file. (Used with exportheader.)",
3451 0, 0
3452 },
3453 {
3454 FK_USE, FK_NONE, modeFlag,
3455 "fielduse",
3456 FLG_FIELDUNUSED,
3457 "field of structure type not used",
3458 "A field is present in a structure type but never used. Use /*@unused@*/ in front of field declaration to suppress message.",
3459 0, 0
3460 },
3461 {
3462 FK_USE, FK_NONE, modeFlag,
3463 "enummemuse",
3464 FLG_ENUMMEMUNUSED,
3465 "member of an enum type not used",
3466 "A member of an enum type is never used.",
3467 0, 0
3468 },
3469 {
3470 FK_USE, FK_NONE, modeFlag,
3471 "constuse",
3472 FLG_CONSTUNUSED,
3473 "constant declared but not used",
3474 "A constant is declared but not used. Use unused in the constant declaration to suppress message.",
3475 0, 0
3476 },
3477 {
3478 FK_USE, FK_NONE, modeFlag,
3479 "fcnuse",
3480 FLG_FUNCUNUSED,
3481 "function declared but not used",
3482 "A function is declared but not used. Use /*@unused@*/ in front of function header to suppress message.",
3483 0, 0
3484 },
3485 {
3486 FK_USE, FK_PARAMS, modeFlag,
3487 "paramuse",
3488 FLG_PARAMUNUSED,
3489 "function parameter not used ",
3490 "A function parameter is not used in the body of the function. If the argument is needed for type compatibility or future plans, use /*@unused@*/ in the argument declaration.",
3491 0, 0
3492 },
3493 {
3494 FK_USE, FK_TYPE, modeFlag,
3495 "typeuse",
3496 FLG_TYPEUNUSED,
3497 "type declared but not used",
3498 "A type is declared but not used. Use /*@unused@*/ in front of typedef to suppress messages.",
3499 0, 0
3500 },
3501 {
3502 FK_USE, FK_NONE, modeFlag,
3503 "varuse",
3504 FLG_VARUNUSED,
3505 "variable declared but not used",
3506 "A variable is declared but never used. Use /*@unused@*/ in front "
3507 "of declaration to suppress message.",
3508 0, 0
3509 },
3510 {
3511 FK_USE, FK_COMPLETE, modeFlag,
3512 "unusedspecial",
3513 FLG_UNUSEDSPECIAL,
3514 "unused declaration in special file (corresponding to .l or .y file)",
3515 NULL, 0, 0
3516 } ,
3517 {
3518 FK_DECL, FK_TYPE, modeFlag,
3519 "redundantsharequal",
3520 FLG_REDUNDANTSHAREQUAL,
3521 "declaration uses observer qualifier that is always true",
3522 "A declaration of an immutable object uses a redundant observer qualifier.",
3523 0, 0
3524 } ,
3525 {
3526 FK_DECL, FK_TYPE, modeFlag,
3527 "misplacedsharequal",
3528 FLG_MISPLACEDSHAREQUAL,
3529 "declaration of unsharable storage uses sharing annotation",
3530 "A declaration of an unsharable object uses a sharing annotation.",
3531 0, 0
3532 } ,
3533 {
3534 FK_DECL, FK_TYPE, plainFlag,
3535 "annotationerror",
3536 FLG_ANNOTATIONERROR,
3537 "annotation is used in inconsistent location",
3538 "A declaration uses an invalid annotation.",
3539 0, 0
3540 } ,
3541 {
3542 FK_DECL, FK_TYPE, plainFlag,
3543 "commenterror",
3544 FLG_COMMENTERROR,
3545 "inconsistent syntactic comment",
3546 "A syntactic comment is used inconsistently.",
3547 0, 0
3548 } ,
3549 {
3550 FK_DEBUG, FK_NONE, debugFlag,
3551 "showsourceloc",
3552 FLG_SHOWSOURCELOC,
3553 NULL, NULL,
3554 0, 0
3555 },
3556 {
3557 FK_DEBUG, FK_NONE, valueFlag,
3558 "bugslimit",
3559 FLG_BUGSLIMIT,
3560 "set maximum number of bugs detected before giving up",
3561 NULL, 0, 0
3562 },
885824d3 3563
28bf4b0b 3564 {
3565 FK_HELP, FK_NONE, plainFlag,
3566 "fileextensions",
3567 FLG_FILEEXTENSIONS,
3568 "warn when command line file does not have a recognized extension",
3569 NULL, 0, 0
3570 },
3571 {
3572 FK_DECL, FK_NONE, plainFlag,
3573 "warnuse",
3574 FLG_WARNUSE,
3575 "warn when declaration marked with warn is used",
3576 "Declaration marked with warn clause is used (can be suppresed by more specific flags).",
3577 0, 0
3578 },
3579 {
3580 FK_MEMORY, FK_DEF, modeFlag,
3581 "statetransfer",
3582 FLG_STATETRANSFER,
3583 "storage has been transfered with invalid state",
3584 "Transfer violates user-defined state rules.",
3585 0, 0
3586 },
3587 {
3588 FK_MEMORY, FK_DEF, modeFlag,
3589 "statemerge",
3590 FLG_STATEMERGE,
3591 "control paths merge with storage in incompatible states",
3592 "Control path merge violates user-defined state merge rules.",
3593 0, 0
3594 },
885824d3 3595
28bf4b0b 3596 /*
3597 ** The its4 level flags must appear in order.
3598 */
885824d3 3599
28bf4b0b 3600 {
3601 FK_WARNUSE, FK_SECURITY, specialFlag,
3602 "its4mostrisky",
3603 FLG_ITS4MOSTRISKY,
3604 "most risky security vulnerabilities (from its4 database)",
3605 "Security vulnerability classified as most risky in its4 database.",
3606 0, 0
3607 },
3608 {
3609 FK_WARNUSE, FK_SECURITY, specialFlag,
3610 "its4veryrisky",
3611 FLG_ITS4VERYRISKY,
3612 "very risky security vulnerabilities (from its4 database)",
3613 "Security vulnerability classified as very risky in its4 database.",
3614 0, 0
3615 },
3616 {
3617 FK_WARNUSE, FK_SECURITY, specialFlag,
3618 "its4risky",
3619 FLG_ITS4RISKY,
3620 "risky security vulnerabilities (from its4 database)",
3621 "Security vulnerability classified as risky in its4 database.",
3622 0, 0
3623 },
3624 {
3625 FK_WARNUSE, FK_SECURITY, specialFlag,
3626 "its4moderate",
3627 FLG_ITS4MODERATERISK,
3628 "moderately risky security vulnerabilities (from its4 database)",
3629 "Security vulnerability classified as moderate risk in its4 database.",
3630 0, 0
3631 },
3632 {
3633 FK_WARNUSE, FK_SECURITY, specialFlag,
3634 "its4low",
3635 FLG_ITS4LOWRISK,
3636 "risky security vulnerabilities (from its4 database)",
3637 "Security vulnerability classified as risky in its4 database.",
3638 0, 0
3639 },
885824d3 3640
28bf4b0b 3641 /*
3642 ** End of its4 level flags
3643 */
885824d3 3644
28bf4b0b 3645 {
3646 FK_WARNUSE, FK_SECURITY, modeFlag,
3647 "bufferoverflowhigh",
3648 FLG_BUFFEROVERFLOWHIGH,
3649 "likely buffer overflow vulnerability",
3650 "Use of function that may lead to buffer overflow.",
3651 0, 0
3652 },
3653 {
3654 FK_WARNUSE, FK_SECURITY, modeFlag,
3655 "bufferoverflow",
3656 FLG_BUFFEROVERFLOW,
3657 "possible buffer overflow vulnerability",
3658 "Use of function that may lead to buffer overflow.",
3659 0, 0
3660 },
3661 {
3662 FK_WARNUSE, FK_SECURITY, modeFlag,
3663 "toctou",
3664 FLG_TOCTOU,
3665 "possible time of check, time of use vulnerability",
3666 "Possible time of check, time of use vulnerability.",
3667 0, 0
3668 },
885824d3 3669
28bf4b0b 3670} ;
This page took 7.175328 seconds and 5 git commands to generate.