5 ** This file is used to generate the flag header files.
7 ** Don't forget to regenerate flag_codes.gen. (lost the Makefile...bleech!)
9 /* spec idem global mode args */
12 # define modeFlag FALSE, FALSE, FALSE, TRUE, ARG_NONE
14 # define plainFlag FALSE, FALSE, FALSE, FALSE, ARG_NONE
16 # define specialFlag TRUE, FALSE, FALSE, FALSE, ARG_NONE
18 # define plainSpecialFlag TRUE, FALSE, FALSE, FALSE, ARG_NONE
20 # define idemSpecialFlag TRUE, TRUE, FALSE, FALSE, ARG_NONE
22 # define valueFlag FALSE, FALSE, FALSE, FALSE, ARG_VALUE
24 # define modeValueFlag FALSE, FALSE, FALSE, TRUE, ARG_VALUE
26 # define specialValueFlag TRUE, FALSE, FALSE, FALSE, ARG_VALUE
28 # define debugFlag FALSE, TRUE, FALSE, FALSE, ARG_NONE
30 # define debugValueFlag FALSE, TRUE, FALSE, FALSE, ARG_VALUE
32 # define specialDebugFlag TRUE, TRUE, FALSE, FALSE, ARG_NONE
34 # define globalFlag FALSE, FALSE, TRUE, FALSE, ARG_NONE
36 # define idemGlobalFlag FALSE, TRUE, TRUE, FALSE, ARG_NONE
38 # define globalValueFlag FALSE, FALSE, TRUE, FALSE, ARG_VALUE
40 # define regStringFlag FALSE, FALSE, FALSE, FALSE, ARG_STRING
42 # define idemStringFlag FALSE, TRUE, FALSE, FALSE, ARG_STRING
44 # define globalStringFlag FALSE, FALSE, TRUE, FALSE, ARG_STRING
46 # define extraArgFlag FALSE, FALSE, FALSE, FALSE, ARG_SPECIAL
48 # define globalExtraArgFlag FALSE, FALSE, TRUE, FALSE, ARG_SPECIAL
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
57 static flaglist flags =
60 FK_BOOL, FK_HELP, plainFlag,
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.",
70 FK_ABSTRACT, FK_IMPLICIT, plainFlag,
73 "assume user type definitions are abstract (unless /*@concrete@*/ is used)",
78 FK_ABSTRACT, FK_NAMES, specialFlag,
81 "set accessmodule, accessfile and accessczech",
82 "Sets accessmodule, accessfile and accessczech",
86 FK_ABSTRACT, FK_NAMES, plainFlag,
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>.",
95 FK_ABSTRACT, FK_NAMES, plainFlag,
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>.",
104 FK_ABSTRACT, FK_NAMES, plainFlag,
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>",
113 FK_ABSTRACT, FK_NAMES, plainFlag,
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>",
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>",
131 FK_ABSTRACT, FK_NONE, plainFlag,
134 "data abstraction barriers",
135 "An abstraction barrier is broken. If necessary, use /*@access <type>@*/ to allow access to an abstract type.",
139 FK_ABSTRACT, FK_NONE, modeFlag,
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.",
147 FK_ALIAS, FK_GLOBALS, specialFlag,
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.",
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.",
165 FK_ALIAS, FK_GLOBALS, modeFlag,
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.",
173 FK_ALIAS, FK_GLOBALS, modeFlag,
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.",
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.",
189 FK_ALIAS, FK_MEMORY, modeFlag,
192 "unique parameter is aliased",
193 "A unique or only parameter is aliased by some other parameter or visible global.",
197 FK_ALIAS, FK_MEMORY, modeFlag,
200 "unique parameter may be aliased",
201 "A unique or only parameter may be aliased by some other parameter or visible global.",
205 FK_ALIAS, FK_MEMORY, modeFlag,
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.",
213 FK_ALIAS, FK_NONE, modeFlag,
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
220 FK_ANSI, FK_PROTOS, modeFlag,
223 "function declaration has no parameter list",
224 "A function declaration does not have a parameter list.",
228 FK_ANSI, FK_PROTOS, modeFlag,
231 "old style function definition",
232 "Function definition is in old style syntax. Standard prototype "
233 "syntax is preferred.",
237 FK_ANSI, FK_SYNTAX, plainFlag,
240 "support some gnu (gcc) language extensions",
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
245 FK_ANSI, FK_NONE, plainFlag,
248 "non-standard <varargs.h> included",
249 "Header <varargs.h> is not part of ANSI Standard. "
250 "Should use <stdarg.h> instead.",
254 FK_ANSI, FK_LIBS, plainFlag,
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.",
262 FK_BEHAVIOR, FK_ANSI, modeFlag,
265 "argument to exit has implementation defined behavior",
266 "The argument to exit should be 0, EXIT_SUCCESS or EXIT_FAILURE",
270 FK_BEHAVIOR, FK_ANSI, modeFlag,
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 "
284 FK_BEHAVIOR, FK_ANSI, modeFlag,
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.",
295 FK_BOOL, FK_NONE, regStringFlag,
298 "set name of boolean false (default FALSE)",
302 FK_BOOL, FK_NONE, regStringFlag,
305 "set name of boolean type (default bool)",
309 FK_BOOL, FK_NONE, regStringFlag,
312 "set name of boolean true (default TRUE)",
316 FK_COMMENTS, FK_ABSTRACT, plainFlag,
319 "ignore access comments",
323 FK_COMMENTS, FK_SUPPRESS, plainFlag,
326 "ignore all stylized comments",
330 FK_COMMENTS, FK_SYNTAX, plainFlag,
333 "stylized comment is unrecognized",
334 "Word after a stylized comment marker does not correspond to a "
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.",
347 FK_COMMENTS, FK_SYNTAX, plainFlag,
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.",
357 FK_COMMENTS, FK_SYNTAX, plainFlag,
360 "comment begins inside comment",
361 "A comment open sequence (/*) appears within a comment. This usually "
362 "means an earlier comment was not closed.",
366 FK_COMMENTS, FK_SUPPRESS, modeFlag,
369 "interpret t comments (ignore errors in lines marked with /*@t<n>@*/",
373 FK_COMMENTS, FK_SUPPRESS, plainFlag,
376 "interpret traditional lint comments (/*FALLTHROUGH*/, /*NOTREACHED*/)",
380 FK_COMMENTS, FK_SUPPRESS, modeFlag,
382 FLG_WARNLINTCOMMENTS,
383 "print a warning and suggest an alternative when a traditional lint "
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.",
392 FK_COMPLETE, FK_NONE, modeFlag,
395 "function or variable declared but never defined",
396 "A function or variable is declared, but not defined in any source code file.",
400 FK_COMPLETE, FK_SPEC, modeFlag,
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.",
408 FK_COMPLETE, FK_SPEC, plainFlag,
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.",
417 FK_CONTROL, FK_MEMORY, modeFlag,
420 "assume all loops execute at least once",
424 FK_CONTROL, FK_NONE, plainFlag,
431 FK_CONTROL, FK_NONE, modeFlag,
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.",
442 FK_CONTROL, FK_NONE, modeFlag,
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 "
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.",
454 FK_CONTROL, FK_NONE, specialFlag,
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.",
464 FK_CONTROL, FK_NONE, modeFlag,
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.",
476 FK_CONTROL, FK_NONE, modeFlag,
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.",
488 FK_CONTROL, FK_NONE, modeFlag,
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.",
500 FK_CONTROL, FK_NONE, modeFlag,
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.",
512 FK_CONTROL, FK_NONE, modeFlag,
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.",
524 FK_CONTROL, FK_NONE, modeFlag,
527 "unreachable code detected",
528 "This code will never be reached on any possible execution.",
532 FK_CONTROL, FK_NONE, modeFlag,
535 "a while statement has no body",
536 "While statement has no body.",
540 FK_CONTROL, FK_NONE, modeFlag,
543 "the body of a while statement is not a block",
544 "While body is a single statement, not a compound block.",
548 FK_CONTROL, FK_NONE, modeFlag,
551 "a for statement has no body",
552 "For statement has no body.",
556 FK_CONTROL, FK_NONE, modeFlag,
559 "the body of a for statement is not a block",
560 "Loop body is a single statement, not a compound block.",
564 FK_CONTROL, FK_NONE, modeFlag,
567 "an if statement has no body",
568 "If statement has no body.",
572 FK_CONTROL, FK_NONE, modeFlag,
575 "the body of an if statement is not a block",
576 "If body is a single statement, not a compound block.",
580 FK_CONTROL, FK_NONE, specialFlag,
583 "an if, while or for statement has no body (sets ifempty, "
584 "whileempty and forempty",
589 FK_CONTROL, FK_NONE, specialFlag,
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.",
598 FK_CONTROL, FK_NONE, modeFlag,
601 "if ... else if chains must have final else",
602 "There is no final else following an else if construct.",
606 FK_CONTROL, FK_NONE, modeFlag,
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 "
617 FK_CONTROL, FK_NONE, modeFlag,
620 "non-empty case in a switch without preceding break",
621 "Execution falls through from the previous case.", 0, 0
624 FK_CONTROL, FK_NONE, modeFlag,
627 "switch on enum type missing case for some value",
628 "Not all values in an enumeration are present as cases in the switch.",
632 FK_CONTROL, FK_NONE, modeFlag,
635 "first statement in switch is not a case",
636 "The first statement after a switch is not a case.",
640 FK_DEBUG, FK_NONE, specialDebugFlag,
647 FK_DEBUG, FK_NONE, debugFlag,
654 FK_DECL, FK_NONE, modeFlag,
657 "declaration reuses name visible in outer scope",
658 "An outer declaration is shadowed by the local declaration.",
662 FK_DECL, FK_LIBS, modeFlag,
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.",
671 FK_DECL, FK_LIBS, modeFlag,
674 "library function overloaded",
675 "A function, variable or constant defined in the library is redefined "
676 "with a different type.",
680 FK_DECL, FK_NONE, modeFlag,
683 "an extern declaration is inside a function scope",
684 "An extern declaration is used inside a function scope.",
688 FK_DECL, FK_NONE, modeFlag,
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.",
697 FK_DECL, FK_NONE, plainFlag,
700 "function or variable redefined",
701 "A function or variable is redefined. One of the declarations should use extern.",
705 FK_DECL, FK_TYPE, modeFlag,
708 "function, variable or constant redefined with inconsistent type",
709 "A function, variable or constant is redefined with a different type.",
713 FK_DECL, FK_TYPE, modeFlag,
716 "variable declaration has unknown (implicitly int) type",
717 "A variable declaration has no explicit type. The type is implicitly int.",
721 FK_DECL, FK_TYPE, modeFlag,
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.",
729 FK_DEF, FK_NONE, modeFlag,
732 "use before definition",
733 "An rvalue is used that may not be initialized to a value on some execution path.",
737 FK_DEF, FK_IMPLICIT, modeFlag,
740 "pointer parameters to unspecified functions may be implicit out parameters",
744 FK_DIRECT, FK_FILES, globalStringFlag,
747 "set directory for writing temp files",
751 FK_DIRECT, FK_FILES, globalStringFlag,
754 "set path for searching for library files (overrides LARCH_PATH environment variable)",
758 FK_DIRECT, FK_FILES, globalStringFlag,
761 "set directory to search for LCL import files (overrides LCLIMPORTDIR)",
765 FK_DIRECT, FK_FILES, globalStringFlag,
768 "set directories for system files (default /usr/include). Separate "
769 "directories with path separator (colons in Unix, semi-colons in Windows). "
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.",
776 FK_DIRECT, FK_FILES, plainFlag,
779 "prevent inclusion of header files in a system directory with "
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, "
784 "setjmp, signal, stdarg, stddef, stdio, stdlib, strings, string, "
789 FK_DIRECT, FK_FILES, plainFlag,
791 FLG_SKIPPOSIXHEADERS,
792 "prevent inclusion of header files in a system directory with "
793 "names that match standard POSIX headers. The symbolic information "
794 "in the posix library is used instead. The POSIX headers are: "
795 "dirent, fcntl, grp, pwd, termios, sys/stat, sys/times, "
796 "sys/types, sys/utsname, sys/wait, unistd, and utime.",
800 FK_DIRECT, FK_SUPPRESS, modeFlag,
803 "report errors in files in system directories (set by -sysdirs)",
807 FK_HEADERS, FK_MACROS, plainFlag,
808 "sysdirexpandmacros",
810 "expand macros in system directories regardless of other settings, "
811 "except for macros corresponding to names defined in a load library",
816 FK_DIRECT, FK_HEADERS, globalExtraArgFlag,
819 "add to C include path",
823 FK_DIRECT, FK_SPEC, globalExtraArgFlag,
830 FK_DISPLAY, FK_ERRORS, plainFlag,
833 "suppress herald and error count",
837 FK_DISPLAY, FK_ERRORS, plainFlag,
840 "send error messages to standard error (instead of standard out)",
844 FK_DISPLAY, FK_ERRORS, plainFlag,
847 "show summary of all errors reported and suppressed",
851 FK_DISPLAY, FK_FILES, plainFlag,
854 "show file names are they are processed",
858 FK_DISPLAY, FK_NONE, globalFlag,
861 "display lines processed and time",
865 FK_DISPLAY, FK_NONE, globalFlag,
868 "display time distribution",
872 FK_DISPLAY, FK_USE, globalFlag,
875 "show sorted list of uses of all globals",
879 FK_EFFECT, FK_CONTROL, modeFlag,
882 "statement with no effect",
883 "Statement has no visible effect --- no values are modified.",
887 FK_EFFECT, FK_CONTROL, modeFlag,
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.",
897 FK_EXPORT, FK_SPEC, specialFlag,
900 "variable, function or type exported but not specified",
901 "A variable, function or type is exported, but not specified.",
905 FK_EXPORT, FK_SPEC, modeFlag,
908 "function exported but not specified",
909 "A function is exported, but not specified.", 0, 0
912 FK_EXPORT, FK_SPEC, modeFlag,
915 "expanded macro exported but not specified",
916 "A macro is exported, but not specified.", 0, 0
919 FK_EXPORT, FK_SPEC, modeFlag,
922 "type definition exported but not specified",
923 "A type is exported, but not specified.", 0, 0
926 FK_EXPORT, FK_SPEC, modeFlag,
929 "variable exported but not specified",
930 "A variable is exported, but not specified.", 0, 0
933 FK_EXPORT, FK_SPEC, modeFlag,
936 "constant exported but not specified",
937 "A constant is exported, but not specified.", 0, 0
940 FK_EXPORT, FK_SPEC, modeFlag,
943 "constant exported but not specified",
944 "A constant is exported, but not specified.", 0, 0
947 FK_EXPOSURE, FK_ABSTRACT, specialFlag,
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.",
957 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
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).",
970 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
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.",
983 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
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.",
994 FK_FORMAT, FK_DISPLAY, valueFlag,
997 "set length of messages (number of chars)",
1001 FK_FORMAT, FK_DISPLAY, valueFlag,
1004 "set number of spaces to indent sub-messages",
1008 FK_FORMAT, FK_DISPLAY, plainFlag,
1011 "show column number where error is found",
1015 FK_FORMAT, FK_DISPLAY, plainFlag,
1017 FLG_PARENFILEFORMAT,
1018 "show column number where error is found",
1022 FK_FORMAT, FK_NONE, plainFlag,
1025 "show name of function containing error",
1029 FK_FORMAT, FK_NONE, plainFlag,
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.",
1038 FK_LIBS, FK_NONE, plainFlag,
1041 "make all alternate types implicit (useful for making system libraries",
1045 FK_GLOBAL, FK_ERRORS, globalValueFlag,
1048 "expect <int> code errors",
1052 FK_GLOBAL, FK_ERRORS, globalValueFlag,
1055 "expect <int> spec errors",
1059 FK_GLOBAL, FK_USE, idemSpecialFlag,
1062 "check as partial system (-specundef, -declundef, -exportlocal, "
1063 "don't check macros in headers without corresponding .c files)",
1067 FK_GLOBALS, FK_SPEC, plainFlag,
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 "
1079 FK_GLOBALS, FK_SPEC, modeFlag,
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.",
1088 FK_GLOBALS, FK_NONE, modeFlag,
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",
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",
1106 FK_GLOBALS, FK_MODIFIES, modeFlag,
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.",
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.",
1125 FK_GLOBALS, FK_UNSPEC, modeFlag,
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.",
1138 FK_GLOBALS, FK_IMPLICIT, modeFlag,
1141 "report use and modification errors for globals not annotated with unchecked",
1145 FK_GLOBALS, FK_UNSPEC, modeFlag,
1147 FLG_CHECKSTRICTGLOBALS,
1148 "report use and modification errors for checkedstrict globals",
1152 FK_GLOBALS, FK_UNSPEC, modeFlag,
1153 "impcheckedspecglobs",
1154 FLG_IMPCHECKEDSPECGLOBALS,
1155 "assume checked qualifier for unqualified global declarations in .lcl files",
1159 FK_GLOBALS, FK_UNSPEC, modeFlag,
1160 "impcheckmodspecglobs",
1161 FLG_IMPCHECKMODSPECGLOBALS,
1162 "assume checkmod qualifier for unqualified global declarations in .lcl files",
1166 FK_GLOBALS, FK_UNSPEC, modeFlag,
1167 "impcheckedstrictspecglobs",
1168 FLG_IMPCHECKEDSTRICTSPECGLOBALS,
1169 "assume checkmod qualifier for unqualified global declarations in .lcl files",
1173 FK_GLOBALS, FK_UNSPEC, modeFlag,
1175 FLG_IMPCHECKEDGLOBALS,
1176 "assume checked qualifier for unqualified global declarations",
1180 FK_GLOBALS, FK_UNSPEC, modeFlag,
1182 FLG_IMPCHECKMODGLOBALS,
1183 "assume checkmod qualifier for unqualified global declarations",
1187 FK_GLOBALS, FK_UNSPEC, modeFlag,
1188 "impcheckedstrictglobs",
1189 FLG_IMPCHECKEDSTRICTGLOBALS,
1190 "assume checkedstrict qualifier for unqualified global declarations",
1194 FK_GLOBALS, FK_UNSPEC, modeFlag,
1195 "impcheckedstatics",
1196 FLG_IMPCHECKEDSTATICS,
1197 "assume checked qualifier for unqualified file static declarations",
1201 FK_GLOBALS, FK_UNSPEC, modeFlag,
1202 "impcheckmodstatics",
1203 FLG_IMPCHECKMODSTATICS,
1204 "assume checkmod qualifier for unqualified file static declarations",
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)",
1216 FK_GLOBALS, FK_UNSPEC, modeFlag,
1217 "impcheckedstrictstatics",
1218 FLG_IMPCHECKEDSTRICTSTATICS,
1219 "assume checkedstrict qualifier for unqualified file static declarations",
1223 FK_GLOBALS, FK_MODIFIES, modeFlag,
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.",
1232 FK_GLOBALS, FK_MODIFIES, modeFlag,
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.",
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.",
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.",
1261 FK_HEADERS, FK_DEBUG, debugFlag,
1268 FK_HEADERS, FK_SPEC, globalFlag,
1271 "generate .lh files", NULL,
1275 FK_HEADERS, FK_SPEC, globalFlag,
1278 "generate .lcs files", NULL,
1282 FK_HEADERS, FK_SPEED, globalFlag,
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.)",
1294 FK_HEADERS, FK_SPEED, globalFlag,
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.",
1303 FK_HEADERS, FK_SPEED, globalFlag,
1306 "do not include header files in system directories (set by -sysdirs)",
1307 "Do not include header files in system directories (set by -sysdirs)",
1311 FK_HELP, FK_NONE, plainFlag,
1314 "warn when command line sets flag to default value in mode",
1318 FK_HELP, FK_NONE, plainFlag,
1321 "warn when the unix library is used",
1325 FK_HELP, FK_NONE, plainFlag,
1328 "warn about bad command line flags",
1329 "A flag is not recognized or used in an incorrect way",
1333 FK_HELP, FK_NONE, plainFlag,
1336 "provide hints for all errors reported",
1340 FK_HELP, FK_NONE, globalExtraArgFlag,
1343 "-help <flags> will describe flags",
1347 FK_HELP, FK_FORMAT, plainFlag,
1350 "provide hints on using lclint (hint only reported for first related error)",
1354 FK_IGNORERET, FK_NONE, specialFlag,
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.",
1363 FK_IGNORERET, FK_BOOL, modeFlag,
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.",
1372 FK_IGNORERET, FK_BOOL, modeFlag,
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.",
1381 FK_IGNORERET, FK_NONE, modeFlag,
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.",
1390 FK_INIT, FK_FILES, globalExtraArgFlag,
1393 "load options file (default ~/.lclintrc not loaded)",
1397 FK_INIT, FK_FILES, globalExtraArgFlag,
1400 "set LCL initilization file",
1404 FK_INIT, FK_FILES, globalFlag,
1407 "do not read options file",
1411 FK_INIT, FK_SPEC, plainFlag,
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.",
1423 FK_DECL, FK_LIBS, plainFlag,
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.)",
1433 FK_ITER, FK_NONE, plainFlag,
1440 FK_ITER, FK_NONE, plainFlag,
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.",
1453 FK_LIBS, FK_FILES, globalStringFlag,
1456 "save state for merging (default suffix .lcd)",
1460 FK_LIBS, FK_FILES, globalStringFlag,
1463 "load state from dump file (default suffix .lcd)",
1467 FK_LIBS, FK_INIT, idemGlobalFlag,
1470 "do not load standard library",
1474 FK_LIBS, FK_INIT, globalFlag,
1477 "use ANSI (ISO) standard library",
1478 "Library based on the ANSI standard library specification is used.",
1482 FK_LIBS, FK_INIT, globalFlag,
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.)",
1491 FK_LIBS, FK_INIT, globalFlag,
1494 "use UNIX (sort-of) standard library",
1495 "UNIX version of the standard library is used.",
1499 FK_LIBS, FK_INIT, globalFlag,
1502 "use strict version of UNIX (sort-of) library",
1503 "strict version of the UNIX library is used.",
1507 FK_LIBS, FK_INIT, globalFlag,
1510 "use POSIX standard library",
1511 "POSIX version of the standard library is used.",
1515 FK_LIBS, FK_INIT, globalFlag,
1518 "use strict POSIX standard library",
1519 "POSIX version of the strict standard library is used.",
1523 FK_LIBS, FK_INIT, globalFlag,
1526 "show standard library filename",
1530 FK_LIBS, FK_FILES, globalStringFlag,
1533 "load meta state declaration and corresponding xh file",
1537 FK_INIT, FK_COMMENTS, valueFlag,
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.",
1547 FK_MACROS, FK_NONE, plainSpecialFlag,
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.",
1556 FK_MACROS, FK_NONE, plainFlag,
1559 "check all macros with declarations in library as functions",
1560 "Every macro declared in the load library is checked.",
1564 FK_MACROS, FK_NONE, plainFlag,
1567 "check all macros corresponding to specified functions or constants",
1568 "Every macro declared a specification file is checked.",
1572 FK_MACROS, FK_NONE, plainFlag,
1575 "check all macros with parameter lists as functions",
1576 "Every parameterized macro (not preceded by /*@notfunction@*/) "
1577 "is checked as a function.",
1581 FK_MACROS, FK_NONE, plainFlag,
1584 "check all macros without parameter lists as constants",
1585 "Every non-parameterized macro (not preceded by /*@notfunction@*/) "
1586 "is checked as a constant.",
1590 FK_MACROS, FK_NONE, modeFlag,
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",
1599 FK_MACROS, FK_NONE, plainFlag,
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.",
1607 FK_MACROS, FK_NONE, modeFlag,
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.",
1615 FK_MACROS, FK_NONE, modeFlag,
1618 "macro definition for is empty",
1619 "A macro definition has no body.",
1623 FK_MACROS, FK_PARAMS, modeFlag,
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.",
1636 FK_MACROS, FK_PARAMS, modeFlag,
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.",
1646 FK_MACROS, FK_PARAMS, modeFlag,
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.",
1654 FK_MACROS, FK_PARAMS, modeFlag,
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.",
1663 FK_MACROS, FK_NONE, modeFlag,
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.",
1673 FK_MACROS, FK_PROTOS, modeFlag,
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.",
1682 FK_MACROS, FK_PROTOS, modeFlag,
1685 "parameterized macro without prototype or specification",
1686 "Function macro has no declaration.",
1690 FK_MACROS, FK_PROTOS, modeFlag,
1693 "non-parameterized macro without prototype or specification",
1694 "Macro constant has no declaration. Use /*@constant ...@*/ to "
1695 "declare the macro.",
1699 FK_MACROS, FK_NONE, modeFlag,
1703 "A macro is defined in more than one place.", 0, 0
1706 FK_MACROS, FK_UNRECOG, modeFlag,
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.",
1715 FK_MEMORY, FK_DEAD, modeFlag,
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.",
1725 FK_MEMORY, FK_DEAD, modeFlag,
1728 "storage used after release",
1729 "Memory is used after it has been released (either by passing "
1730 "as an only param or assigning to and only global.",
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 "
1739 "(either by passing as an only param or assigning to and only global.",
1743 FK_MEMORY, FK_DEF, modeFlag,
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.",
1753 FK_MEMORY, FK_DEF, modeFlag,
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.",
1762 FK_MEMORY, FK_DEF, modeFlag,
1765 "out storage not defined before return or scope exit",
1766 "An out parameter or global is not defined before control is transferred.",
1770 FK_MEMORY, FK_DEF, modeFlag,
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.",
1779 FK_MEMORY, FK_IMPLICIT, modeFlag,
1782 "memory errors for unqualified storage",
1786 FK_MEMORY, FK_IMPLICIT, plainFlag,
1789 "assume unannotated parameter is temp",
1793 FK_MEMORY, FK_IMPLICIT, specialFlag,
1796 "sets globimponly, retimponly, structimponly, specglobimponly, "
1797 "specretimponly and specstructimponly",
1801 FK_MEMORY, FK_IMPLICIT, specialFlag,
1804 "sets globimponly, retimponly and structimponly",
1808 FK_MEMORY, FK_IMPLICIT, specialFlag,
1811 "sets specglobimponly, specretimponly and specstructimponly",
1815 FK_MEMORY, FK_IMPLICIT, plainFlag,
1818 "assume unannotated global storage is only",
1822 FK_MEMORY, FK_IMPLICIT, plainFlag,
1825 "assume unannotated returned storage is only",
1829 FK_MEMORY, FK_IMPLICIT, plainFlag,
1832 "assume unannotated structure field is only",
1836 FK_MEMORY, FK_IMPLICIT, plainFlag,
1838 FLG_SPECGLOBIMPONLY,
1839 "assume unannotated global storage is only",
1843 FK_MEMORY, FK_IMPLICIT, plainFlag,
1846 "assume unannotated returned storage is only",
1850 FK_MEMORY, FK_IMPLICIT, plainFlag,
1851 "specstructimponly",
1852 FLG_SPECSTRUCTIMPONLY,
1853 "assume unannotated structure field is only",
1857 FK_MEMORY, FK_ARRAY, modeFlag,
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.",
1868 FK_MEMORY, FK_LEAK, modeFlag,
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.",
1881 FK_MEMORY, FK_LEAK, modeFlag,
1884 "report complete destruction errors for array elements that "
1885 "may have been released",
1890 FK_MEMORY, FK_LEAK, modeFlag,
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.",
1900 FK_MEMORY, FK_NONE, modeFlag,
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 "
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 "
1921 FK_MEMORY, FK_NONE, specialFlag,
1924 "sets all dynamic memory checking flags (memimplicit, mustfree, mustdefine, "
1925 "mustnotalias, null, memtrans)",
1929 FK_MEMORY, FK_NONE, specialFlag,
1932 "memory transfer errors (sets all *trans flags)",
1933 "Memory is transferred in a way that violates annotations.",
1937 FK_MEMORY, FK_NONE, modeFlag,
1940 "exposure transfer errors",
1941 "Exposed storage is transferred to a non-exposed, non-observer reference.",
1945 FK_MEMORY, FK_NONE, modeFlag,
1948 "observer transfer errors",
1949 "Observer storage is transferred to a non-observer reference.",
1953 FK_MEMORY, FK_NONE, modeFlag,
1956 "dependent transfer errors",
1957 "Dependent storage is transferred to a non-dependent reference.",
1961 FK_MEMORY, FK_NONE, modeFlag,
1964 "new reference transfer to reference counted reference",
1965 "A new reference is transferred to a reference counted reference.",
1969 FK_MEMORY, FK_NONE, modeFlag,
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.",
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.",
1992 FK_MEMORY, FK_NONE, modeFlag,
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.",
2003 FK_MEMORY, FK_NONE, modeFlag,
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 "
2015 FK_MEMORY, FK_NONE, modeFlag,
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.",
2024 FK_MEMORY, FK_NONE, modeFlag,
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.",
2034 FK_MEMORY, FK_NONE, modeFlag,
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.",
2044 FK_MEMORY, FK_NONE, modeFlag,
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.",
2053 FK_MEMORY, FK_NONE, modeFlag,
2056 "an immediate address (result of &) is transferred inconsistently",
2057 "An immediate address (result of & operator) is transferred "
2062 FK_MEMORY, FK_NONE, modeFlag,
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.",
2071 FK_MEMORY, FK_NONE, modeFlag,
2074 "static storage is transferred in an inconsistent way",
2075 "Static storage is transferred in an inconsistent way.",
2079 FK_MEMORY, FK_NONE, modeFlag,
2082 "unqualified storage is transferred in an inconsistent way",
2083 "Unqualified storage is transferred in an inconsistent way.",
2087 FK_MEMORY, FK_NONE, modeFlag,
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.",
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.",
2103 FK_MEMORY, FK_NONE, modeFlag,
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.",
2112 FK_MEMORY, FK_NONE, modeFlag,
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.",
2120 FK_MEMORY, FK_PARAMS, modeFlag,
2123 "passing a value as an un-annotated parameter clears its annotation",
2127 FK_MODIFIES, FK_SPEC, plainFlag,
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.",
2136 FK_MODIFIES, FK_SPEC, modeFlag,
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 "
2147 FK_MODIFIES, FK_MEMORY, plainFlag,
2150 "possible modification of observer storage",
2151 "Storage declared with observer is possibly modified. Observer "
2152 "storage may not be modified.",
2156 FK_MODIFIES, FK_MEMORY, modeFlag,
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.",
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",
2174 FK_MODIFIES, FK_UNSPEC, modeFlag,
2177 "report undocumented file system modifications (applies to unspecified "
2178 "functions if modnomods is set)",
2182 FK_MODIFIES, FK_UNSPEC, specialFlag,
2185 "modification in unspecified functions (sets modnomods, "
2186 "modglobunspec and modstrictglobsunspec)",
2190 FK_MODIFIES, FK_UNSPEC, modeFlag,
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.",
2201 FK_MODIFIES, FK_UNSPEC, modeFlag,
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.",
2212 FK_MODIFIES, FK_UNSPEC, modeFlag,
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.",
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.",
2234 FK_MODIFIES, FK_GLOBALS, modeFlag,
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.",
2244 FK_NAMES, FK_ABSTRACT, plainFlag,
2247 "controls name checking without changing other settings",
2251 FK_NAMES, FK_ABSTRACT, specialFlag,
2254 "czech naming convention (sets accessczech, czechfunctions, czechvars, "
2255 "czechconstants, czechenums, and czechmacros)",
2256 "Name is not consistent with Czech naming convention.", 0, 0
2259 FK_NAMES, FK_ABSTRACT, plainFlag,
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
2266 FK_NAMES, FK_ABSTRACT, plainFlag,
2269 "czech naming convention violated in a variable declaration",
2270 "Variable name is not consistent with Czech naming convention.", 0, 0
2273 FK_NAMES, FK_ABSTRACT, plainFlag,
2276 "czech naming convention violated in an expanded macro name",
2277 "Expanded macro name is not consistent with Czech naming convention.", 0, 0
2280 FK_NAMES, FK_ABSTRACT, plainFlag,
2283 "czech naming convention violated in a constant declaration",
2284 "Constant name is not consistent with Czech naming convention.", 0, 0
2287 FK_NAMES, FK_ABSTRACT, plainFlag,
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
2295 FK_NAMES, FK_ABSTRACT, specialFlag,
2298 "slovak naming convention violated",
2299 "Name is not consistent with Slovak naming convention.", 0, 0
2302 FK_NAMES, FK_ABSTRACT, plainFlag,
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
2309 FK_NAMES, FK_ABSTRACT, plainFlag,
2312 "slovak naming convention violated in an expanded macro name",
2313 "Expanded macro name is not consistent with Slovak naming convention.", 0, 0
2316 FK_NAMES, FK_ABSTRACT, plainFlag,
2319 "slovak naming convention violated in a variable declaration",
2320 "Variable name is not consistent with Slovak naming convention.", 0, 0
2323 FK_NAMES, FK_ABSTRACT, plainFlag,
2325 FLG_SLOVAKCONSTANTS,
2326 "slovak naming convention violated in a constant declaration",
2327 "Constant name is not consistent with Slovak naming convention.", 0, 0
2330 FK_NAMES, FK_ABSTRACT, plainFlag,
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
2338 FK_NAMES, FK_ABSTRACT, specialFlag,
2341 "czech or slovak naming convention violated",
2342 "Name is not consistent with either Czech or Slovak naming convention.", 0, 0
2345 FK_NAMES, FK_ABSTRACT, plainFlag,
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
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
2359 FK_NAMES, FK_ABSTRACT, plainFlag,
2361 FLG_CZECHOSLOVAKVARS,
2362 "czechoslovak naming convention violated in a variable declaration",
2363 "Variable name is not consistent with Czechoslovak naming convention.", 0, 0
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
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
2381 FK_NAMES, FK_ANSI, modeFlag,
2384 "external name conflicts with name reserved for system or standard library",
2385 "External name is reserved for system in ANSI standard.",
2389 FK_NAMES, FK_ANSI, modeFlag,
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.",
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).",
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.",
2423 FK_NAMES, FK_ANSI, specialValueFlag,
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.",
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.",
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 "
2460 FK_NAMES, FK_ANSI, specialValueFlag,
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.",
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.",
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.",
2491 FK_NAMES, FK_PREFIX, idemStringFlag,
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.",
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.",
2507 FK_NAMES, FK_PREFIX, idemStringFlag,
2510 "set namespace prefix for struct, union and enum tags",
2511 "A tag identifier does not start with the tagprefix.",
2515 FK_NAMES, FK_PREFIX, plainFlag,
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.",
2523 FK_NAMES, FK_PREFIX, idemStringFlag,
2526 "set namespace prefix for enum members",
2527 "An enum member does not start with the enumprefix.",
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.",
2539 FK_NAMES, FK_PREFIX, idemStringFlag,
2541 FLG_FILESTATICPREFIX,
2542 "set namespace prefix for file static declarations",
2543 "A file-static identifier does not start with the filestaticprefix.",
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.",
2555 FK_NAMES, FK_PREFIX, idemStringFlag,
2558 "set namespace prefix for global variables",
2559 "A global variable does not start with the globalprefix",
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.",
2571 FK_NAMES, FK_PREFIX, idemStringFlag,
2574 "set namespace prefix for user-defined types",
2575 "A user-defined type does not start with the typeprefix",
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.",
2587 FK_NAMES, FK_PREFIX, idemStringFlag,
2590 "set namespace prefix for external identifiers",
2591 "An external identifier does not start with the externalprefix",
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.",
2603 FK_NAMES, FK_PREFIX, idemStringFlag,
2606 "set namespace prefix for local variables",
2607 "A local variable does not start with the localprefix",
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.",
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",
2627 FK_NAMES, FK_PREFIX, plainFlag,
2628 "uncheckedmacroprefixexclude",
2629 FLG_UNCHECKEDMACROPREFIXEXCLUDE,
2630 "the uncheckmacroprefix may not be used for identifiers that are not "
2632 "An identifier that is not the name of an unchecked macro "
2633 "starts with the uncheckedmacroprefix.",
2637 FK_NAMES, FK_PREFIX, idemStringFlag,
2640 "set namespace prefix for constants",
2641 "A constant does not start with the constantprefix",
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.",
2653 FK_NAMES, FK_PREFIX, idemStringFlag,
2656 "set namespace prefix for iterators",
2657 "An iter does not start with the iterator prefix",
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.",
2669 FK_NAMES, FK_PREFIX, idemStringFlag,
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",
2678 FK_NAMES, FK_PREFIX, modeFlag,
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.",
2687 FK_NAMES, FK_PREFIX, modeFlag,
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",
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.",
2707 FK_LIMITS, FK_ANSI, modeValueFlag,
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.",
2716 FK_LIMITS, FK_ANSI, modeValueFlag,
2718 FLG_STRINGLITERALLEN,
2719 "set maximum length of string literals (ANSI minimum is 509)",
2720 "Maximum length of string literal exceeded.",
2724 FK_LIMITS, FK_ANSI, modeValueFlag,
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.",
2732 FK_LIMITS, FK_ANSI, modeValueFlag,
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.",
2740 FK_LIMITS, FK_ANSI, modeValueFlag,
2743 "set maximum number of nested #include files",
2744 "Maximum number of nested #include files exceeded.",
2748 FK_LIMITS, FK_ANSI, specialFlag,
2751 "check for violations of standard limits (controlnestdepth, "
2752 "stringliterallen, includenest, numstructfields, numenummembers)",
2757 FK_NAMES, FK_NONE, plainFlag,
2761 "Naming convention is violated.",
2765 FK_NONE, FK_NONE, plainFlag,
2772 FK_NULL, FK_MEMORY, specialFlag,
2775 "misuses of null pointer",
2776 "A possibly null pointer is misused (sets nullderef, nullpass, "
2777 "nullref, nullassign, and nullstate).",
2781 FK_NT, FK_MEMORY, modeFlag,
2784 "misuse of nullterminated allocation",
2785 "A possibly non-nullterminated string/memory is used/referenced as a nullterminated one, ",
2789 FK_NT, FK_MEMORY, modeFlag,
2792 "possible out of bounds read",
2793 "An array or pointer access references memory beyond the array or buffer, ",
2797 FK_NT, FK_MEMORY, modeFlag,
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, ",
2806 FK_NT, FK_MEMORY, modeFlag,
2809 "Function has the post condition",
2810 "LCLint has determined that the following statement is true after the function, ",
2814 FK_NT, FK_MEMORY, modeFlag,
2815 "debugfcnconstraint",
2816 FLG_DEBUGFUNCTIONCONSTRAINT,
2817 "debuging constraint flas",
2818 "This flag is for debuging. It causes lclint to perform buffer overflow checking even if the error will be surpressed. Normal buffer overflow checking will only be performed if errors would be printed. ",
2822 FK_NT, FK_MEMORY, modeFlag,
2824 FLG_FUNCTIONCONSTRAINT,
2825 "unresolved constraint",
2826 "LCLint was unable to resolve a constraint at the top of the function. If code is correct consider using explict annotation assertions, ",
2829 /*drl7x added 6/18/01 */
2831 FK_NT, FK_MEMORY, modeFlag,
2834 "unable to verify ensures annotation",
2835 "LCLint was unable to determine that the function satisfies a post condition given in an ensures annotation, ",
2840 FK_NT, FK_MEMORY, modeFlag,
2841 "constraintlocation",
2842 FLG_CONSTRAINTLOCATION,
2843 "display full c expression for every constraint generated",
2846 },/*drl added flag 4/26/01*/
2848 FK_NT, FK_MEMORY, modeFlag,
2849 "implictconstraint",
2850 FLG_IMPLICTCONSTRAINT,
2851 "Try to generate implicit constraints for functions",
2855 /*drl7x added 4/29/01 */
2857 FK_NT, FK_MEMORY, modeFlag,
2860 "Use limited OR expressions to resolve constraints",
2866 FK_NT, FK_MEMORY, modeFlag,
2868 FLG_NULLTERMINATEDWARNING,
2869 "misuse of nullterminated allocation",
2870 "WARNING:A user annotated non-nullterminated buffer is used/referenced as a nullterminated one, ",
2874 FK_NULL, FK_MEMORY, modeFlag,
2877 "possible dereferencce of null pointer",
2878 "A possibly null pointer is dereferenced. Value is "
2879 "either the result of a function which may return null "
2880 "(in which case, code should check it is not null), or a "
2881 "global, parameter or structure field declared with the "
2886 FK_TYPE, FK_NONE, modeFlag,
2889 "dereferencce of a function type",
2890 "A function type is dereferenced. The ANSI standard allows this "
2891 "because of implicit conversion of function designators, however the "
2892 "dereference is unnecessary.",
2896 FK_NULL, FK_MEMORY, modeFlag,
2899 "possibly null pointer passed as formal with no null annotation",
2900 "A possibly null pointer is passed as a parameter corresponding to "
2901 "a formal parameter with no /*@null@*/ annotation. If NULL "
2902 "may be used for this parameter, add a /*@null@*/ annotation "
2903 "to the function parameter declaration.",
2907 FK_NULL, FK_MEMORY, modeFlag,
2910 "possibly null pointer returned as result with no null annotation",
2911 "Function returns a possibly null pointer, but is not declared "
2912 "using /*@null@*/ annotation of result. If function may "
2913 "return NULL, add /*@null@*/ annotation to the return "
2914 "value declaration.",
2918 FK_NULL, FK_MEMORY, modeFlag,
2921 "possibly null pointer reachable from a reference with no null annotation",
2922 "A possibly null pointer is reachable from a parameter or global "
2923 "variable that is not declared using a /*@null@*/ annotation.",
2927 FK_NULL, FK_MEMORY, modeFlag,
2930 "inconsistent assignment or initialization involving null pointer",
2931 "A reference with no null annotation is assigned or initialized "
2932 "to NULL. Use /*@null@*/ to declare the reference as "
2933 "a possibly null pointer.",
2937 FK_OPS, FK_BOOL, modeFlag,
2940 "comparison between bools (dangerous because of multiple TRUE values)",
2941 "Two bool values are compared directly using a C primitive. This "
2942 "may produce unexpected results since all non-zero values are "
2943 "considered TRUE, so different TRUE values may not be equal. "
2944 "The file bool.h (included in lclint/lib) provides bool_equal "
2945 "for safe bool comparisons.", 0, 0
2948 FK_OPS, FK_NONE, modeFlag,
2951 "dangerous comparison between reals (dangerous because of inexact "
2952 "floating point representations)",
2953 "Two real (float, double, or long double) values are compared "
2954 "directly using a C primitive. "
2955 "This may produce unexpected results since floating point "
2956 "representations are inexact. Instead, compare the difference to "
2957 "FLT_EPSILON or DBL_EPSILON.",
2961 FK_OPS, FK_POINTER, modeFlag,
2964 "arithmetic involving pointer and integer",
2965 "Pointer arithmetic using pointer and integer.", 0, 0
2968 FK_OPS, FK_POINTER, modeFlag,
2970 FLG_NULLPOINTERARITH,
2971 "arithmetic involving possibly null pointer and integer",
2972 "Pointer arithmetic using a possibly null pointer and integer.", 0, 0
2975 FK_OPS, FK_POINTER, modeFlag,
2978 "comparison between pointer and number",
2979 "A pointer is compared to a number.", 0, 0
2982 FK_OPS, FK_TYPE, modeFlag,
2985 "primitive operation does not type check strictly",
2986 "A primitive operation does not type check strictly.", 0, 0
2989 FK_OPS, FK_TYPE, modeFlag,
2992 "a bitwise logical operator does not have unsigned operands",
2993 "An operand to a bitwise operator is not an unsigned values. This "
2994 "may have unexpected results depending on the signed "
2995 "representations.", 0, 0
2998 FK_OPS, FK_TYPE, modeFlag,
3001 "a shift operator does not have unsigned operands",
3002 "An operand to a shift operator is not unsigned values. This "
3003 "may have unexpected results depending on the signed "
3004 "representations.", 0, 0
3007 FK_OPS, FK_BOOL, modeFlag,
3010 "primitive operation (!, && or ||) does not has a boolean argument",
3011 "The operand of a boolean operator is not a boolean. Use +ptrnegate "
3012 "to allow ! to be used on pointers.",
3016 FK_OPS, FK_POINTER, modeFlag,
3019 "allow ! to be used on pointer operand",
3020 "The operand of ! operator is a pointer.", 0, 0
3023 FK_OPS, FK_TYPE, modeFlag,
3026 "sizeof operator has a type argument",
3027 "Operand of sizeof operator is a type. (Safer to use expression, "
3028 "int *x = sizeof (*x); instead of sizeof (int).)",
3032 FK_OPS, FK_TYPE, plainFlag,
3033 "sizeofformalarray",
3034 FLG_SIZEOFFORMALARRAY,
3035 "sizeof operator has an array formal parameter argument",
3036 "Operand of a sizeof operator is a function parameter declared as "
3037 "an array. The value of sizeof will be the size of a pointer to the "
3038 "element type, not the number of elements in the array.",
3042 FK_DECL, FK_TYPE, plainFlag,
3044 FLG_FIXEDFORMALARRAY,
3045 "formal parameter of type array is declared with size",
3046 "A formal parameter is declared as an array with size. The size of the array "
3047 "is ignored in this context, since the array formal parameter is treated "
3052 FK_DECL, FK_TYPE, plainFlag,
3055 "formal parameter has an incomplete type",
3056 "A formal parameter is declared with an incomplete type.",
3060 FK_DECL, FK_TYPE, plainFlag,
3063 "formal parameter is an array",
3064 "A formal parameter is declared as an array. This can be confusing, since "
3065 "a formal array parameter is treated as a pointer.",
3069 FK_PRED, FK_BOOL, plainFlag,
3072 "condition test (if, while or for) is an assignment",
3073 "The condition test is an assignment expression. Probably, you mean "
3074 "to use == instead of =. If an assignment is intended, add an "
3075 "extra parentheses nesting (e.g., if ((a = b)) ...) to suppress "
3080 FK_PRED, FK_BOOL, specialFlag,
3083 "type of condition test (if, while or for) not bool (sets predboolint, "
3084 "predboolptr and predboolothers)",
3085 "Test expression type is not boolean.", 0, 0
3088 FK_PRED, FK_BOOL, modeFlag,
3091 "type of condition test (if, while or for) is an integral type",
3092 "Test expression type is not boolean or int.", 0, 0
3095 FK_PRED, FK_BOOL, modeFlag,
3098 "type of condition test (if, while or for) not bool, int or pointer",
3099 "Test expression type is not boolean.", 0, 0
3102 FK_PRED, FK_BOOL, modeFlag,
3105 "type of condition test (if, while or for) is a pointer",
3106 "Test expression type is not boolean.", 0, 0
3109 FK_PREPROC, FK_NONE, globalExtraArgFlag,
3112 "passed to pre-processor",
3116 FK_PREPROC, FK_NONE, globalExtraArgFlag,
3119 "passed to pre-processor",
3123 FK_GLOBALS, FK_NONE, modeFlag,
3126 "returns with global in inconsistent state (null or undefined)",
3127 "A global variable does not satisfy its annotations when control is transferred.",
3131 FK_SUPPRESS, FK_COMMENTS, globalFlag,
3134 "The number of errors detected does not match number in /*@i<n>@*/.",
3138 FK_SUPPRESS, FK_ERRORS, valueFlag,
3141 "limit <int> consecutive repeated errors",
3145 FK_SYNTAX, FK_NONE, plainFlag,
3148 "syntax error in parsing",
3149 "Code cannot be parsed. For help on parse errors, see lclint -help parseerrors.",
3153 FK_SYNTAX, FK_NONE, plainFlag,
3156 "try to recover from parse error",
3157 "Try to recover from parse error. It really means try --- this doesn't usually work.", 0, 0
3160 FK_SYNTAX, FK_PREPROC, plainFlag,
3167 FK_TYPE, FK_NONE, plainFlag,
3171 "Types are incompatible.",
3175 FK_TYPE, FK_NONE, plainFlag,
3178 "initializer sets all fields",
3179 "Initializer does not set every field in the structure.",
3183 FK_TYPE, FK_NONE, modeFlag,
3186 "enum members must be int values",
3187 "Type of initial values for enum members must be int.",
3192 FK_TYPE, FK_NONE, plainFlag,
3195 "type of main does not match expected type",
3196 "The function main does not match the expected type.",
3200 FK_TYPE, FK_NONE, plainFlag,
3203 "type-mismatch in parameter corresponding to format code in a printf or scanf-like function",
3204 "Type of parameter is not consistent with corresponding code in format string.",
3208 FK_TYPE, FK_NONE, modeFlag,
3211 "format parameter is not a string constant (hence variable arguments cannot be typechecked)",
3212 "Format parameter is not known at compile-time. This can lead to security vulnerabilities because the arguments cannot be type checked.",
3216 FK_TYPE, FK_NONE, plainFlag,
3219 "invalid format code in format string for printf or scanf-like function",
3220 "Format code in a format string is not valid.",
3224 FK_TYPEEQ, FK_ABSTRACT, modeFlag,
3227 "forward declarations of pointers to abstract representation match abstract type",
3231 FK_TYPEEQ, FK_ABSTRACT, modeFlag,
3234 "void * matches pointers to abstract types, casting ok (dangerous)",
3235 "A pointer to void is cast to a pointer to an abstract type (or vice versa).",
3239 FK_TYPEEQ, FK_POINTER, plainFlag,
3242 "a pointer to a function is cast to a pointer to void (or vice versa)",
3243 "A pointer to a function is cast to (or used as) a pointer to void (or vice versa).",
3247 FK_TYPEEQ, FK_ARRAY, modeFlag,
3250 "char can be used to index arrays",
3251 "To allow char types to index arrays, use +charindex.", 0, 0
3254 FK_TYPEEQ, FK_ARRAY, modeFlag,
3257 "enum can be used to index arrays",
3258 "To allow enum types to index arrays, use +enumindex.", 0, 0
3261 FK_TYPEEQ, FK_BOOL, modeFlag,
3264 "bool and int are equivalent",
3265 "To make bool and int types equivalent, use +boolint.",
3269 FK_TYPEEQ, FK_NONE, modeFlag,
3272 "char and int are equivalent",
3273 "To make char and int types equivalent, use +charint.",
3277 FK_TYPEEQ, FK_NONE, modeFlag,
3280 "enum and int are equivalent",
3281 "To make enum and int types equivalent, use +enumint.",
3285 FK_TYPEEQ, FK_NONE, modeFlag,
3288 "float and double are equivalent",
3289 "To make float and double types equivalent, use +floatdouble.",
3293 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3296 "ignore type qualifiers (long, short, unsigned)",
3297 "To ignore type qualifiers in type comparisons use +ignorequals.",
3301 FK_TYPEEQ, FK_SYNTAX, plainFlag,
3304 "report duplicate type qualifiers (e.g., long long)",
3305 "Duplicate type qualifiers not supported by ANSI. Some "
3306 "compilers (e.g., gcc) do support duplicate qualifiers.",
3310 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3313 "ignore signs in type comparisons (unsigned matches signed)",
3314 "To ignore signs in type comparisons use +ignoresigns",
3318 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3321 "int literals can be reals",
3322 "An int literal is used as any numeric type (including float and long long). Use +numliteral to "
3323 "allow int literals to be used as any numeric type.",
3327 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3330 "character constants (e.g., 'a') can be used as ints",
3331 "A character constant is used as an int. Use +charintliteral to "
3332 "allow character constants to be used as ints. (This is safe "
3333 "since the actual type of a char constant is int.)",
3337 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3340 "report qualifier mismatches only if dangerous",
3341 "To allow qualifier mismatches that are not dangerous, use +relaxquals.", 0, 0
3344 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3347 "allow all numeric types to match",
3348 "To allow all numeric types to match, use +relaxtypes.", 0, 0
3351 FK_TYPEEQ, FK_NONE, modeFlag,
3353 FLG_CHARUNSIGNEDCHAR,
3354 "allow char and unsigned char types to match",
3355 "To allow char and unsigned char types to match use +charunsignedchar.",
3359 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3361 FLG_MATCHANYINTEGRAL,
3362 "allow any intergral type to match an arbitrary integral type (e.g., dev_t)",
3363 "To allow arbitrary integral types to match any integral type, use +matchanyintegral.",
3367 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3368 "longunsignedintegral",
3369 FLG_LONGUNSIGNEDINTEGRAL,
3370 "allow long unsigned type to match an arbitrary integral type (e.g., dev_t)",
3371 "To allow arbitrary integral types to match long unsigned, use +longunsignedintegral.",
3375 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3378 "allow long type to match an arbitrary integral type (e.g., dev_t)",
3379 "To allow arbitrary integral types to match long unsigned, use +longintegral.",
3383 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3384 "longunsignedunsignedintegral",
3385 FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL,
3386 "allow long unsigned type to match an arbitrary unsigned integral type (e.g., size_t)",
3387 "To allow arbitrary unsigned integral types to match long unsigned, "
3388 "use +longunsignedunsignedintegral.",
3392 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3393 "longsignedintegral",
3394 FLG_LONGSIGNEDINTEGRAL,
3395 "allow long type to match an arbitrary signed integral type (e.g., ssize_t)",
3396 "To allow arbitrary signed integral types to match long unsigned, use +longsignedintegral.",
3400 FK_TYPEEQ, FK_POINTER, plainFlag,
3403 "0 is treated as a pointer",
3407 FK_TYPEEQ, FK_BOOL, modeFlag,
3410 "0 is treated as a boolean",
3414 FK_UNRECOG, FK_DISPLAY, plainFlag,
3417 "do not suppress repeated unrecognized identifier messages (instead of only reporting the first error)",
3418 "Identifier used in code has not been declared. (Message repeated for future uses in this file.)",
3422 FK_UNRECOG, FK_DISPLAY, plainFlag,
3425 "report unrecognized identifiers with system (__) prefix",
3426 "Identifier used in code has not been declared. (Message repeated for "
3427 "future uses in this file.) Use +gnuextensions to make lclint "
3428 "recognize some keywords that are gnu extensions.",
3432 FK_UNRECOG, FK_NONE, plainFlag,
3435 "unrecognized identifier",
3436 "Identifier used in code has not been declared.", 0, 0
3439 FK_USE, FK_COMPLETE, modeFlag,
3442 "declaration at top level not used",
3443 "An external declaration not used in any source file.", 0, 0
3446 FK_USE, FK_EXPORT, modeFlag,
3449 "a declaration is exported but not used outside this module",
3450 "A declaration is exported, but not used outside this module. "
3451 "Declaration can use static qualifier.",
3455 FK_USE, FK_EXPORT, modeFlag,
3458 "a declaration is exported but does not appear in a header file",
3459 "A declaration is exported, but does not appear in a header file.",
3463 FK_USE, FK_EXPORT, modeFlag,
3465 FLG_EXPORTHEADERVAR,
3466 "a variable declaration is exported but does not appear in a header file",
3467 "A variable declaration is exported, but does not appear in a header "
3468 "file. (Used with exportheader.)",
3472 FK_USE, FK_NONE, modeFlag,
3475 "field of structure type not used",
3476 "A field is present in a structure type but never used. Use /*@unused@*/ in front of field declaration to suppress message.",
3480 FK_USE, FK_NONE, modeFlag,
3483 "member of an enum type not used",
3484 "A member of an enum type is never used.",
3488 FK_USE, FK_NONE, modeFlag,
3491 "constant declared but not used",
3492 "A constant is declared but not used. Use unused in the constant declaration to suppress message.",
3496 FK_USE, FK_NONE, modeFlag,
3499 "function declared but not used",
3500 "A function is declared but not used. Use /*@unused@*/ in front of function header to suppress message.",
3504 FK_USE, FK_PARAMS, modeFlag,
3507 "function parameter not used ",
3508 "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.",
3512 FK_USE, FK_TYPE, modeFlag,
3515 "type declared but not used",
3516 "A type is declared but not used. Use /*@unused@*/ in front of typedef to suppress messages.",
3520 FK_USE, FK_NONE, modeFlag,
3523 "variable declared but not used",
3524 "A variable is declared but never used. Use /*@unused@*/ in front "
3525 "of declaration to suppress message.",
3529 FK_USE, FK_COMPLETE, modeFlag,
3532 "unused declaration in special file (corresponding to .l or .y file)",
3536 FK_DECL, FK_TYPE, modeFlag,
3537 "redundantsharequal",
3538 FLG_REDUNDANTSHAREQUAL,
3539 "declaration uses observer qualifier that is always true",
3540 "A declaration of an immutable object uses a redundant observer qualifier.",
3544 FK_DECL, FK_TYPE, modeFlag,
3545 "misplacedsharequal",
3546 FLG_MISPLACEDSHAREQUAL,
3547 "declaration of unsharable storage uses sharing annotation",
3548 "A declaration of an unsharable object uses a sharing annotation.",
3552 FK_DECL, FK_TYPE, plainFlag,
3554 FLG_ANNOTATIONERROR,
3555 "annotation is used in inconsistent location",
3556 "A declaration uses an invalid annotation.",
3560 FK_DECL, FK_TYPE, plainFlag,
3563 "inconsistent syntactic comment",
3564 "A syntactic comment is used inconsistently.",
3568 FK_DEBUG, FK_NONE, debugFlag,
3575 FK_DEBUG, FK_NONE, valueFlag,
3578 "set maximum number of bugs detected before giving up",
3583 FK_HELP, FK_NONE, plainFlag,
3586 "warn when command line file does not have a recognized extension",
3590 FK_DECL, FK_NONE, plainFlag,
3593 "warn when declaration marked with warn is used",
3594 "Declaration marked with warn clause is used (can be suppresed by more specific flags).",
3598 FK_MEMORY, FK_DEF, modeFlag,
3601 "storage has been transfered with invalid state",
3602 "Transfer violates user-defined state rules.",
3606 FK_MEMORY, FK_DEF, modeFlag,
3609 "control paths merge with storage in incompatible states",
3610 "Control path merge violates user-defined state merge rules.",
3615 ** The its4 level flags must appear in order.
3619 FK_WARNUSE, FK_SECURITY, specialFlag,
3622 "most risky security vulnerabilities (from its4 database)",
3623 "Security vulnerability classified as most risky in its4 database.",
3627 FK_WARNUSE, FK_SECURITY, specialFlag,
3630 "very risky security vulnerabilities (from its4 database)",
3631 "Security vulnerability classified as very risky in its4 database.",
3635 FK_WARNUSE, FK_SECURITY, specialFlag,
3638 "risky security vulnerabilities (from its4 database)",
3639 "Security vulnerability classified as risky in its4 database.",
3643 FK_WARNUSE, FK_SECURITY, specialFlag,
3645 FLG_ITS4MODERATERISK,
3646 "moderately risky security vulnerabilities (from its4 database)",
3647 "Security vulnerability classified as moderate risk in its4 database.",
3651 FK_WARNUSE, FK_SECURITY, specialFlag,
3654 "risky security vulnerabilities (from its4 database)",
3655 "Security vulnerability classified as risky in its4 database.",
3660 ** End of its4 level flags
3664 FK_WARNUSE, FK_SECURITY, modeFlag,
3665 "bufferoverflowhigh",
3666 FLG_BUFFEROVERFLOWHIGH,
3667 "likely buffer overflow vulnerability",
3668 "Use of function that may lead to buffer overflow.",
3672 FK_WARNUSE, FK_SECURITY, modeFlag,
3675 "possible buffer overflow vulnerability",
3676 "Use of function that may lead to buffer overflow.",
3680 FK_WARNUSE, FK_SECURITY, modeFlag,
3683 "possible time of check, time of use vulnerability",
3684 "Possible time of check, time of use vulnerability.",
3688 FK_WARNUSE, FK_SECURITY, modeFlag,
3691 "function is not reentrant",
3692 "Non-reentrant function should not be used in multithreaded code.",
3696 FK_WARNUSE, FK_SECURITY, modeFlag,
3699 "function is restricted to superusers",
3700 "Call to function restricted to superusers.",