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