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 "a flag is not recognized or used in an incorrect way",
1332 FK_HELP, FK_NONE, plainFlag,
1335 "provide hints for all errors reported",
1339 FK_HELP, FK_NONE, globalExtraArgFlag,
1342 "-help <flags> will describe flags",
1346 FK_HELP, FK_FORMAT, plainFlag,
1349 "provide hints on using lclint (hint only reported for first related error)",
1353 FK_IGNORERET, FK_NONE, specialFlag,
1356 "return value ignored (sets retvalint, retvalbool and retvalother)",
1357 "Result returned by function call is not used. If this is intended, "
1358 "cast result to (void) to eliminate message.",
1362 FK_IGNORERET, FK_BOOL, modeFlag,
1365 "return value of type other than bool or int ignored",
1366 "Result returned by function call is not used. If this is intended, "
1367 "can cast result to (void) to eliminate message.",
1371 FK_IGNORERET, FK_BOOL, modeFlag,
1374 "return value of manifest type bool ignored",
1375 "Result returned by function call is not used. If this is intended, "
1376 "can cast result to (void) to eliminate message.",
1380 FK_IGNORERET, FK_NONE, modeFlag,
1383 "return value of type int ignored",
1384 "Result returned by function call is not used. If this is intended, "
1385 "can cast result to (void) to eliminate message.",
1389 FK_INIT, FK_FILES, globalExtraArgFlag,
1392 "load options file (default ~/.lclintrc not loaded)",
1396 FK_INIT, FK_FILES, globalExtraArgFlag,
1399 "set LCL initilization file",
1403 FK_INIT, FK_FILES, globalFlag,
1406 "do not read options file",
1410 FK_INIT, FK_SPEC, plainFlag,
1413 "information in specifications is not also included in syntactic comments",
1414 "There is information in the specification that is not duplicated "
1415 "in syntactic comments. Normally, this is not an "
1416 "error, but it may be useful to detect it to make "
1417 "sure checking incomplete systems without the specifications will "
1418 "still use this information.",
1422 FK_DECL, FK_LIBS, plainFlag,
1425 "report new global declarations in source files",
1426 "There is a new declaration that is not declared in a loaded library "
1427 "or earlier file. (Use this flag to check for consistency "
1428 "against a library.)",
1432 FK_ITER, FK_NONE, plainFlag,
1439 FK_ITER, FK_NONE, plainFlag,
1442 "iter declaration has no yield parameters",
1443 "An iterator has been declared with no parameters annotated with "
1444 "yield. This may be what you want, if the iterator is meant "
1445 "to do something a fixed number of times, but returns no "
1446 "information to the calling context. Probably, a parameter "
1447 "is missing the yield annotation to indicate that it is "
1448 "assigned a value in the calling context.",
1452 FK_LIBS, FK_FILES, globalStringFlag,
1455 "save state for merging (default suffix .lcd)",
1459 FK_LIBS, FK_FILES, globalStringFlag,
1462 "load state from dump file (default suffix .lcd)",
1466 FK_LIBS, FK_INIT, idemGlobalFlag,
1469 "do not load standard library",
1473 FK_LIBS, FK_INIT, globalFlag,
1476 "use ANSI (ISO) standard library",
1477 "Library based on the ANSI standard library specification is used.",
1481 FK_LIBS, FK_INIT, globalFlag,
1484 "interpret standard library strictly",
1485 "Stricter version of the standard library is used. (The default "
1486 "library is standard.lcd; strict library is strict.lcd.)",
1490 FK_LIBS, FK_INIT, globalFlag,
1493 "use UNIX (sort-of) standard library",
1494 "UNIX version of the standard library is used.",
1498 FK_LIBS, FK_INIT, globalFlag,
1501 "use strict version of UNIX (sort-of) library",
1502 "strict version of the UNIX library is used.",
1506 FK_LIBS, FK_INIT, globalFlag,
1509 "use POSIX standard library",
1510 "POSIX version of the standard library is used.",
1514 FK_LIBS, FK_INIT, globalFlag,
1517 "use strict POSIX standard library",
1518 "POSIX version of the strict standard library is used.",
1522 FK_LIBS, FK_INIT, globalFlag,
1525 "show standard library filename",
1529 FK_LIBS, FK_FILES, globalStringFlag,
1532 "load meta state declaration and corresponding xh file",
1536 FK_INIT, FK_COMMENTS, valueFlag,
1539 "set marker character for syntactic comments (default is '@')",
1540 "Set the marker character for syntactic comments. Comments beginning "
1541 "with /*<char> are interpreted by lclint, where <char> is the "
1542 "comment marker character.",
1546 FK_MACROS, FK_NONE, plainSpecialFlag,
1549 "sets fcnmacros and constmacros",
1550 "All macros (not preceded by /*@notfunction@*/) are checked as functions or "
1551 "constants depending on whether or not they have parameter lists.",
1555 FK_MACROS, FK_NONE, plainFlag,
1558 "check all macros with declarations in library as functions",
1559 "Every macro declared in the load library is checked.",
1563 FK_MACROS, FK_NONE, plainFlag,
1566 "check all macros corresponding to specified functions or constants",
1567 "Every macro declared a specification file is checked.",
1571 FK_MACROS, FK_NONE, plainFlag,
1574 "check all macros with parameter lists as functions",
1575 "Every parameterized macro (not preceded by /*@notfunction@*/) "
1576 "is checked as a function.",
1580 FK_MACROS, FK_NONE, plainFlag,
1583 "check all macros without parameter lists as constants",
1584 "Every non-parameterized macro (not preceded by /*@notfunction@*/) "
1585 "is checked as a constant.",
1589 FK_MACROS, FK_NONE, modeFlag,
1592 "macro definition does not match iter or constant declaration",
1593 "A iter or constant macro is defined using a different name from the "
1594 "one used in the previous syntactic comment",
1598 FK_MACROS, FK_NONE, plainFlag,
1601 "the line after a constant or iter declaration must be a macro definition",
1602 "A constant or iter declaration is not immediately followed by a macro definition.",
1606 FK_MACROS, FK_NONE, modeFlag,
1609 "macro definition is syntactically not equivalent to function",
1610 "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.",
1614 FK_MACROS, FK_NONE, modeFlag,
1617 "macro definition for is empty",
1618 "A macro definition has no body.",
1622 FK_MACROS, FK_PARAMS, modeFlag,
1625 "macro parameter not used exactly once",
1626 "A macro parameter is not used exactly once in all possible "
1627 "invocations of the macro. To behave like a function, "
1628 "each macro parameter must be used exactly once on all "
1629 "invocations of the macro so that parameters with "
1630 "side-effects are evaluated exactly once. Use /*@sef@*/ to "
1631 "denote parameters that must be side-effect free.",
1635 FK_MACROS, FK_PARAMS, modeFlag,
1638 "assignment to a macro parameter",
1639 "A macro parameter is used as the left side of an "
1640 "assignment expression. This exhibits behavior that "
1641 "could not be implemented by a function.",
1645 FK_MACROS, FK_PARAMS, modeFlag,
1648 "a parameter with side-effects is passed as a sef parameter",
1649 "An actual parameter corresponding to a sef parameter may have a side-effect.",
1653 FK_MACROS, FK_PARAMS, modeFlag,
1656 "a parameter with unconstrained side-effects is passed as a sef parameter",
1657 "An actual parameter corresponding to a sef parameter involves a call "
1658 "to a procedure with no modifies clause that may have a side-effect.",
1662 FK_MACROS, FK_NONE, modeFlag,
1665 "macro parameter used without parentheses (in potentially dangerous context)",
1666 "A macro parameter is used without parentheses. This could be "
1667 "dangerous if the macro is invoked with a complex expression "
1668 "and precedence rules will change the evaluation inside the macro.",
1672 FK_MACROS, FK_PROTOS, modeFlag,
1675 "macro without prototype or specification (sets macrofcndecl and macroconstdecl)",
1676 "Argument checking cannot be done well for macros without prototypes "
1677 "or specifications, since the types of the arguments are unknown.",
1681 FK_MACROS, FK_PROTOS, modeFlag,
1684 "parameterized macro without prototype or specification",
1685 "Function macro has no declaration.",
1689 FK_MACROS, FK_PROTOS, modeFlag,
1692 "non-parameterized macro without prototype or specification",
1693 "Macro constant has no declaration. Use /*@constant ...@*/ to "
1694 "declare the macro.",
1698 FK_MACROS, FK_NONE, modeFlag,
1702 "A macro is defined in more than one place.", 0, 0
1705 FK_MACROS, FK_UNRECOG, modeFlag,
1708 "unrecognized identifier in macro",
1709 "An unrecognized identifier appears in a macro. If the identifier "
1710 "is defined before the macro is used, then this is okay.",
1714 FK_MEMORY, FK_DEAD, modeFlag,
1717 "external reference to stack-allocated storage is created",
1718 "A stack reference is pointed to by an external reference when the "
1719 "function returns. The stack-allocated storage is destroyed "
1720 "after the call, leaving a dangling reference.",
1724 FK_MEMORY, FK_DEAD, modeFlag,
1727 "storage used after release",
1728 "Memory is used after it has been released (either by passing "
1729 "as an only param or assigning to and only global.",
1733 FK_MEMORY, FK_DEAD, modeFlag,
1734 "strictusereleased",
1735 FLG_STRICTUSERELEASED,
1736 "element used after it may have been released",
1737 "Memory (through fetch) is used after it may have been released "
1738 "(either by passing as an only param or assigning to and only global.",
1742 FK_MEMORY, FK_DEF, modeFlag,
1745 "parameter, return value or global completely defined",
1746 "Storage derivable from a parameter, return value or global is "
1747 "not defined. Use /*@out@*/ to denote passed or returned "
1748 "storage which need not be defined.",
1752 FK_MEMORY, FK_DEF, modeFlag,
1755 "actual parameter matches alias kind of formal parameter completely ",
1756 "Storage derivable from a parameter does not match the alias kind "
1757 "expected for the formal parameter.",
1761 FK_MEMORY, FK_DEF, modeFlag,
1764 "out storage not defined before return or scope exit",
1765 "An out parameter or global is not defined before control is transferred.",
1769 FK_MEMORY, FK_DEF, modeFlag,
1772 "at least one field of a union must be defined",
1773 "No field of a union is defined. Generally, one field of a union is "
1774 "expected to be defined.",
1778 FK_MEMORY, FK_IMPLICIT, modeFlag,
1781 "memory errors for unqualified storage",
1785 FK_MEMORY, FK_IMPLICIT, plainFlag,
1788 "assume unannotated parameter is temp",
1792 FK_MEMORY, FK_IMPLICIT, specialFlag,
1795 "sets globimponly, retimponly, structimponly, specglobimponly, "
1796 "specretimponly and specstructimponly",
1800 FK_MEMORY, FK_IMPLICIT, specialFlag,
1803 "sets globimponly, retimponly and structimponly",
1807 FK_MEMORY, FK_IMPLICIT, specialFlag,
1810 "sets specglobimponly, specretimponly and specstructimponly",
1814 FK_MEMORY, FK_IMPLICIT, plainFlag,
1817 "assume unannotated global storage is only",
1821 FK_MEMORY, FK_IMPLICIT, plainFlag,
1824 "assume unannotated returned storage is only",
1828 FK_MEMORY, FK_IMPLICIT, plainFlag,
1831 "assume unannotated structure field is only",
1835 FK_MEMORY, FK_IMPLICIT, plainFlag,
1837 FLG_SPECGLOBIMPONLY,
1838 "assume unannotated global storage is only",
1842 FK_MEMORY, FK_IMPLICIT, plainFlag,
1845 "assume unannotated returned storage is only",
1849 FK_MEMORY, FK_IMPLICIT, plainFlag,
1850 "specstructimponly",
1851 FLG_SPECSTRUCTIMPONLY,
1852 "assume unannotated structure field is only",
1856 FK_MEMORY, FK_ARRAY, modeFlag,
1859 "array elements are dependent storage",
1860 "When an element is fetched from an array, lclint analysis is "
1861 "not able to determine if the same element is reused. "
1862 "If +deparrays, lclint will mark local storage assigned from "
1863 "array fetches as dependent.",
1867 FK_MEMORY, FK_LEAK, modeFlag,
1870 "all only references derivable from void pointer out only parameter are released",
1871 "A storage leak due to incomplete deallocation of a structure or deep "
1872 "pointer is suspected. Unshared storage that is reachable from "
1873 "a reference that is being deallocated has not yet been deallocated. "
1874 "LCLint assumes when an object is passed "
1875 "as an out only void pointer that the outer object will be "
1876 "deallocated, but the inner objects will not.",
1880 FK_MEMORY, FK_LEAK, modeFlag,
1883 "report complete destruction errors for array elements that "
1884 "may have been released",
1889 FK_MEMORY, FK_LEAK, modeFlag,
1892 "only storage not released before return or scope exit",
1893 "A memory leak has been detected. Newly-allocated or "
1894 "only-qualified storage is not released before the last "
1895 "reference to it is lost.",
1899 FK_MEMORY, FK_NONE, modeFlag,
1902 "storage has inconsistent states of alternate paths through a branch",
1903 "The state of a variable is different depending on which branch "
1904 "is taken. This means no annotation can sensibly be applied "
1909 FK_MEMORY, FK_NONE, modeFlag,
1910 "strictbranchstate",
1911 FLG_STRICTBRANCHSTATE,
1912 "storage through array fetch has inconsistent states of alternate "
1913 "paths through a branch",
1914 "The state of a variable through an array fetch is different depending "
1915 "on which branch is taken. This means no annotation can sensibly be applied "
1920 FK_MEMORY, FK_NONE, specialFlag,
1923 "sets all dynamic memory checking flags (memimplicit, mustfree, mustdefine, "
1924 "mustnotalias, null, memtrans)",
1928 FK_MEMORY, FK_NONE, specialFlag,
1931 "memory transfer errors (sets all *trans flags)",
1932 "Memory is transferred in a way that violates annotations.",
1936 FK_MEMORY, FK_NONE, modeFlag,
1939 "exposure transfer errors",
1940 "Exposed storage is transferred to a non-exposed, non-observer reference.",
1944 FK_MEMORY, FK_NONE, modeFlag,
1947 "observer transfer errors",
1948 "Observer storage is transferred to a non-observer reference.",
1952 FK_MEMORY, FK_NONE, modeFlag,
1955 "dependent transfer errors",
1956 "Dependent storage is transferred to a non-dependent reference.",
1960 FK_MEMORY, FK_NONE, modeFlag,
1963 "new reference transfer to reference counted reference",
1964 "A new reference is transferred to a reference counted reference.",
1968 FK_MEMORY, FK_NONE, modeFlag,
1971 "only storage transferred to non-only reference (memory leak)",
1972 "The only reference to this storage is transferred to another "
1973 "reference (e.g., by returning it) that does not have the "
1974 "only annotation. This may lead to a memory leak, since the "
1975 "new reference is not necessarily released.",
1979 FK_MEMORY, FK_NONE, modeFlag,
1980 "onlyunqglobaltrans",
1981 FLG_ONLYUNQGLOBALTRANS,
1982 "only storage transferred to an unqualified global or "
1983 "static reference (memory leak)",
1984 "The only reference to this storage is transferred to another "
1985 "reference that does not have an aliasing annotation. "
1986 "This may lead to a memory leak, since the "
1987 "new reference is not necessarily released.",
1991 FK_MEMORY, FK_NONE, modeFlag,
1994 "owned storage transferred to non-owned reference (memory leak)",
1995 "The owned reference to this storage is transferred to another "
1996 "reference (e.g., by returning it) that does not have the "
1997 "owned annotation. This may lead to a memory leak, since the "
1998 "new reference is not necessarily released.",
2002 FK_MEMORY, FK_NONE, modeFlag,
2005 "fresh storage transferred to non-only reference (memory leak)",
2006 "Fresh storage (newly allocated in this function) is transferred "
2007 "in a way that the obligation to release storage is not "
2008 "propagated. Use the /*@only@*/ annotation to indicate "
2009 "the a return value is the only reference to the returned "
2014 FK_MEMORY, FK_NONE, modeFlag,
2017 "shared storage transferred to non-shared reference",
2018 "Shared storage is transferred to a non-shared reference. The other "
2019 "reference may release storage needed by this reference.",
2023 FK_MEMORY, FK_NONE, modeFlag,
2026 "temp storage transferred to non-temporary reference",
2027 "Temp storage (associated with a formal parameter) is transferred "
2028 "to a non-temporary reference. The storage may be released "
2029 "or new aliases created.",
2033 FK_MEMORY, FK_NONE, modeFlag,
2036 "kept storage transferred to non-temporary reference",
2037 "Kept storage is transferred "
2038 "to a non-temporary reference. The storage may be released "
2039 "or new aliases created.",
2043 FK_MEMORY, FK_NONE, modeFlag,
2046 "keep storage transferred inconsistently",
2047 "Keep storage is transferred inconsistently --- either in a way "
2048 "that may add a new alias to it, or release it.",
2052 FK_MEMORY, FK_NONE, modeFlag,
2055 "an immediate address (result of &) is transferred inconsistently",
2056 "An immediate address (result of & operator) is transferred "
2061 FK_MEMORY, FK_NONE, modeFlag,
2064 "reference counted storage is transferred in an inconsistent way",
2065 "Reference counted storage is transferred in a way that may not "
2066 "be consistent with the reference count.",
2070 FK_MEMORY, FK_NONE, modeFlag,
2073 "static storage is transferred in an inconsistent way",
2074 "Static storage is transferred in an inconsistent way.",
2078 FK_MEMORY, FK_NONE, modeFlag,
2081 "unqualified storage is transferred in an inconsistent way",
2082 "Unqualified storage is transferred in an inconsistent way.",
2086 FK_MEMORY, FK_NONE, modeFlag,
2088 FLG_STATICINITTRANS,
2089 "static storage is used as an initial value in an inconsistent way",
2090 "Static storage is used as an initial value in an inconsistent way.",
2094 FK_MEMORY, FK_NONE, modeFlag,
2095 "unqualifiedinittrans",
2096 FLG_UNKNOWNINITTRANS,
2097 "unqualified storage is used as an initial value in an inconsistent way",
2098 "Unqualified storage is used as an initial value in an inconsistent way.",
2102 FK_MEMORY, FK_NONE, modeFlag,
2104 FLG_READONLYSTRINGS,
2105 "string literals are read-only (error if one is modified or released)",
2106 "String literals are read-only (ANSI semantics). An error is reported "
2107 "if a string literal may be modified or released.",
2111 FK_MEMORY, FK_NONE, modeFlag,
2114 "report memory transfer errors for initializations to read-only string literals",
2115 "A read-only string literal is assigned to a non-observer reference.",
2119 FK_MEMORY, FK_PARAMS, modeFlag,
2122 "passing a value as an un-annotated parameter clears its annotation",
2126 FK_MODIFIES, FK_SPEC, plainFlag,
2129 "unspecified modification of caller-visible state",
2130 "An externally-visible object is modified by a function, but not "
2131 "listed in its modifies clause.",
2135 FK_MODIFIES, FK_SPEC, modeFlag,
2138 "specified modification is not detected",
2139 "An object listed in the modifies clause is not modified by the "
2140 "implementation of the function. The modification may not "
2141 "be detected if it is done through a call to an unspecified "
2146 FK_MODIFIES, FK_MEMORY, plainFlag,
2149 "possible modification of observer storage",
2150 "Storage declared with observer is possibly modified. Observer "
2151 "storage may not be modified.",
2155 FK_MODIFIES, FK_MEMORY, modeFlag,
2157 FLG_MODOBSERVERUNCON,
2158 "possible modification of observer storage through unconstrained call",
2159 "Storage declared with observer may be modified through a call to an "
2160 "unconstrained function.",
2164 FK_MODIFIES, FK_MEMORY, modeFlag,
2165 "modinternalstrict",
2166 FLG_MODINTERNALSTRICT,
2167 "possible modification of internal storage through function call",
2168 "A function that modifies internalState is called from a function that "
2169 "does not list internalState in its modifies clause",
2173 FK_MODIFIES, FK_UNSPEC, modeFlag,
2176 "report undocumented file system modifications (applies to unspecified "
2177 "functions if modnomods is set)",
2181 FK_MODIFIES, FK_UNSPEC, specialFlag,
2184 "modification in unspecified functions (sets modnomods, "
2185 "modglobunspec and modstrictglobsunspec)",
2189 FK_MODIFIES, FK_UNSPEC, modeFlag,
2192 "modification in a function with no modifies clause",
2193 "An externally-visible object is modified by a function with no "
2194 "/*@modifies@*/ comment. The /*@modifies ... @*/ control "
2195 "comment can be used to give a modifies list for an "
2196 "unspecified function.",
2200 FK_MODIFIES, FK_UNSPEC, modeFlag,
2203 "possible modification through a call to an unconstrained function",
2204 "An unconstrained function is called in a function body where "
2205 "modifications are checked. Since the unconstrained function "
2206 "may modify anything, there may be undetected modifications in "
2207 "the checked function.",
2211 FK_MODIFIES, FK_UNSPEC, modeFlag,
2214 "possible modification through a call to an unconstrained function in "
2215 "a function with no modifies clause",
2216 "An unconstrained function is called in a function body where "
2217 "modifications are checked. Since the unconstrained function "
2218 "may modify anything, there may be undetected modifications in "
2219 "the checked function.",
2223 FK_MODIFIES, FK_GLOBALS, modeFlag,
2224 "globsimpmodsnothing",
2225 FLG_GLOBALSIMPMODIFIESNOTHING,
2226 "functions declared with a globals list but no modifies clause are "
2227 "assumed to modify nothing",
2228 "An implicit modifies nothing clause is assumed for a function "
2229 "declared with a globals list but not modifies clause.",
2233 FK_MODIFIES, FK_GLOBALS, modeFlag,
2235 FLG_MODIFIESIMPNOGLOBALS,
2236 "functions declared with a modifies clause but no globals list "
2237 "are assumed to use no globals",
2238 "An implicit empty globals list is assumed for a function "
2239 "declared with a modifies clause but no globals list.",
2243 FK_NAMES, FK_ABSTRACT, plainFlag,
2246 "controls name checking without changing other settings",
2250 FK_NAMES, FK_ABSTRACT, specialFlag,
2253 "czech naming convention (sets accessczech, czechfunctions, czechvars, "
2254 "czechconstants, czechenums, and czechmacros)",
2255 "Name is not consistent with Czech naming convention.", 0, 0
2258 FK_NAMES, FK_ABSTRACT, plainFlag,
2261 "czech naming convention violated in a function or iterator declaration",
2262 "Function or iterator name is not consistent with Czech naming convention.", 0, 0
2265 FK_NAMES, FK_ABSTRACT, plainFlag,
2268 "czech naming convention violated in a variable declaration",
2269 "Variable name is not consistent with Czech naming convention.", 0, 0
2272 FK_NAMES, FK_ABSTRACT, plainFlag,
2275 "czech naming convention violated in an expanded macro name",
2276 "Expanded macro name is not consistent with Czech naming convention.", 0, 0
2279 FK_NAMES, FK_ABSTRACT, plainFlag,
2282 "czech naming convention violated in a constant declaration",
2283 "Constant name is not consistent with Czech naming convention.", 0, 0
2286 FK_NAMES, FK_ABSTRACT, plainFlag,
2289 "czech naming convention violated in a user-defined type definition",
2290 "Type name is not consistent with Czech naming convention. Czech type "
2291 "names must not use the underscore character.", 0, 0
2294 FK_NAMES, FK_ABSTRACT, specialFlag,
2297 "slovak naming convention violated",
2298 "Name is not consistent with Slovak naming convention.", 0, 0
2301 FK_NAMES, FK_ABSTRACT, plainFlag,
2303 FLG_SLOVAKFUNCTIONS,
2304 "slovak naming convention violated in a function or iterator declaration",
2305 "Function or iterator name is not consistent with Slovak naming convention.", 0, 0
2308 FK_NAMES, FK_ABSTRACT, plainFlag,
2311 "slovak naming convention violated in an expanded macro name",
2312 "Expanded macro name is not consistent with Slovak naming convention.", 0, 0
2315 FK_NAMES, FK_ABSTRACT, plainFlag,
2318 "slovak naming convention violated in a variable declaration",
2319 "Variable name is not consistent with Slovak naming convention.", 0, 0
2322 FK_NAMES, FK_ABSTRACT, plainFlag,
2324 FLG_SLOVAKCONSTANTS,
2325 "slovak naming convention violated in a constant declaration",
2326 "Constant name is not consistent with Slovak naming convention.", 0, 0
2329 FK_NAMES, FK_ABSTRACT, plainFlag,
2332 "slovak naming convention violated in a use-defined type definition",
2333 "Type name is not consistent with Slovak naming convention. Slovak type "
2334 "names may not include uppercase letters.", 0, 0
2337 FK_NAMES, FK_ABSTRACT, specialFlag,
2340 "czech or slovak naming convention violated",
2341 "Name is not consistent with either Czech or Slovak naming convention.", 0, 0
2344 FK_NAMES, FK_ABSTRACT, plainFlag,
2346 FLG_CZECHOSLOVAKFUNCTIONS,
2347 "czechoslovak naming convention violated in a function or iterator declaration",
2348 "Function name is not consistent with Czechoslovak naming convention.", 0, 0
2351 FK_NAMES, FK_ABSTRACT, plainFlag,
2352 "czechoslovakmacros",
2353 FLG_CZECHOSLOVAKMACROS,
2354 "czechoslovak naming convention violated in an expanded macro name",
2355 "Expanded macro name is not consistent with Czechoslovak naming convention.", 0, 0
2358 FK_NAMES, FK_ABSTRACT, plainFlag,
2360 FLG_CZECHOSLOVAKVARS,
2361 "czechoslovak naming convention violated in a variable declaration",
2362 "Variable name is not consistent with Czechoslovak naming convention.", 0, 0
2365 FK_NAMES, FK_ABSTRACT, plainFlag,
2366 "czechoslovakconsts",
2367 FLG_CZECHOSLOVAKCONSTANTS,
2368 "czechoslovak naming convention violated in a constant declaration",
2369 "Constant name is not consistent with Czechoslovak naming convention.", 0, 0
2372 FK_NAMES, FK_ABSTRACT, plainFlag,
2373 "czechoslovaktypes",
2374 FLG_CZECHOSLOVAKTYPES,
2375 "czechoslovak naming convention violated in a user-defined type definition",
2376 "Type name is not consistent with Czechoslovak naming convention. Czechoslovak "
2377 "type names may not include uppercase letters or the underscore character.", 0, 0
2380 FK_NAMES, FK_ANSI, modeFlag,
2383 "external name conflicts with name reserved for system or standard library",
2384 "External name is reserved for system in ANSI standard.",
2388 FK_NAMES, FK_ANSI, modeFlag,
2391 "external or internal name is a C++ keyword or reserved word",
2392 "External name is a C++ keyword or reserved word. "
2393 "This could lead to problems if the "
2394 "code is compiled with a C++ compiler.",
2398 FK_NAMES, FK_ANSI, modeFlag,
2399 "ansireservedinternal",
2400 FLG_ANSIRESERVEDLOCAL,
2401 "internal name conflicts with name reserved for system or standard library",
2402 "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).",
2406 FK_NAMES, FK_ANSI, plainFlag,
2407 "distinctexternalnames",
2408 FLG_DISTINCTEXTERNALNAMES,
2409 "external name is not distinguishable from another external name using "
2410 "the number of significant characters",
2411 "An external name is not distinguishable from another external name "
2412 "using the number of significant characters. According to "
2413 "ANSI Standard (3.1), an implementation may only consider the first 6 "
2414 "characters significant, and ignore alphabetical case "
2415 "distinctions. The "
2416 "+externalnamelen <n> flag may be used to change the number "
2417 "of significant characters, and -externalnamecaseinsensitive to make "
2418 "alphabetical case significant in external names.",
2422 FK_NAMES, FK_ANSI, specialValueFlag,
2424 FLG_EXTERNALNAMELEN,
2425 "set the number of significant characters in an external name",
2426 "Sets the number of significant characters in an external name (ANSI "
2427 "default is 6.) Sets +distinctexternalnames.",
2431 FK_NAMES, FK_ANSI, plainSpecialFlag,
2432 "externalnamecaseinsensitive",
2433 FLG_EXTERNALNAMECASEINSENSITIVE,
2434 "alphabetic comparisons for external names are case-insensitive",
2435 "Make alphabetic case insignificant in external names. By ANSI "
2436 "standard, case need not be significant in an external name. "
2437 "If +distinctexternalnames is not set, sets "
2438 "+distinctexternalnames with unlimited external name length.",
2442 FK_NAMES, FK_ANSI, plainFlag,
2443 "distinctinternalnames",
2444 FLG_DISTINCTINTERNALNAMES,
2445 "internal name is not distinguishable from another internal name using "
2446 "the number of significant characters",
2447 "An internal name is not distinguishable from another internal name "
2448 "using the number of significant characters. According to "
2449 "ANSI Standard (3.1), an implementation may only consider the first 31 "
2450 "characters significant. The "
2451 "+internalnamelen <n> flag changes the number "
2452 "of significant characters, -internalnamecaseinsensitive to makes "
2453 "alphabetical case significant, and "
2454 "+internalnamelookalike to make similar-looking characters "
2459 FK_NAMES, FK_ANSI, specialValueFlag,
2461 FLG_INTERNALNAMELEN,
2462 "set the number of significant characters in an internal name",
2463 "Sets the number of significant characters in an internal name (ANSI "
2464 "default is 31.) Sets +distinctinternalnames.",
2468 FK_NAMES, FK_ANSI, plainSpecialFlag,
2469 "internalnamecaseinsensitive",
2470 FLG_INTERNALNAMECASEINSENSITIVE,
2471 "set whether case is significant an internal names "
2472 "(-internalnamecaseinsensitive means case is significant)" ,
2473 "Set whether case is significant an internal names "
2474 "(-internalnamecaseinsensitive "
2475 "means case is significant). By ANSI default, case is not "
2476 "significant. If +distinctinternalnames is not set, sets "
2477 "+distinctinternalnames with unlimited internal name length.",
2481 FK_NAMES, FK_ANSI, plainSpecialFlag,
2482 "internalnamelookalike",
2483 FLG_INTERNALNAMELOOKALIKE,
2484 "lookalike characters match in internal names",
2485 "Set whether similar looking characters (e.g., \"1\" and \"l\") "
2486 "match in internal names.",
2490 FK_NAMES, FK_PREFIX, idemStringFlag,
2493 "set namespace prefix for variables declared in a macro body",
2494 "A variable declared in a macro body does not start with the macrovarprefix.",
2498 FK_NAMES, FK_PREFIX, plainFlag,
2499 "macrovarprefixexclude",
2500 FLG_MACROVARPREFIXEXCLUDE,
2501 "the macrovarprefix may not be used for non-macro variables",
2502 "A variable declared outside a macro body starts with the macrovarprefix.",
2506 FK_NAMES, FK_PREFIX, idemStringFlag,
2509 "set namespace prefix for struct, union and enum tags",
2510 "A tag identifier does not start with the tagprefix.",
2514 FK_NAMES, FK_PREFIX, plainFlag,
2516 FLG_TAGPREFIXEXCLUDE,
2517 "the tagprefix may not be used for non-tag identifiers",
2518 "An identifier that is not a tag starts with the tagprefix.",
2522 FK_NAMES, FK_PREFIX, idemStringFlag,
2525 "set namespace prefix for enum members",
2526 "An enum member does not start with the enumprefix.",
2530 FK_NAMES, FK_PREFIX, plainFlag,
2531 "enumprefixexclude",
2532 FLG_ENUMPREFIXEXCLUDE,
2533 "the enumprefix may not be used for non-enum member identifiers",
2534 "An identifier that is not an enum member starts with the enumprefix.",
2538 FK_NAMES, FK_PREFIX, idemStringFlag,
2540 FLG_FILESTATICPREFIX,
2541 "set namespace prefix for file static declarations",
2542 "A file-static identifier does not start with the filestaticprefix.",
2546 FK_NAMES, FK_PREFIX, plainFlag,
2547 "filestaticprefixexclude",
2548 FLG_FILESTATICPREFIXEXCLUDE,
2549 "the filestaticprefix may not be used for identifiers that are not file static",
2550 "An identifier that is not file static starts with the filestaticprefix.",
2554 FK_NAMES, FK_PREFIX, idemStringFlag,
2557 "set namespace prefix for global variables",
2558 "A global variable does not start with the globalprefix",
2562 FK_NAMES, FK_PREFIX, plainFlag,
2563 "globalprefixexclude",
2564 FLG_GLOBPREFIXEXCLUDE,
2565 "the globalprefix may not be used for non-global identifiers",
2566 "An identifier that is not a global variable starts with the globalprefix.",
2570 FK_NAMES, FK_PREFIX, idemStringFlag,
2573 "set namespace prefix for user-defined types",
2574 "A user-defined type does not start with the typeprefix",
2578 FK_NAMES, FK_PREFIX, plainFlag,
2579 "typeprefixexclude",
2580 FLG_TYPEPREFIXEXCLUDE,
2581 "the typeprefix may not be used for identifiers that are not type names",
2582 "An identifier that is not a type name starts with the typeprefix.",
2586 FK_NAMES, FK_PREFIX, idemStringFlag,
2589 "set namespace prefix for external identifiers",
2590 "An external identifier does not start with the externalprefix",
2594 FK_NAMES, FK_PREFIX, plainFlag,
2595 "externalprefixexclude",
2596 FLG_EXTERNALPREFIXEXCLUDE,
2597 "the externalprefix may not be used for non-external identifiers",
2598 "An identifier that is not external starts with the externalprefix.",
2602 FK_NAMES, FK_PREFIX, idemStringFlag,
2605 "set namespace prefix for local variables",
2606 "A local variable does not start with the localprefix",
2610 FK_NAMES, FK_PREFIX, plainFlag,
2611 "localprefixexclude",
2612 FLG_LOCALPREFIXEXCLUDE,
2613 "the localprefix may not be used for non-local identifiers",
2614 "An identifier that is not a local variable starts with the localprefix.",
2618 FK_NAMES, FK_PREFIX, idemStringFlag,
2619 "uncheckedmacroprefix",
2620 FLG_UNCHECKEDMACROPREFIX,
2621 "set namespace prefix for unchecked macros",
2622 "An unchecked macro name does not start with the uncheckedmacroprefix",
2626 FK_NAMES, FK_PREFIX, plainFlag,
2627 "uncheckedmacroprefixexclude",
2628 FLG_UNCHECKEDMACROPREFIXEXCLUDE,
2629 "the uncheckmacroprefix may not be used for identifiers that are not "
2631 "An identifier that is not the name of an unchecked macro "
2632 "starts with the uncheckedmacroprefix.",
2636 FK_NAMES, FK_PREFIX, idemStringFlag,
2639 "set namespace prefix for constants",
2640 "A constant does not start with the constantprefix",
2644 FK_NAMES, FK_PREFIX, plainFlag,
2645 "constprefixexclude",
2646 FLG_CONSTPREFIXEXCLUDE,
2647 "the constprefix may not be used for non-constant identifiers",
2648 "An identifier that is not a constant starts with the constantprefix.",
2652 FK_NAMES, FK_PREFIX, idemStringFlag,
2655 "set namespace prefix for iterators",
2656 "An iter does not start with the iterator prefix",
2660 FK_NAMES, FK_PREFIX, plainFlag,
2661 "iterprefixexclude",
2662 FLG_ITERPREFIXEXCLUDE,
2663 "the iterprefix may not be used for non-iter identifiers",
2664 "An identifier that is not a iter starts with the iterprefix.",
2668 FK_NAMES, FK_PREFIX, idemStringFlag,
2670 FLG_DECLPARAMPREFIX,
2671 "set namespace prefix for parameters in function prototype declarations",
2672 "A parameter name in a function prototype declaration does not start with the "
2673 "declaration parameter prefix",
2677 FK_NAMES, FK_PREFIX, modeFlag,
2680 "a parameter in a function prototype has a name",
2681 "A parameter in a function prototype has a name. This is dangerous, "
2682 "since a macro definition could be visible here.",
2686 FK_NAMES, FK_PREFIX, modeFlag,
2689 "the name of a parameter in a function prototype and corresponding "
2690 "declaration must match (after removing the protoparamprefix",
2691 "A parameter in a function definition does not have the same name as "
2692 "the corresponding in the declaration of the function after "
2693 "removing the protoparamprefix",
2697 FK_NAMES, FK_PREFIX, plainFlag,
2698 "protoparamprefixexclude",
2699 FLG_DECLPARAMPREFIXEXCLUDE,
2700 "the protoparamprefix may not be used for non-declaraction parameter identifiers",
2701 "An identifier that is not a parameter name in a function prototype "
2702 "starts with the protoparamprefix.",
2706 FK_LIMITS, FK_ANSI, modeValueFlag,
2708 FLG_CONTROLNESTDEPTH,
2709 "set maximum nesting depth of compound statements, iteration control "
2710 "structures, and selection control structures (ANSI minimum is 15)",
2711 "Maximum number of control levels exceeded.",
2715 FK_LIMITS, FK_ANSI, modeValueFlag,
2717 FLG_STRINGLITERALLEN,
2718 "set maximum length of string literals (ANSI minimum is 509)",
2719 "Maximum length of string literal exceeded.",
2723 FK_LIMITS, FK_ANSI, modeValueFlag,
2725 FLG_NUMSTRUCTFIELDS,
2726 "set maximum number of fields in a struct or union (ANSI minimum is 127)",
2727 "Maximum number of fields in a struct or union exceeded.",
2731 FK_LIMITS, FK_ANSI, modeValueFlag,
2734 "set maximum number of members of an enum (ANSI minimum is 127)",
2735 "Limit on maximum number of members of an enum is exceeded.",
2739 FK_LIMITS, FK_ANSI, modeValueFlag,
2742 "set maximum number of nested #include files",
2743 "Maximum number of nested #include files exceeded.",
2747 FK_LIMITS, FK_ANSI, specialFlag,
2750 "check for violations of standard limits (controlnestdepth, "
2751 "stringliterallen, includenest, numstructfields, numenummembers)",
2756 FK_NAMES, FK_NONE, plainFlag,
2760 "Naming convention is violated.",
2764 FK_NONE, FK_NONE, plainFlag,
2771 FK_NULL, FK_MEMORY, specialFlag,
2774 "misuses of null pointer",
2775 "A possibly null pointer is misused (sets nullderef, nullpass, "
2776 "nullref, nullassign, and nullstate).",
2780 FK_NT, FK_MEMORY, modeFlag,
2783 "misuse of nullterminated allocation",
2784 "A possibly non-nullterminated string/memory is used/referenced as a nullterminated one, ",
2788 FK_NT, FK_MEMORY, modeFlag,
2791 "possible out of bounds read",
2792 "An array or pointer access references memory beyond the array or buffer, ",
2796 FK_NT, FK_MEMORY, modeFlag,
2799 "possible buffer overflow from an out of bounds write",
2800 "Memory is set past the end of an array or or after the allocated buffer, ",
2805 FK_NT, FK_MEMORY, modeFlag,
2808 "Function has the post condition",
2809 "LCLint has determined that the following statement is true after the function, ",
2813 FK_NT, FK_MEMORY, modeFlag,
2814 "debugfcnconstraint",
2815 FLG_DEBUGFUNCTIONCONSTRAINT,
2816 "debuging constraint flas",
2817 "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. ",
2821 FK_NT, FK_MEMORY, modeFlag,
2823 FLG_FUNCTIONCONSTRAINT,
2824 "unresolved constraint",
2825 "LCLint was unable to resolve a constraint at the top of the function. If code is correct consider using explict annotation assertions, ",
2828 /*drl7x added 6/18/01 */
2830 FK_NT, FK_MEMORY, modeFlag,
2833 "unable to verify ensures annotation",
2834 "LCLint was unable to determine that the function satisfies a post condition given in an ensures annotation, ",
2839 FK_NT, FK_MEMORY, modeFlag,
2840 "constraintlocation",
2841 FLG_CONSTRAINTLOCATION,
2842 "display full c expression for every constraint generated",
2845 },/*drl added flag 4/26/01*/
2847 FK_NT, FK_MEMORY, modeFlag,
2848 "implictconstraint",
2849 FLG_IMPLICTCONSTRAINT,
2850 "Try to generate implicit constraints for functions",
2854 /*drl7x added 4/29/01 */
2856 FK_NT, FK_MEMORY, modeFlag,
2859 "Use limited OR expressions to resolve constraints",
2865 FK_NT, FK_MEMORY, modeFlag,
2867 FLG_NULLTERMINATEDWARNING,
2868 "misuse of nullterminated allocation",
2869 "WARNING:A user annotated non-nullterminated buffer is used/referenced as a nullterminated one, ",
2873 FK_NULL, FK_MEMORY, modeFlag,
2876 "possible dereferencce of null pointer",
2877 "A possibly null pointer is dereferenced. Value is "
2878 "either the result of a function which may return null "
2879 "(in which case, code should check it is not null), or a "
2880 "global, parameter or structure field declared with the "
2885 FK_TYPE, FK_NONE, modeFlag,
2888 "dereferencce of a function type",
2889 "A function type is dereferenced. The ANSI standard allows this "
2890 "because of implicit conversion of function designators, however the "
2891 "dereference is unnecessary.",
2895 FK_NULL, FK_MEMORY, modeFlag,
2898 "possibly null pointer passed as formal with no null annotation",
2899 "A possibly null pointer is passed as a parameter corresponding to "
2900 "a formal parameter with no /*@null@*/ annotation. If NULL "
2901 "may be used for this parameter, add a /*@null@*/ annotation "
2902 "to the function parameter declaration.",
2906 FK_NULL, FK_MEMORY, modeFlag,
2909 "possibly null pointer returned as result with no null annotation",
2910 "Function returns a possibly null pointer, but is not declared "
2911 "using /*@null@*/ annotation of result. If function may "
2912 "return NULL, add /*@null@*/ annotation to the return "
2913 "value declaration.",
2917 FK_NULL, FK_MEMORY, modeFlag,
2920 "possibly null pointer reachable from a reference with no null annotation",
2921 "A possibly null pointer is reachable from a parameter or global "
2922 "variable that is not declared using a /*@null@*/ annotation.",
2926 FK_NULL, FK_MEMORY, modeFlag,
2929 "inconsistent assignment or initialization involving null pointer",
2930 "A reference with no null annotation is assigned or initialized "
2931 "to NULL. Use /*@null@*/ to declare the reference as "
2932 "a possibly null pointer.",
2936 FK_OPS, FK_BOOL, modeFlag,
2939 "comparison between bools (dangerous because of multiple TRUE values)",
2940 "Two bool values are compared directly using a C primitive. This "
2941 "may produce unexpected results since all non-zero values are "
2942 "considered TRUE, so different TRUE values may not be equal. "
2943 "The file bool.h (included in lclint/lib) provides bool_equal "
2944 "for safe bool comparisons.", 0, 0
2947 FK_OPS, FK_NONE, modeFlag,
2950 "dangerous comparison between reals (dangerous because of inexact "
2951 "floating point representations)",
2952 "Two real (float, double, or long double) values are compared "
2953 "directly using a C primitive. "
2954 "This may produce unexpected results since floating point "
2955 "representations are inexact. Instead, compare the difference to "
2956 "FLT_EPSILON or DBL_EPSILON.",
2960 FK_OPS, FK_POINTER, modeFlag,
2963 "arithmetic involving pointer and integer",
2964 "Pointer arithmetic using pointer and integer.", 0, 0
2967 FK_OPS, FK_POINTER, modeFlag,
2969 FLG_NULLPOINTERARITH,
2970 "arithmetic involving possibly null pointer and integer",
2971 "Pointer arithmetic using a possibly null pointer and integer.", 0, 0
2974 FK_OPS, FK_POINTER, modeFlag,
2977 "comparison between pointer and number",
2978 "A pointer is compared to a number.", 0, 0
2981 FK_OPS, FK_TYPE, modeFlag,
2984 "primitive operation does not type check strictly",
2985 "A primitive operation does not type check strictly.", 0, 0
2988 FK_OPS, FK_TYPE, modeFlag,
2991 "a bitwise logical operator does not have unsigned operands",
2992 "An operand to a bitwise operator is not an unsigned values. This "
2993 "may have unexpected results depending on the signed "
2994 "representations.", 0, 0
2997 FK_OPS, FK_TYPE, modeFlag,
3000 "a shift operator does not have unsigned operands",
3001 "An operand to a shift operator is not unsigned values. This "
3002 "may have unexpected results depending on the signed "
3003 "representations.", 0, 0
3006 FK_OPS, FK_BOOL, modeFlag,
3009 "primitive operation (!, && or ||) does not has a boolean argument",
3010 "The operand of a boolean operator is not a boolean. Use +ptrnegate "
3011 "to allow ! to be used on pointers.",
3015 FK_OPS, FK_POINTER, modeFlag,
3018 "allow ! to be used on pointer operand",
3019 "The operand of ! operator is a pointer.", 0, 0
3022 FK_OPS, FK_TYPE, modeFlag,
3025 "sizeof operator has a type argument",
3026 "Operand of sizeof operator is a type. (Safer to use expression, "
3027 "int *x = sizeof (*x); instead of sizeof (int).)",
3031 FK_OPS, FK_TYPE, plainFlag,
3032 "sizeofformalarray",
3033 FLG_SIZEOFFORMALARRAY,
3034 "sizeof operator has an array formal parameter argument",
3035 "Operand of a sizeof operator is a function parameter declared as "
3036 "an array. The value of sizeof will be the size of a pointer to the "
3037 "element type, not the number of elements in the array.",
3041 FK_DECL, FK_TYPE, plainFlag,
3043 FLG_FIXEDFORMALARRAY,
3044 "formal parameter of type array is declared with size",
3045 "A formal parameter is declared as an array with size. The size of the array "
3046 "is ignored in this context, since the array formal parameter is treated "
3051 FK_DECL, FK_TYPE, plainFlag,
3054 "formal parameter has an incomplete type",
3055 "A formal parameter is declared with an incomplete type.",
3059 FK_DECL, FK_TYPE, plainFlag,
3062 "formal parameter is an array",
3063 "A formal parameter is declared as an array. This can be confusing, since "
3064 "a formal array parameter is treated as a pointer.",
3068 FK_PRED, FK_BOOL, plainFlag,
3071 "condition test (if, while or for) is an assignment",
3072 "The condition test is an assignment expression. Probably, you mean "
3073 "to use == instead of =. If an assignment is intended, add an "
3074 "extra parentheses nesting (e.g., if ((a = b)) ...) to suppress "
3079 FK_PRED, FK_BOOL, specialFlag,
3082 "type of condition test (if, while or for) not bool (sets predboolint, "
3083 "predboolptr and predboolothers)",
3084 "Test expression type is not boolean.", 0, 0
3087 FK_PRED, FK_BOOL, modeFlag,
3090 "type of condition test (if, while or for) is an integral type",
3091 "Test expression type is not boolean or int.", 0, 0
3094 FK_PRED, FK_BOOL, modeFlag,
3097 "type of condition test (if, while or for) not bool, int or pointer",
3098 "Test expression type is not boolean.", 0, 0
3101 FK_PRED, FK_BOOL, modeFlag,
3104 "type of condition test (if, while or for) is a pointer",
3105 "Test expression type is not boolean.", 0, 0
3108 FK_PREPROC, FK_NONE, globalExtraArgFlag,
3111 "passed to pre-processor",
3115 FK_PREPROC, FK_NONE, globalExtraArgFlag,
3118 "passed to pre-processor",
3122 FK_GLOBALS, FK_NONE, modeFlag,
3125 "returns with global in inconsistent state (null or undefined)",
3126 "A global variable does not satisfy its annotations when control is transferred.",
3130 FK_SUPPRESS, FK_COMMENTS, globalFlag,
3133 "The number of errors detected does not match number in /*@i<n>@*/.",
3137 FK_SUPPRESS, FK_ERRORS, valueFlag,
3140 "limit <int> consecutive repeated errors",
3144 FK_SYNTAX, FK_NONE, plainFlag,
3147 "syntax error in parsing",
3148 "Code cannot be parsed. For help on parse errors, see lclint -help parseerrors.",
3152 FK_SYNTAX, FK_NONE, plainFlag,
3155 "try to recover from parse error",
3156 "Try to recover from parse error. It really means try --- this doesn't usually work.", 0, 0
3159 FK_SYNTAX, FK_PREPROC, plainFlag,
3166 FK_TYPE, FK_NONE, plainFlag,
3170 "Types are incompatible.",
3174 FK_TYPE, FK_NONE, plainFlag,
3177 "initializer sets all fields",
3178 "Initializer does not set every field in the structure.",
3182 FK_TYPE, FK_NONE, modeFlag,
3185 "enum members must be int values",
3186 "Type of initial values for enum members must be int.",
3191 FK_TYPE, FK_NONE, plainFlag,
3194 "type of main does not match expected type",
3195 "The function main does not match the expected type.",
3199 FK_TYPE, FK_NONE, plainFlag,
3202 "type-mismatch in parameter corresponding to format code in a printf or scanf-like function",
3203 "Type of parameter is not consistent with corresponding code in format string.",
3207 FK_TYPE, FK_NONE, modeFlag,
3210 "format parameter is not a string constant (hence variable arguments cannot be typechecked)",
3211 "Format parameter is not known at compile-time. This can lead to security vulnerabilities because the arguments cannot be type checked.",
3215 FK_TYPE, FK_NONE, plainFlag,
3218 "invalid format code in format string for printf or scanf-like function",
3219 "Format code in a format string is not valid.",
3223 FK_TYPEEQ, FK_ABSTRACT, modeFlag,
3226 "forward declarations of pointers to abstract representation match abstract type",
3230 FK_TYPEEQ, FK_ABSTRACT, modeFlag,
3233 "void * matches pointers to abstract types, casting ok (dangerous)",
3234 "A pointer to void is cast to a pointer to an abstract type (or vice versa).",
3238 FK_TYPEEQ, FK_POINTER, plainFlag,
3241 "a pointer to a function is cast to a pointer to void (or vice versa)",
3242 "A pointer to a function is cast to (or used as) a pointer to void (or vice versa).",
3246 FK_TYPEEQ, FK_ARRAY, modeFlag,
3249 "char can be used to index arrays",
3250 "To allow char types to index arrays, use +charindex.", 0, 0
3253 FK_TYPEEQ, FK_ARRAY, modeFlag,
3256 "enum can be used to index arrays",
3257 "To allow enum types to index arrays, use +enumindex.", 0, 0
3260 FK_TYPEEQ, FK_BOOL, modeFlag,
3263 "bool and int are equivalent",
3264 "To make bool and int types equivalent, use +boolint.",
3268 FK_TYPEEQ, FK_NONE, modeFlag,
3271 "char and int are equivalent",
3272 "To make char and int types equivalent, use +charint.",
3276 FK_TYPEEQ, FK_NONE, modeFlag,
3279 "enum and int are equivalent",
3280 "To make enum and int types equivalent, use +enumint.",
3284 FK_TYPEEQ, FK_NONE, modeFlag,
3287 "float and double are equivalent",
3288 "To make float and double types equivalent, use +floatdouble.",
3292 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3295 "ignore type qualifiers (long, short, unsigned)",
3296 "To ignore type qualifiers in type comparisons use +ignorequals.",
3300 FK_TYPEEQ, FK_SYNTAX, plainFlag,
3303 "report duplicate type qualifiers (e.g., long long)",
3304 "Duplicate type qualifiers not supported by ANSI. Some "
3305 "compilers (e.g., gcc) do support duplicate qualifiers.",
3309 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3312 "ignore signs in type comparisons (unsigned matches signed)",
3313 "To ignore signs in type comparisons use +ignoresigns",
3317 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3320 "int literals can be reals",
3321 "An int literal is used as any numeric type (including float and long long). Use +numliteral to "
3322 "allow int literals to be used as any numeric type.",
3326 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3329 "character constants (e.g., 'a') can be used as ints",
3330 "A character constant is used as an int. Use +charintliteral to "
3331 "allow character constants to be used as ints. (This is safe "
3332 "since the actual type of a char constant is int.)",
3336 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3339 "report qualifier mismatches only if dangerous",
3340 "To allow qualifier mismatches that are not dangerous, use +relaxquals.", 0, 0
3343 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3346 "allow all numeric types to match",
3347 "To allow all numeric types to match, use +relaxtypes.", 0, 0
3350 FK_TYPEEQ, FK_NONE, modeFlag,
3352 FLG_CHARUNSIGNEDCHAR,
3353 "allow char and unsigned char types to match",
3354 "To allow char and unsigned char types to match use +charunsignedchar.",
3358 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3360 FLG_MATCHANYINTEGRAL,
3361 "allow any intergral type to match an arbitrary integral type (e.g., dev_t)",
3362 "To allow arbitrary integral types to match any integral type, use +matchanyintegral.",
3366 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3367 "longunsignedintegral",
3368 FLG_LONGUNSIGNEDINTEGRAL,
3369 "allow long unsigned type to match an arbitrary integral type (e.g., dev_t)",
3370 "To allow arbitrary integral types to match long unsigned, use +longunsignedintegral.",
3374 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3377 "allow long type to match an arbitrary integral type (e.g., dev_t)",
3378 "To allow arbitrary integral types to match long unsigned, use +longintegral.",
3382 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3383 "longunsignedunsignedintegral",
3384 FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL,
3385 "allow long unsigned type to match an arbitrary unsigned integral type (e.g., size_t)",
3386 "To allow arbitrary unsigned integral types to match long unsigned, "
3387 "use +longunsignedunsignedintegral.",
3391 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3392 "longsignedintegral",
3393 FLG_LONGSIGNEDINTEGRAL,
3394 "allow long type to match an arbitrary signed integral type (e.g., ssize_t)",
3395 "To allow arbitrary signed integral types to match long unsigned, use +longsignedintegral.",
3399 FK_TYPEEQ, FK_POINTER, plainFlag,
3402 "0 is treated as a pointer",
3406 FK_TYPEEQ, FK_BOOL, modeFlag,
3409 "0 is treated as a boolean",
3413 FK_UNRECOG, FK_DISPLAY, plainFlag,
3416 "do not suppress repeated unrecognized identifier messages (instead of only reporting the first error)",
3417 "Identifier used in code has not been declared. (Message repeated for future uses in this file.)",
3421 FK_UNRECOG, FK_DISPLAY, plainFlag,
3424 "report unrecognized identifiers with system (__) prefix",
3425 "Identifier used in code has not been declared. (Message repeated for "
3426 "future uses in this file.) Use +gnuextensions to make lclint "
3427 "recognize some keywords that are gnu extensions.",
3431 FK_UNRECOG, FK_NONE, plainFlag,
3434 "unrecognized identifier",
3435 "Identifier used in code has not been declared.", 0, 0
3438 FK_USE, FK_COMPLETE, modeFlag,
3441 "declaration at top level not used",
3442 "An external declaration not used in any source file.", 0, 0
3445 FK_USE, FK_EXPORT, modeFlag,
3448 "a declaration is exported but not used outside this module",
3449 "A declaration is exported, but not used outside this module. "
3450 "Declaration can use static qualifier.",
3454 FK_USE, FK_EXPORT, modeFlag,
3457 "a declaration is exported but does not appear in a header file",
3458 "A declaration is exported, but does not appear in a header file.",
3462 FK_USE, FK_EXPORT, modeFlag,
3464 FLG_EXPORTHEADERVAR,
3465 "a variable declaration is exported but does not appear in a header file",
3466 "A variable declaration is exported, but does not appear in a header "
3467 "file. (Used with exportheader.)",
3471 FK_USE, FK_NONE, modeFlag,
3474 "field of structure type not used",
3475 "A field is present in a structure type but never used. Use /*@unused@*/ in front of field declaration to suppress message.",
3479 FK_USE, FK_NONE, modeFlag,
3482 "member of an enum type not used",
3483 "A member of an enum type is never used.",
3487 FK_USE, FK_NONE, modeFlag,
3490 "constant declared but not used",
3491 "A constant is declared but not used. Use unused in the constant declaration to suppress message.",
3495 FK_USE, FK_NONE, modeFlag,
3498 "function declared but not used",
3499 "A function is declared but not used. Use /*@unused@*/ in front of function header to suppress message.",
3503 FK_USE, FK_PARAMS, modeFlag,
3506 "function parameter not used ",
3507 "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.",
3511 FK_USE, FK_TYPE, modeFlag,
3514 "type declared but not used",
3515 "A type is declared but not used. Use /*@unused@*/ in front of typedef to suppress messages.",
3519 FK_USE, FK_NONE, modeFlag,
3522 "variable declared but not used",
3523 "A variable is declared but never used. Use /*@unused@*/ in front "
3524 "of declaration to suppress message.",
3528 FK_USE, FK_COMPLETE, modeFlag,
3531 "unused declaration in special file (corresponding to .l or .y file)",
3535 FK_DECL, FK_TYPE, modeFlag,
3536 "redundantsharequal",
3537 FLG_REDUNDANTSHAREQUAL,
3538 "declaration uses observer qualifier that is always true",
3539 "A declaration of an immutable object uses a redundant observer qualifier.",
3543 FK_DECL, FK_TYPE, modeFlag,
3544 "misplacedsharequal",
3545 FLG_MISPLACEDSHAREQUAL,
3546 "declaration of unsharable storage uses sharing annotation",
3547 "A declaration of an unsharable object uses a sharing annotation.",
3551 FK_DECL, FK_TYPE, plainFlag,
3553 FLG_ANNOTATIONERROR,
3554 "annotation is used in inconsistent location",
3555 "A declaration uses an invalid annotation.",
3559 FK_DECL, FK_TYPE, plainFlag,
3562 "inconsistent syntactic comment",
3563 "A syntactic comment is used inconsistently.",
3567 FK_DEBUG, FK_NONE, debugFlag,
3574 FK_DEBUG, FK_NONE, valueFlag,
3577 "set maximum number of bugs detected before giving up",
3582 FK_HELP, FK_NONE, plainFlag,
3585 "warn when command line file does not have a recognized extension",
3589 FK_DECL, FK_NONE, plainFlag,
3592 "warn when declaration marked with warn is used",
3593 "Declaration marked with warn clause is used (can be suppresed by more specific flags).",
3597 FK_MEMORY, FK_DEF, modeFlag,
3600 "storage has been transfered with invalid state",
3601 "Transfer violates user-defined state rules.",
3605 FK_MEMORY, FK_DEF, modeFlag,
3608 "control paths merge with storage in incompatible states",
3609 "Control path merge violates user-defined state merge rules.",
3614 ** The its4 level flags must appear in order.
3618 FK_WARNUSE, FK_SECURITY, specialFlag,
3621 "most risky security vulnerabilities (from its4 database)",
3622 "Security vulnerability classified as most risky in its4 database.",
3626 FK_WARNUSE, FK_SECURITY, specialFlag,
3629 "very risky security vulnerabilities (from its4 database)",
3630 "Security vulnerability classified as very risky in its4 database.",
3634 FK_WARNUSE, FK_SECURITY, specialFlag,
3637 "risky security vulnerabilities (from its4 database)",
3638 "Security vulnerability classified as risky in its4 database.",
3642 FK_WARNUSE, FK_SECURITY, specialFlag,
3644 FLG_ITS4MODERATERISK,
3645 "moderately risky security vulnerabilities (from its4 database)",
3646 "Security vulnerability classified as moderate risk in its4 database.",
3650 FK_WARNUSE, FK_SECURITY, specialFlag,
3653 "risky security vulnerabilities (from its4 database)",
3654 "Security vulnerability classified as risky in its4 database.",
3659 ** End of its4 level flags
3663 FK_WARNUSE, FK_SECURITY, modeFlag,
3664 "bufferoverflowhigh",
3665 FLG_BUFFEROVERFLOWHIGH,
3666 "likely buffer overflow vulnerability",
3667 "Use of function that may lead to buffer overflow.",
3671 FK_WARNUSE, FK_SECURITY, modeFlag,
3674 "possible buffer overflow vulnerability",
3675 "Use of function that may lead to buffer overflow.",
3679 FK_WARNUSE, FK_SECURITY, modeFlag,
3682 "possible time of check, time of use vulnerability",
3683 "Possible time of check, time of use vulnerability.",
3687 FK_WARNUSE, FK_SECURITY, modeFlag,
3690 "function is not reentrant",
3691 "Non-reentrant function should not be used in multithreaded code.",
3695 FK_WARNUSE, FK_SECURITY, modeFlag,
3698 "function is restricted to superusers",
3699 "Call to function restricted to superusers.",