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 specialDebugFlag TRUE, TRUE, FALSE, FALSE, ARG_NONE
32 # define globalFlag FALSE, FALSE, TRUE, FALSE, ARG_NONE
34 # define idemGlobalFlag FALSE, TRUE, TRUE, FALSE, ARG_NONE
36 # define globalValueFlag FALSE, FALSE, TRUE, FALSE, ARG_VALUE
38 # define regStringFlag FALSE, FALSE, FALSE, FALSE, ARG_STRING
40 # define idemStringFlag FALSE, TRUE, FALSE, FALSE, ARG_STRING
42 # define globalStringFlag FALSE, FALSE, TRUE, FALSE, ARG_STRING
44 # define extraArgFlag FALSE, FALSE, FALSE, FALSE, ARG_SPECIAL
46 # define globalExtraArgFlag FALSE, FALSE, TRUE, FALSE, ARG_SPECIAL
50 ** Note: the flag code must be on a separate line, since I'm
51 ** too stupid to write an awk/sed/whatever script that can separate
55 static flaglist flags = {
58 FK_ABSTRACT, FK_BOOL, plainFlag,
60 F*//*Hide flag from makefile grep*//*LG_ABSTRACTBOOL,
61 "boolean type is abstract",
66 FK_BOOL, FK_HELP, plainFlag,
69 "type name is probably a boolean type but does not match default "
70 "boolean type name, \"bool\", and alternate name is not set",
71 "Use the -booltype, -boolfalse and -booltrue flags to change the "
72 "name of the default boolean type.",
76 FK_ABSTRACT, FK_IMPLICIT, plainFlag,
79 "assume user type definitions are abstract (unless /*@concrete@*/ is used)",
84 FK_ABSTRACT, FK_NAMES, specialFlag,
87 "set accessmodule, accessfile and accessczech",
88 "Sets accessmodule, accessfile and accessczech",
92 FK_ABSTRACT, FK_NAMES, plainFlag,
95 "allow access to abstract types in definition module",
96 "The representation of an abstract type defined in <M>.<x> is "
97 "accessible anywhere in a file named <M>.<y>.",
101 FK_ABSTRACT, FK_NAMES, plainFlag,
104 "allow access to abstract types by file name convention",
105 "The representation of an abstract type named <t> is "
106 "accessible anywhere in a file named <t>.<x>.",
110 FK_ABSTRACT, FK_NAMES, plainFlag,
113 "allow access to abstract types by czech naming convention",
114 "The representation of an abstract type named <t> is accessible "
115 "in the definition of a function or constant named <t>_<name>",
119 FK_ABSTRACT, FK_NAMES, plainFlag,
122 "allow access to abstract types by slovak naming convention",
123 "The representation of an abstract type named <t> is accessible "
124 "in the definition of a function or constant named <t><Name>",
128 FK_ABSTRACT, FK_NAMES, plainFlag,
129 "accessczechoslovak",
130 FLG_ACCESSCZECHOSLOVAK,
131 "allow access to abstract types by czechoslovak naming convention",
132 "The representation of an abstract type named <t> is accessible "
133 "in the definition of a function or constant named <t>_<name> or <t><Name>",
137 FK_ABSTRACT, FK_NONE, plainFlag,
140 "data abstraction barriers",
141 "An abstraction barrier is broken. If necessary, use /*@access <type>@*/ to allow access to an abstract type.",
145 FK_ABSTRACT, FK_NONE, modeFlag,
148 "representation of mutable type has sharing semantics",
149 "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.",
153 FK_ALIAS, FK_GLOBALS, specialFlag,
156 "function returns with global aliasing external state (sets "
157 "checkstrictglobalias, checkedglobalias, checkmodglobalias and "
158 "uncheckedglobalias)",
159 "A global variable aliases externally-visible state when the function returns.",
163 FK_ALIAS, FK_GLOBALS, modeFlag,
164 "checkstrictglobalias",
165 FLG_CHECKSTRICTGLOBALIAS,
166 "function returns with a checkstrict global aliasing external state",
167 "A global variable aliases externally-visible state when the function returns.",
171 FK_ALIAS, FK_GLOBALS, modeFlag,
173 FLG_CHECKEDGLOBALIAS,
174 "function returns with a checked global aliasing external state",
175 "A global variable aliases externally-visible state when the function returns.",
179 FK_ALIAS, FK_GLOBALS, modeFlag,
181 FLG_CHECKMODGLOBALIAS,
182 "function returns with a checkmod global aliasing external state",
183 "A global variable aliases externally-visible state when the function returns.",
187 FK_ALIAS, FK_GLOBALS, modeFlag,
188 "uncheckedglobalias",
189 FLG_UNCHECKEDGLOBALIAS,
190 "function returns with an unchecked global aliasing external state",
191 "A global variable aliases externally-visible state when the function returns.",
195 FK_ALIAS, FK_MEMORY, modeFlag,
198 "unique parameter is aliased",
199 "A unique or only parameter is aliased by some other parameter or visible global.",
203 FK_ALIAS, FK_MEMORY, modeFlag,
206 "unique parameter may be aliased",
207 "A unique or only parameter may be aliased by some other parameter or visible global.",
211 FK_ALIAS, FK_MEMORY, modeFlag,
214 "temp storage aliased at return point or scope exit",
215 "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.",
219 FK_ALIAS, FK_NONE, modeFlag,
222 "function returns alias to parameter or global",
223 "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
226 FK_ANSI, FK_PROTOS, modeFlag,
229 "function declaration has no parameter list",
230 "A function declaration does not have a parameter list.",
234 FK_ANSI, FK_PROTOS, modeFlag,
237 "old style function definition",
238 "Function definition is in old style syntax. Standard prototype "
239 "syntax is preferred.",
243 FK_ANSI, FK_SYNTAX, plainFlag,
246 "support some gnu (gcc) language extensions",
250 FK_ANSI, FK_NONE, plainFlag,
253 "non-standard <varargs.h> included",
254 "Header <varargs.h> is not part of ANSI Standard. "
255 "Should use <stdarg.h> instead.",
259 FK_ANSI, FK_LIBS, plainFlag,
262 "a POSIX header is included, but the POSIX library is not used",
263 "Header name matches a POSIX header, but the POSIX library is not selected.",
267 FK_BEHAVIOR, FK_ANSI, modeFlag,
270 "argument to exit has implementation defined behavior",
271 "The argument to exit should be 0, EXIT_SUCCESS or EXIT_FAILURE",
275 FK_BEHAVIOR, FK_ANSI, modeFlag,
278 "code has unspecified or implementation-dependent behavior "
279 "because of order of evaluation",
280 "Code has unspecified behavior. "
281 "Order of evaluation of function parameters or subexpressions "
282 "is not defined, so if a value is used and modified in different "
283 "places not separated by a sequence point constraining "
284 "evaluation order, then the result of the expression is "
289 FK_BEHAVIOR, FK_ANSI, modeFlag,
292 "code involving call to unspecified function has undefined or implementation-dependent behavior",
293 "Code involving a call to function with no modifies or globals clause "
294 "may have undefined or implementation-dependent behavior (LCLint assumes the "
295 "unconstrained call may modify any reachable state or use any global). Add a "
296 "specification for the function.",
300 FK_BOOL, FK_NONE, regStringFlag,
303 "set name of boolean false (default FALSE)",
307 FK_BOOL, FK_NONE, regStringFlag,
310 "set name of boolean type (default bool)",
314 FK_BOOL, FK_NONE, regStringFlag,
317 "set name of boolean true (default TRUE)",
321 FK_COMMENTS, FK_ABSTRACT, plainFlag,
324 "ignore access comments",
328 FK_COMMENTS, FK_SUPPRESS, plainFlag,
331 "ignore all stylized comments",
335 FK_COMMENTS, FK_SYNTAX, plainFlag,
338 "stylized comment is unrecognized",
339 "Word after a stylized comment marker does not correspond to a "
344 FK_COMMENTS, FK_SYNTAX, plainFlag,
347 "line continuation marker (\\) in comment before */ on same line",
348 "A line continuation marker (\\) appears inside a comment on the same "
349 "line as the comment close. Preprocessors should handle this "
350 "correctly, but it causes problems for some preprocessors.",
354 FK_COMMENTS, FK_SYNTAX, plainFlag,
357 "comment begins inside comment",
358 "A comment open sequence (/*) appears within a comment. This usually "
359 "means an earlier comment was not closed.",
363 FK_COMMENTS, FK_SUPPRESS, modeFlag,
366 "interpret t comments (ignore errors in lines marked with /*@t<n>@*/",
370 FK_COMMENTS, FK_SUPPRESS, plainFlag,
373 "interpret traditional lint comments (/*FALLTHROUGH*/, /*NOTREACHED*/)",
377 FK_COMMENTS, FK_SUPPRESS, modeFlag,
379 FLG_WARNLINTCOMMENTS,
380 "print a warning and suggest an alternative when a traditional lint "
382 "A traditional lint comment is used. Some traditional lint comments "
383 "are interpreted by LCLint to enable easier checking of legacy "
384 "code. It is preferable to replace these comments with the "
385 "suggested LCLint alternative.",
389 FK_COMPLETE, FK_NONE, modeFlag,
392 "function or variable declared but never defined",
393 "A function or variable is declared, but not defined in any source code file.",
397 FK_COMPLETE, FK_SPEC, modeFlag,
400 "function or variable specified but never defined",
401 "A function or variable is declared in an .lcl file, but not defined in any source code file.",
405 FK_COMPLETE, FK_SPEC, plainFlag,
408 "function or variable specified but never declared in a source file",
409 "A function or variable is declared in an .lcl file, but not declared "
410 "in any source code file.",
414 FK_CONTROL, FK_MEMORY, modeFlag,
417 "assume all loops execute at least once",
421 FK_CONTROL, FK_NONE, plainFlag,
428 FK_CONTROL, FK_NONE, modeFlag,
431 "likely infinite loop is detected",
432 "This appears to be an infinite loop. Nothing in the body of the "
433 "loop or the loop test modifies the value of the loop test. "
434 "Perhaps the specification of a function called in the loop "
435 "body is missing a modification.",
439 FK_CONTROL, FK_NONE, modeFlag,
442 "likely infinite loop is detected (may result from unconstrained function)",
443 "This appears to be an infinite loop. Nothing in the body of the "
444 "loop or the loop test modifies the value of the loop test. "
445 "There may be a modification through a call to an unconstrained "
446 "function, or an unconstrained function in the loop test may use "
447 "a global variable modified by the loop body.",
451 FK_CONTROL, FK_NONE, specialFlag,
454 "break inside nested while or for or switch",
455 "A break statement appears inside the body of a nested while, for or "
456 "switch statement. Sets looploopbreak, loopswitchbreak, "
457 "switchloopbreak, switchswitchbreak, and looploopcontinue.",
461 FK_CONTROL, FK_NONE, modeFlag,
464 "break inside nested while or for",
465 "A break statement appears inside the body of a nested while or for "
466 "statement. This is perfectly reasonable code, but check that "
467 "the break is intended to break only the inner loop. The "
468 "break statement may be preceded by /*@innerbreak@*/ to suppress "
469 "the message for this break only.",
473 FK_CONTROL, FK_NONE, modeFlag,
476 "break in loop inside switch",
477 "A break statement appears inside the body of a while or for "
478 "statement within a switch. This is perfectly reasonable code, but check that "
479 "the break is intended to break only the inner loop. The "
480 "break statement may be preceded by /*@loopbreak@*/ to suppress "
481 "the message for this break only.",
485 FK_CONTROL, FK_NONE, modeFlag,
488 "break in switch inside loop",
489 "A break statement appears inside a switch statement within a while or "
490 "for loop. This is perfectly reasonable code, but check that "
491 "the break is intended to break only the inner loop. The "
492 "break statement may be preceded by /*@switchbreak@*/ to suppress "
493 "the message for this break only.",
497 FK_CONTROL, FK_NONE, modeFlag,
499 FLG_SWITCHSWITCHBREAK,
500 "break in switch inside switch",
501 "A break statement appears inside a switch statement within another "
502 "switch statement. This is perfectly reasonable code, but check that "
503 "the break is intended to break only the inner switch. The "
504 "break statement may be preceded by /*@innerbreak@*/ to suppress "
505 "the message for this break only.",
509 FK_CONTROL, FK_NONE, modeFlag,
511 FLG_LOOPLOOPCONTINUE,
512 "continue inside nested loop",
513 "A continue statement appears inside a loop within a loop. "
514 "This is perfectly reasonable code, but check that "
515 "the continue is intended to continue only the inner loop. The "
516 "continue statement may be preceded by /*@innercontinue@*/ to suppress "
517 "the message for this continue only.",
521 FK_CONTROL, FK_NONE, modeFlag,
524 "unreachable code detected",
525 "This code will never be reached on any possible execution.",
529 FK_CONTROL, FK_NONE, modeFlag,
532 "a while statement has no body",
533 "While statement has no body.",
537 FK_CONTROL, FK_NONE, modeFlag,
540 "the body of a while statement is not a block",
541 "While body is a single statement, not a compound block.",
545 FK_CONTROL, FK_NONE, modeFlag,
548 "a for statement has no body",
549 "For statement has no body.",
553 FK_CONTROL, FK_NONE, modeFlag,
556 "the body of a for statement is not a block",
557 "Loop body is a single statement, not a compound block.",
561 FK_CONTROL, FK_NONE, modeFlag,
564 "an if statement has no body",
565 "If statement has no body.",
569 FK_CONTROL, FK_NONE, modeFlag,
572 "the body of an if statement is not a block",
573 "If body is a single statement, not a compound block.",
577 FK_CONTROL, FK_NONE, specialFlag,
580 "an if, while or for statement has no body (sets ifempty, "
581 "whileempty and forempty",
586 FK_CONTROL, FK_NONE, specialFlag,
589 "the body of an if, while or for statement is not a block "
590 "(sets ifblock, whileblock and forblock)",
591 "Body is a single statement, not a compound block.",
595 FK_CONTROL, FK_NONE, modeFlag,
598 "if ... else if chains must have final else",
599 "There is no final else following an else if construct.",
603 FK_CONTROL, FK_NONE, modeFlag,
606 "path with no return detected in non-void function",
607 "There is a path through a function declared to return a value on "
608 "which there is no return statement. This means the execution "
609 "may fall through without returning a meaningful result to "
614 FK_CONTROL, FK_NONE, modeFlag,
617 "non-empty case in a switch without preceding break",
618 "Execution falls through from the previous case.", 0, 0
621 FK_CONTROL, FK_NONE, modeFlag,
624 "switch on enum type missing case for some value",
625 "Not all values in an enumeration are present as cases in the switch.",
629 FK_CONTROL, FK_NONE, modeFlag,
632 "first statement in switch is not a case",
633 "The first statement after a switch is not a case.",
637 FK_DEBUG, FK_NONE, specialDebugFlag,
644 FK_DEBUG, FK_NONE, debugFlag,
651 FK_DECL, FK_NONE, modeFlag,
654 "declaration reuses name visible in outer scope",
655 "An outer declaration is shadowed by the local declaration.",
659 FK_DECL, FK_LIBS, modeFlag,
662 "function, variable or constant defined in a library is redefined with inconsistent type",
663 "A function, variable or constant previously defined in a library is "
664 "redefined with a different type.",
668 FK_DECL, FK_LIBS, modeFlag,
671 "library function overloaded",
672 "A function, variable or constant defined in the library is redefined "
673 "with a different type.",
677 FK_DECL, FK_NONE, modeFlag,
680 "an extern declaration is inside a function scope",
681 "An extern declaration is used inside a function scope.",
685 FK_DECL, FK_NONE, modeFlag,
688 "function or variable redeclared",
689 "A function or variable is declared in more than one place. This is "
690 "not necessarily a problem, since the declarations are consistent.",
694 FK_DECL, FK_NONE, plainFlag,
697 "function or variable redefined",
698 "A function or variable is redefined. One of the declarations should use extern.",
702 FK_DECL, FK_TYPE, modeFlag,
705 "function, variable or constant redefined with inconsistent type",
706 "A function, variable or constant is redefined with a different type.",
710 FK_DECL, FK_TYPE, modeFlag,
713 "variable declaration has unknown (implicitly int) type",
714 "A variable declaration has no explicit type. The type is implicitly int.",
718 FK_DECL, FK_TYPE, modeFlag,
721 "struct or enum type redefined with inconsistent fields or members",
722 "A struct, union or enum type is redefined with inconsistent fields or members.",
726 FK_DEF, FK_NONE, modeFlag,
729 "use before definition",
730 "An rvalue is used that may not be initialized to a value on some execution path.",
734 FK_DEF, FK_IMPLICIT, modeFlag,
737 "pointer parameters to unspecified functions may be implicit out parameters",
741 FK_DIRECT, FK_FILES, globalStringFlag,
744 "set directory for writing temp files",
748 FK_DIRECT, FK_FILES, globalStringFlag,
751 "set path for searching for library files (overrides LARCH_PATH environment variable)",
755 FK_DIRECT, FK_FILES, globalStringFlag,
758 "set directory to search for LCL import files (overrides LCLIMPORTDIR)",
762 FK_DIRECT, FK_FILES, globalStringFlag,
765 "set directories for system files (default /usr/include). Separate "
766 "directories with colons (e.g., \"/usr/include:/usr/local/lib\"). "
767 "Flag settings propagate to files in a system directory. If "
768 "-sysdirerrors is set, no errors are reported for files in "
769 "system directories.",
773 FK_DIRECT, FK_FILES, plainFlag,
776 "prevent inclusion of header files in a system directory with "
777 "names that match standard ANSI headers. The symbolic information "
778 "in the standard library is used instead. Flag in effect only "
779 "if a library including the ANSI library is loaded. The ANSI "
780 "headers are: assert, ctype, errno, float, limits, locale, math, "
781 "setjmp, signal, stdarg, stddef, stdio, stdlib, strings, string, "
786 FK_DIRECT, FK_FILES, plainFlag,
788 FLG_SKIPPOSIXHEADERS,
789 "prevent inclusion of header files in a system directory with "
790 "names that match standard POSIX headers. The symbolic information "
791 "in the posix library is used instead. The POSIX headers are: "
792 "dirent, fcntl, grp, pwd, termios, sys/stat, sys/times, "
793 "sys/types, sys/utsname, sys/wait, unistd, and utime.",
797 FK_DIRECT, FK_SUPPRESS, modeFlag,
800 "report errors in files in system directories (set by -sysdirs)",
804 FK_HEADERS, FK_MACROS, plainFlag,
805 "sysdirexpandmacros",
807 "expand macros in system directories regardless of other settings, "
808 "except for macros corresponding to names defined in a load library",
813 FK_DIRECT, FK_HEADERS, globalExtraArgFlag,
816 "add to C include path",
820 FK_DIRECT, FK_SPEC, globalExtraArgFlag,
827 FK_DISPLAY, FK_ERRORS, plainFlag,
830 "suppress herald and error count",
834 FK_DISPLAY, FK_ERRORS, plainFlag,
837 "send error messages to standard error (instead of standard out)",
841 FK_DISPLAY, FK_ERRORS, plainFlag,
844 "show summary of all errors reported and suppressed",
848 FK_DISPLAY, FK_FILES, plainFlag,
851 "show file names are they are processed",
855 FK_DISPLAY, FK_NONE, globalFlag,
858 "display lines processed and time",
862 FK_DISPLAY, FK_NONE, globalFlag,
865 "display time distribution",
869 FK_DISPLAY, FK_USE, globalFlag,
872 "show sorted list of uses of all globals",
876 FK_EFFECT, FK_CONTROL, modeFlag,
879 "statement with no effect",
880 "Statement has no visible effect --- no values are modified.",
884 FK_EFFECT, FK_CONTROL, modeFlag,
887 "statement with no effect (except possibly through call to "
888 "unconstrained function)",
889 "Statement has no visible effect --- no values are modified. It may "
890 "modify something through a call to an unconstrained function.",
894 FK_EXPORT, FK_SPEC, specialFlag,
897 "variable, function or type exported but not specified",
898 "A variable, function or type is exported, but not specified.",
902 FK_EXPORT, FK_SPEC, modeFlag,
905 "function exported but not specified",
906 "A function is exported, but not specified.", 0, 0
909 FK_EXPORT, FK_SPEC, modeFlag,
912 "expanded macro exported but not specified",
913 "A macro is exported, but not specified.", 0, 0
916 FK_EXPORT, FK_SPEC, modeFlag,
919 "type definition exported but not specified",
920 "A type is exported, but not specified.", 0, 0
923 FK_EXPORT, FK_SPEC, modeFlag,
926 "variable exported but not specified",
927 "A variable is exported, but not specified.", 0, 0
930 FK_EXPORT, FK_SPEC, modeFlag,
933 "constant exported but not specified",
934 "A constant is exported, but not specified.", 0, 0
937 FK_EXPORT, FK_SPEC, modeFlag,
940 "constant exported but not specified",
941 "A constant is exported, but not specified.", 0, 0
944 FK_EXPOSURE, FK_ABSTRACT, specialFlag,
947 "abstract representation is exposed (sets assignexpose, retexpose, and castexpose)",
948 "The internal representation of an abstract type is visible to the "
949 "caller. This means clients may have access to a pointer "
950 "into the abstract representation.",
954 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
957 "abstract representation is exposed (return values only)",
958 "The return value shares storage with an instance of an abstract "
959 "type. This means clients may have access to a pointer into "
960 "the abstract representation. Use the observer qualifier to "
961 "return exposed storage that may not be modified by the "
962 "client. Use the exposed qualifier to return modifiable "
963 "(but not deallocatable) exposed storage (dangerous).",
967 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
970 "abstract representation is exposed (assignments only)",
971 "Storage internal to the representation of an abstract type is "
972 "assigned to an external pointer. This means clients may "
973 "have access to a pointer into the abstract representation. "
974 "If the external pointer is a parameter, the exposed qualifier "
975 "can be used to allow the assignment, however, this is "
976 "considered dangerous programming practice.",
980 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
983 "abstract representation is exposed through a cast",
984 "Storage internal to the representation of an abstract type is exposed "
985 "through a type cast. This means clients may have access to a "
986 "pointer into the abstract representation.",
991 FK_FORMAT, FK_DISPLAY, valueFlag,
994 "set length of messages (number of chars)",
998 FK_FORMAT, FK_DISPLAY, plainFlag,
1001 "show column number where error is found",
1005 FK_FORMAT, FK_DISPLAY, plainFlag,
1007 FLG_PARENFILEFORMAT,
1008 "show column number where error is found",
1012 FK_FORMAT, FK_NONE, plainFlag,
1015 "show name of function containing error",
1019 FK_FORMAT, FK_NONE, plainFlag,
1022 "show all possible types",
1023 "When a library function is declared with multiple possible type, the "
1024 "alternate types are shown only if +showallconjs.",
1028 FK_LIBS, FK_NONE, plainFlag,
1031 "make all alternate types implicit (useful for making system libraries",
1035 FK_GLOBAL, FK_ERRORS, globalValueFlag,
1038 "expect <int> code errors",
1042 FK_GLOBAL, FK_ERRORS, globalValueFlag,
1045 "expect <int> spec errors",
1049 FK_GLOBAL, FK_USE, idemSpecialFlag,
1052 "check as partial system (-specundef, -declundef, -exportlocal, "
1053 "don't check macros in headers without corresponding .c files)",
1057 FK_GLOBALS, FK_SPEC, plainFlag,
1060 "undocumented use of a checked global variable",
1061 "A checked global variable is used in the function, but not listed in "
1062 "its globals clause. By default, only globals specified in .lcl "
1063 "files are checked. To check all globals, use +allglobals. To "
1064 "check globals selectively use /*@checked@*/ in the global "
1069 FK_GLOBALS, FK_SPEC, modeFlag,
1072 "global listed for a function not used",
1073 "A global variable listed in the function's globals list is not used "
1074 "in the body of the function.",
1078 FK_GLOBALS, FK_NONE, modeFlag,
1081 "use of internalState",
1082 "A called function uses internal state, but the globals list for the "
1083 "function being checked does not include internalState",
1087 FK_GLOBALS, FK_NONE, modeFlag,
1088 "internalglobsnoglobs",
1089 FLG_INTERNALGLOBSNOGLOBS,
1090 "use of internalState (in function with no globals list)",
1091 "A called function uses internal state, but the function being checked "
1092 "has no globals list",
1096 FK_GLOBALS, FK_MODIFIES, modeFlag,
1098 FLG_WARNMISSINGGLOBALS,
1099 "global variable used in modifies clause is not listed in globals list",
1100 "A global variable is used in the modifies clause, but it not listed in "
1101 "the globals list. The variable will be added to the globals list.",
1106 FK_GLOBALS, FK_MODIFIES, modeFlag,
1107 "warnmissingglobsnoglobs",
1108 FLG_WARNMISSINGGLOBALSNOGLOBS,
1109 "global variable used in modifies clause in a function with no globals list",
1110 "A global variable is used in the modifies clause, but the function "
1111 "has no globals list. The variable will be added to the globals list.",
1115 FK_GLOBALS, FK_UNSPEC, modeFlag,
1118 "use of checked global in a function with no globals list or specification",
1119 "A specified global variable is used in the function, but not listed "
1120 "in its globals list. Without +globnoglobs, only globals "
1121 "declared with /*@checkedstrict@*/ will produce use "
1122 "errors in functions without globals "
1123 "lists. The /*@globals ... @*/ control comment can be used to give "
1124 "a globals list for an unspecified function.",
1128 FK_GLOBALS, FK_IMPLICIT, modeFlag,
1131 "report use and modification errors for globals not annotated with unchecked",
1135 FK_GLOBALS, FK_UNSPEC, modeFlag,
1137 FLG_CHECKSTRICTGLOBALS,
1138 "report use and modification errors for checkedstrict globals",
1142 FK_GLOBALS, FK_UNSPEC, modeFlag,
1143 "impcheckedspecglobs",
1144 FLG_IMPCHECKEDSPECGLOBALS,
1145 "assume checked qualifier for unqualified global declarations in .lcl files",
1149 FK_GLOBALS, FK_UNSPEC, modeFlag,
1150 "impcheckmodspecglobs",
1151 FLG_IMPCHECKMODSPECGLOBALS,
1152 "assume checkmod qualifier for unqualified global declarations in .lcl files",
1156 FK_GLOBALS, FK_UNSPEC, modeFlag,
1157 "impcheckedstrictspecglobs",
1158 FLG_IMPCHECKEDSTRICTSPECGLOBALS,
1159 "assume checkmod qualifier for unqualified global declarations in .lcl files",
1163 FK_GLOBALS, FK_UNSPEC, modeFlag,
1165 FLG_IMPCHECKEDGLOBALS,
1166 "assume checked qualifier for unqualified global declarations",
1170 FK_GLOBALS, FK_UNSPEC, modeFlag,
1172 FLG_IMPCHECKMODGLOBALS,
1173 "assume checkmod qualifier for unqualified global declarations",
1177 FK_GLOBALS, FK_UNSPEC, modeFlag,
1178 "impcheckedstrictglobs",
1179 FLG_IMPCHECKEDSTRICTGLOBALS,
1180 "assume checkedstrict qualifier for unqualified global declarations",
1184 FK_GLOBALS, FK_UNSPEC, modeFlag,
1185 "impcheckedstatics",
1186 FLG_IMPCHECKEDSTATICS,
1187 "assume checked qualifier for unqualified file static declarations",
1191 FK_GLOBALS, FK_UNSPEC, modeFlag,
1192 "impcheckmodstatics",
1193 FLG_IMPCHECKMODSTATICS,
1194 "assume checkmod qualifier for unqualified file static declarations",
1198 FK_GLOBALS, FK_UNSPEC, modeFlag,
1199 "impcheckmodinternals",
1200 FLG_IMPCHECKMODINTERNALS,
1201 "assume checkmod qualifier for unqualified local "
1202 "static declarations (for internal state modifications)",
1206 FK_GLOBALS, FK_UNSPEC, modeFlag,
1207 "impcheckedstrictstatics",
1208 FLG_IMPCHECKEDSTRICTSTATICS,
1209 "assume checkedstrict qualifier for unqualified file static declarations",
1213 FK_GLOBALS, FK_MODIFIES, modeFlag,
1216 "undocumented modification of a checked global variable",
1217 "A checked global variable is modified by the function, but not listed in "
1218 "its modifies clause.",
1222 FK_GLOBALS, FK_MODIFIES, modeFlag,
1225 "undocumented modification of a checked global variable in a function "
1226 "declared with no modifies clause",
1227 "A checked global variable is modified by the function, but not listed in "
1228 "its modifies clause.",
1232 FK_GLOBALS, FK_MODIFIES, modeFlag,
1233 "modstrictglobsnomods",
1234 FLG_MODSTRICTGLOBSUNSPEC,
1235 "undocumented modification of a strict checked global variable in a "
1236 "function 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 "modglobsunchecked",
1244 FLG_MODGLOBSUNCHECKED,
1245 "undocumented modification of an unchecked checked global variable",
1246 "An unchecked global variable is modified by the function, but not listed in "
1247 "its modifies clause.",
1251 FK_HEADERS, FK_DEBUG, debugFlag,
1258 FK_HEADERS, FK_SPEC, globalFlag,
1261 "generate .lh files", NULL,
1265 FK_HEADERS, FK_SPEC, globalFlag,
1268 "generate .lcs files", NULL,
1272 FK_HEADERS, FK_SPEED, globalFlag,
1275 "optimize header inclusion to eliminate redundant includes",
1276 "When checking multiple files, each header file is processed only "
1277 "once. This may change the meaning of the code, if the "
1278 "same header file is included in different contexts (e.g., the "
1279 "header file includes #if directives and the values are "
1280 "different when it is included in different places.)",
1284 FK_HEADERS, FK_SPEED, globalFlag,
1287 "optimize header inclusion to not include any header files",
1288 "Ignore header includes. Only works if relevant information is "
1289 "loaded from a library.",
1293 FK_HEADERS, FK_SPEED, globalFlag,
1296 "do not include header files in system directories (set by -sysdirs)",
1297 "Do not include header files in system directories (set by -sysdirs)",
1301 FK_HELP, FK_NONE, plainFlag,
1304 "warn when command line sets flag to default value in mode",
1308 FK_HELP, FK_NONE, plainFlag,
1311 "warn when the unix library is used",
1315 FK_HELP, FK_NONE, plainFlag,
1318 "a flag is not recognized or used in an incorrect way",
1322 FK_HELP, FK_NONE, plainFlag,
1325 "provide hints for all errors reported",
1329 FK_HELP, FK_NONE, globalExtraArgFlag,
1332 "-help <flags> will describe flags",
1336 FK_HELP, FK_FORMAT, plainFlag,
1339 "provide hints on using lclint (hint only reported for first related error)",
1343 FK_IGNORERET, FK_NONE, specialFlag,
1346 "return value ignored (sets retvalint, retvalbool and retvalother)",
1347 "Result returned by function call is not used. If this is intended, "
1348 "cast result to (void) to eliminate message.",
1352 FK_IGNORERET, FK_BOOL, modeFlag,
1355 "return value of type other than bool or int ignored",
1356 "Result returned by function call is not used. If this is intended, "
1357 "can cast result to (void) to eliminate message.",
1361 FK_IGNORERET, FK_BOOL, modeFlag,
1364 "return value of manifest type bool ignored",
1365 "Result returned by function call is not used. If this is intended, "
1366 "can cast result to (void) to eliminate message.",
1370 FK_IGNORERET, FK_NONE, modeFlag,
1373 "return value of type int ignored",
1374 "Result returned by function call is not used. If this is intended, "
1375 "can cast result to (void) to eliminate message.",
1379 FK_INIT, FK_FILES, globalExtraArgFlag,
1382 "load options file (default ~/.lclintrc not loaded)",
1386 FK_INIT, FK_FILES, globalExtraArgFlag,
1389 "set LCL initilization file",
1393 FK_INIT, FK_FILES, globalFlag,
1396 "do not read options file",
1400 FK_INIT, FK_SPEC, plainFlag,
1403 "information in specifications is not also included in syntactic comments",
1404 "There is information in the specification that is not duplicated "
1405 "in syntactic comments. Normally, this is not an "
1406 "error, but it may be useful to detect it to make "
1407 "sure checking incomplete systems without the specifications will "
1408 "still use this information.",
1412 FK_DECL, FK_LIBS, plainFlag,
1415 "report new global declarations in source files",
1416 "There is a new declaration that is not declared in a loaded library "
1417 "or earlier file. (Use this flag to check for consistency "
1418 "against a library.)",
1422 FK_ITER, FK_NONE, plainFlag,
1429 FK_ITER, FK_NONE, plainFlag,
1432 "iter declaration has no yield parameters",
1433 "An iterator has been declared with no parameters annotated with "
1434 "yield. This may be what you want, if the iterator is meant "
1435 "to do something a fixed number of times, but returns no "
1436 "information to the calling context. Probably, a parameter "
1437 "is missing the yield annotation to indicate that it is "
1438 "assigned a value in the calling context.",
1442 FK_LIBS, FK_FILES, globalStringFlag,
1445 "save state for merging (default suffix .lcd)",
1449 FK_LIBS, FK_FILES, globalStringFlag,
1452 "load state from dump file (default suffix .lcd)",
1456 FK_LIBS, FK_INIT, idemGlobalFlag,
1459 "do not load standard library",
1463 FK_LIBS, FK_INIT, globalFlag,
1466 "use ANSI (ISO) standard library",
1467 "Library based on the ANSI standard library specification is used.",
1471 FK_LIBS, FK_INIT, globalFlag,
1474 "interpret standard library strictly",
1475 "Stricter version of the standard library is used. (The default "
1476 "library is standard.lcd; strict library is strict.lcd.)",
1480 FK_LIBS, FK_INIT, globalFlag,
1483 "use UNIX (sort-of) standard library",
1484 "UNIX version of the standard library is used.",
1488 FK_LIBS, FK_INIT, globalFlag,
1491 "use strict version of UNIX (sort-of) library",
1492 "strict version of the UNIX library is used.",
1496 FK_LIBS, FK_INIT, globalFlag,
1499 "use POSIX standard library",
1500 "POSIX version of the standard library is used.",
1504 FK_LIBS, FK_INIT, globalFlag,
1507 "use strict POSIX standard library",
1508 "POSIX version of the strict standard library is used.",
1512 FK_LIBS, FK_INIT, globalFlag,
1515 "show standard library filename",
1519 FK_INIT, FK_COMMENTS, valueFlag,
1522 "set marker character for syntactic comments (default is '@')",
1523 "Set the marker character for syntactic comments. Comments beginning "
1524 "with /*<char> are interpreted by lclint, where <char> is the "
1525 "comment marker character.",
1529 FK_MACROS, FK_NONE, plainSpecialFlag,
1532 "sets fcnmacros and constmacros",
1533 "All macros (not preceded by /*@notfunction@*/) are checked as functions or "
1534 "constants depending on whether or not they have parameter lists.",
1538 FK_MACROS, FK_NONE, plainFlag,
1541 "check all macros with declarations in library as functions",
1542 "Every macro declared in the load library is checked.",
1546 FK_MACROS, FK_NONE, plainFlag,
1549 "check all macros corresponding to specified functions or constants",
1550 "Every macro declared a specification file is checked.",
1554 FK_MACROS, FK_NONE, plainFlag,
1557 "check all macros with parameter lists as functions",
1558 "Every parameterized macro (not preceded by /*@notfunction@*/) "
1559 "is checked as a function.",
1563 FK_MACROS, FK_NONE, plainFlag,
1566 "check all macros without parameter lists as constants",
1567 "Every non-parameterized macro (not preceded by /*@notfunction@*/) "
1568 "is checked as a constant.",
1572 FK_MACROS, FK_NONE, modeFlag,
1575 "macro definition does not match iter or constant declaration",
1576 "A iter or constant macro is defined using a different name from the "
1577 "one used in the previous syntactic comment",
1581 FK_MACROS, FK_NONE, plainFlag,
1584 "the line after a constant or iter declaration must be a macro definition",
1585 "A constant or iter declaration is not immediately followed by a macro definition.",
1589 FK_MACROS, FK_NONE, modeFlag,
1592 "macro definition is syntactically not equivalent to function",
1593 "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.",
1597 FK_MACROS, FK_NONE, modeFlag,
1600 "macro definition for is empty",
1601 "A macro definition has no body.",
1605 FK_MACROS, FK_PARAMS, modeFlag,
1608 "macro parameter not used exactly once",
1609 "A macro parameter is not used exactly once in all possible "
1610 "invocations of the macro. To behave like a function, "
1611 "each macro parameter must be used exactly once on all "
1612 "invocations of the macro so that parameters with "
1613 "side-effects are evaluated exactly once. Use /*@sef@*/ to "
1614 "denote parameters that must be side-effect free.",
1618 FK_MACROS, FK_PARAMS, modeFlag,
1621 "assignment to a macro parameter",
1622 "A macro parameter is used as the left side of an "
1623 "assignment expression. This exhibits behavior that "
1624 "could not be implemented by a function.",
1628 FK_MACROS, FK_PARAMS, modeFlag,
1631 "a parameter with side-effects is passed as a sef parameter",
1632 "An actual parameter corresponding to a sef parameter may have a side-effect.",
1636 FK_MACROS, FK_PARAMS, modeFlag,
1639 "a parameter with unconstrained side-effects is passed as a sef parameter",
1640 "An actual parameter corresponding to a sef parameter involves a call "
1641 "to a procedure with no modifies clause that may have a side-effect.",
1645 FK_MACROS, FK_NONE, modeFlag,
1648 "macro parameter used without parentheses (in potentially dangerous context)",
1649 "A macro parameter is used without parentheses. This could be "
1650 "dangerous if the macro is invoked with a complex expression "
1651 "and precedence rules will change the evaluation inside the macro.",
1655 FK_MACROS, FK_PROTOS, modeFlag,
1658 "macro without prototype or specification (sets macrofcndecl and macroconstdecl)",
1659 "Argument checking cannot be done well for macros without prototypes "
1660 "or specifications, since the types of the arguments are unknown.",
1664 FK_MACROS, FK_PROTOS, modeFlag,
1667 "parameterized macro without prototype or specification",
1668 "Function macro has no declaration.",
1672 FK_MACROS, FK_PROTOS, modeFlag,
1675 "non-parameterized macro without prototype or specification",
1676 "Macro constant has no declaration. Use /*@constant ...@*/ to "
1677 "declare the macro.",
1681 FK_MACROS, FK_NONE, modeFlag,
1685 "A macro is defined in more than one place.", 0, 0
1688 FK_MACROS, FK_UNRECOG, modeFlag,
1691 "unrecognized identifier in macro",
1692 "An unrecognized identifier appears in a macro. If the identifier "
1693 "is defined before the macro is used, then this is okay.",
1697 FK_MEMORY, FK_DEAD, modeFlag,
1700 "external reference to stack-allocated storage is created",
1701 "A stack reference is pointed to by an external reference when the "
1702 "function returns. The stack-allocated storage is destroyed "
1703 "after the call, leaving a dangling reference.",
1707 FK_MEMORY, FK_DEAD, modeFlag,
1710 "storage used after release",
1711 "Memory is used after it has been released (either by passing "
1712 "as an only param or assigning to and only global.",
1716 FK_MEMORY, FK_DEAD, modeFlag,
1717 "strictusereleased",
1718 FLG_STRICTUSERELEASED,
1719 "element used after it may have been released",
1720 "Memory (through fetch) is used after it may have been released "
1721 "(either by passing as an only param or assigning to and only global.",
1725 FK_MEMORY, FK_DEF, modeFlag,
1728 "parameter, return value or global completely defined",
1729 "Storage derivable from a parameter, return value or global is "
1730 "not defined. Use /*@out@*/ to denote passed or returned "
1731 "storage which need not be defined.",
1735 FK_MEMORY, FK_DEF, modeFlag,
1738 "actual parameter matches alias kind of formal parameter completely ",
1739 "Storage derivable from a parameter does not match the alias kind "
1740 "expected for the formal parameter.",
1744 FK_MEMORY, FK_DEF, modeFlag,
1747 "out storage not defined before return or scope exit",
1748 "An out parameter or global is not defined before control is transferred.",
1752 FK_MEMORY, FK_DEF, modeFlag,
1755 "at least one field of a union must be defined",
1756 "No field of a union is defined. Generally, one field of a union is "
1757 "expected to be defined.",
1761 FK_MEMORY, FK_IMPLICIT, modeFlag,
1764 "memory errors for unqualified storage",
1768 FK_MEMORY, FK_IMPLICIT, plainFlag,
1771 "assume unannotated parameter is temp",
1775 FK_MEMORY, FK_IMPLICIT, specialFlag,
1778 "sets globimponly, retimponly, structimponly, specglobimponly, "
1779 "specretimponly and specstructimponly",
1783 FK_MEMORY, FK_IMPLICIT, specialFlag,
1786 "sets globimponly, retimponly and structimponly",
1790 FK_MEMORY, FK_IMPLICIT, specialFlag,
1793 "sets specglobimponly, specretimponly and specstructimponly",
1797 FK_MEMORY, FK_IMPLICIT, plainFlag,
1800 "assume unannotated global storage is only",
1804 FK_MEMORY, FK_IMPLICIT, plainFlag,
1807 "assume unannotated returned storage is only",
1811 FK_MEMORY, FK_IMPLICIT, plainFlag,
1814 "assume unannotated structure field is only",
1818 FK_MEMORY, FK_IMPLICIT, plainFlag,
1820 FLG_SPECGLOBIMPONLY,
1821 "assume unannotated global storage is only",
1825 FK_MEMORY, FK_IMPLICIT, plainFlag,
1828 "assume unannotated returned storage is only",
1832 FK_MEMORY, FK_IMPLICIT, plainFlag,
1833 "specstructimponly",
1834 FLG_SPECSTRUCTIMPONLY,
1835 "assume unannotated structure field is only",
1839 FK_MEMORY, FK_ARRAY, modeFlag,
1842 "array elements are dependent storage",
1843 "When an element is fetched from an array, lclint analysis is "
1844 "not able to determine if the same element is reused. "
1845 "If +deparrays, lclint will mark local storage assigned from "
1846 "array fetches as dependent.",
1850 FK_MEMORY, FK_LEAK, modeFlag,
1853 "all only references derivable from void pointer out only parameter are released",
1854 "A storage leak due to incomplete deallocation of a structure or deep "
1855 "pointer is suspected. Unshared storage that is reachable from "
1856 "a reference that is being deallocated has not yet been deallocated. "
1857 "LCLint assumes when an object is passed "
1858 "as an out only void pointer that the outer object will be "
1859 "deallocated, but the inner objects will not.",
1863 FK_MEMORY, FK_LEAK, modeFlag,
1866 "report complete destruction errors for array elements that "
1867 "may have been released",
1872 FK_MEMORY, FK_LEAK, modeFlag,
1875 "only storage not released before return or scope exit",
1876 "A memory leak has been detected. Newly-allocated or "
1877 "only-qualified storage is not released before the last "
1878 "reference to it is lost.",
1882 FK_MEMORY, FK_NONE, modeFlag,
1885 "storage has inconsistent states of alternate paths through a branch",
1886 "The state of a variable is different depending on which branch "
1887 "is taken. This means no annotation can sensibly be applied "
1892 FK_MEMORY, FK_NONE, modeFlag,
1893 "strictbranchstate",
1894 FLG_STRICTBRANCHSTATE,
1895 "storage through array fetch has inconsistent states of alternate "
1896 "paths through a branch",
1897 "The state of a variable through an array fetch is different depending "
1898 "on which branch is taken. This means no annotation can sensibly be applied "
1903 FK_MEMORY, FK_NONE, specialFlag,
1906 "sets all dynamic memory checking flags (memimplicit, mustfree, mustdefine, "
1907 "mustnotalias, null, memtrans)",
1911 FK_MEMORY, FK_NONE, specialFlag,
1914 "memory transfer errors (sets all *trans flags)",
1915 "Memory is transferred in a way that violates annotations.",
1919 FK_MEMORY, FK_NONE, modeFlag,
1922 "exposure transfer errors",
1923 "Exposed storage is transferred to a non-exposed, non-observer reference.",
1927 FK_MEMORY, FK_NONE, modeFlag,
1930 "observer transfer errors",
1931 "Observer storage is transferred to a non-observer reference.",
1935 FK_MEMORY, FK_NONE, modeFlag,
1938 "dependent transfer errors",
1939 "Dependent storage is transferred to a non-dependent reference.",
1943 FK_MEMORY, FK_NONE, modeFlag,
1946 "new reference transfer to reference counted reference",
1947 "A new reference is transferred to a reference counted reference.",
1951 FK_MEMORY, FK_NONE, modeFlag,
1954 "only storage transferred to non-only reference (memory leak)",
1955 "The only reference to this storage is transferred to another "
1956 "reference (e.g., by returning it) that does not have the "
1957 "only annotation. This may lead to a memory leak, since the "
1958 "new reference is not necessarily released.",
1962 FK_MEMORY, FK_NONE, modeFlag,
1963 "onlyunqglobaltrans",
1964 FLG_ONLYUNQGLOBALTRANS,
1965 "only storage transferred to an unqualified global or "
1966 "static reference (memory leak)",
1967 "The only reference to this storage is transferred to another "
1968 "reference that does not have an aliasing annotation. "
1969 "This may lead to a memory leak, since the "
1970 "new reference is not necessarily released.",
1974 FK_MEMORY, FK_NONE, modeFlag,
1977 "owned storage transferred to non-owned reference (memory leak)",
1978 "The owned reference to this storage is transferred to another "
1979 "reference (e.g., by returning it) that does not have the "
1980 "owned annotation. This may lead to a memory leak, since the "
1981 "new reference is not necessarily released.",
1985 FK_MEMORY, FK_NONE, modeFlag,
1988 "fresh storage transferred to non-only reference (memory leak)",
1989 "Fresh storage (newly allocated in this function) is transferred "
1990 "in a way that the obligation to release storage is not "
1991 "propagated. Use the /*@only@*/ annotation to indicate "
1992 "the a return value is the only reference to the returned "
1997 FK_MEMORY, FK_NONE, modeFlag,
2000 "shared storage transferred to non-shared reference",
2001 "Shared storage is transferred to a non-shared reference. The other "
2002 "reference may release storage needed by this reference.",
2006 FK_MEMORY, FK_NONE, modeFlag,
2009 "temp storage transferred to non-temporary reference",
2010 "Temp storage (associated with a formal parameter) is transferred "
2011 "to a non-temporary reference. The storage may be released "
2012 "or new aliases created.",
2016 FK_MEMORY, FK_NONE, modeFlag,
2019 "kept storage transferred to non-temporary reference",
2020 "Kept storage is transferred "
2021 "to a non-temporary reference. The storage may be released "
2022 "or new aliases created.",
2026 FK_MEMORY, FK_NONE, modeFlag,
2029 "keep storage transferred inconsistently",
2030 "Keep storage is transferred inconsistently --- either in a way "
2031 "that may add a new alias to it, or release it.",
2035 FK_MEMORY, FK_NONE, modeFlag,
2038 "an immediate address (result of &) is transferred inconsistently",
2039 "An immediate address (result of & operator) is transferred "
2044 FK_MEMORY, FK_NONE, modeFlag,
2047 "reference counted storage is transferred in an inconsistent way",
2048 "Reference counted storage is transferred in a way that may not "
2049 "be consistent with the reference count.",
2053 FK_MEMORY, FK_NONE, modeFlag,
2056 "static storage is transferred in an inconsistent way",
2057 "Static storage is transferred in an inconsistent way.",
2061 FK_MEMORY, FK_NONE, modeFlag,
2064 "unqualified storage is transferred in an inconsistent way",
2065 "Unqualified storage is transferred in an inconsistent way.",
2069 FK_MEMORY, FK_NONE, modeFlag,
2071 FLG_STATICINITTRANS,
2072 "static storage is used as an initial value in an inconsistent way",
2073 "Static storage is used as an initial value in an inconsistent way.",
2077 FK_MEMORY, FK_NONE, modeFlag,
2078 "unqualifiedinittrans",
2079 FLG_UNKNOWNINITTRANS,
2080 "unqualified storage is used as an initial value in an inconsistent way",
2081 "Unqualified storage is used as an initial value in an inconsistent way.",
2085 FK_MEMORY, FK_NONE, modeFlag,
2087 FLG_READONLYSTRINGS,
2088 "string literals are read-only (error if one is modified or released)",
2089 "String literals are read-only (ANSI semantics). An error is reported "
2090 "if a string literal may be modified or released.",
2094 FK_MEMORY, FK_NONE, modeFlag,
2097 "report memory transfer errors for initializations to read-only string literals",
2098 "A read-only string literal is assigned to a non-observer reference.",
2102 FK_MEMORY, FK_PARAMS, modeFlag,
2105 "passing a value as an un-annotated parameter clears its annotation",
2109 FK_MODIFIES, FK_SPEC, plainFlag,
2112 "unspecified modification of caller-visible state",
2113 "An externally-visible object is modified by a function, but not "
2114 "listed in its modifies clause.",
2118 FK_MODIFIES, FK_SPEC, modeFlag,
2121 "specified modification is not detected",
2122 "An object listed in the modifies clause is not modified by the "
2123 "implementation of the function. The modification may not "
2124 "be detected if it is done through a call to an unspecified "
2129 FK_MODIFIES, FK_MEMORY, plainFlag,
2132 "possible modification of observer storage",
2133 "Storage declared with observer is possibly modified. Observer "
2134 "storage may not be modified.",
2138 FK_MODIFIES, FK_MEMORY, modeFlag,
2140 FLG_MODOBSERVERUNCON,
2141 "possible modification of observer storage through unconstrained call",
2142 "Storage declared with observer may be modified through a call to an "
2143 "unconstrained function.",
2147 FK_MODIFIES, FK_MEMORY, modeFlag,
2148 "modinternalstrict",
2149 FLG_MODINTERNALSTRICT,
2150 "possible modification of internal storage through function call",
2151 "A function that modifies internalState is called from a function that "
2152 "does not list internalState in its modifies clause",
2156 FK_MODIFIES, FK_UNSPEC, modeFlag,
2159 "report undocumented file system modifications (applies to unspecified "
2160 "functions if modnomods is set)",
2164 FK_MODIFIES, FK_UNSPEC, specialFlag,
2167 "modification in unspecified functions (sets modnomods, "
2168 "modglobunspec and modstrictglobsunspec)",
2172 FK_MODIFIES, FK_UNSPEC, modeFlag,
2175 "modification in a function with no modifies clause",
2176 "An externally-visible object is modified by a function with no "
2177 "/*@modifies@*/ comment. The /*@modifies ... @*/ control "
2178 "comment can be used to give a modifies list for an "
2179 "unspecified function.",
2183 FK_MODIFIES, FK_UNSPEC, modeFlag,
2186 "possible modification through a call to an unconstrained function",
2187 "An unconstrained function is called in a function body where "
2188 "modifications are checked. Since the unconstrained function "
2189 "may modify anything, there may be undetected modifications in "
2190 "the checked function.",
2194 FK_MODIFIES, FK_UNSPEC, modeFlag,
2197 "possible modification through a call to an unconstrained function in "
2198 "a function with no modifies clause",
2199 "An unconstrained function is called in a function body where "
2200 "modifications are checked. Since the unconstrained function "
2201 "may modify anything, there may be undetected modifications in "
2202 "the checked function.",
2206 FK_MODIFIES, FK_GLOBALS, modeFlag,
2207 "globsimpmodsnothing",
2208 FLG_GLOBALSIMPMODIFIESNOTHING,
2209 "functions declared with a globals list but no modifies clause are "
2210 "assumed to modify nothing",
2211 "An implicit modifies nothing clause is assumed for a function "
2212 "declared with a globals list but not modifies clause.",
2216 FK_MODIFIES, FK_GLOBALS, modeFlag,
2218 FLG_MODIFIESIMPNOGLOBALS,
2219 "functions declared with a modifies clause but no globals list "
2220 "are assumed to use no globals",
2221 "An implicit empty globals list is assumed for a function "
2222 "declared with a modifies clause but no globals list.",
2226 FK_NAMES, FK_ABSTRACT, plainFlag,
2229 "controls name checking without changing other settings",
2233 FK_NAMES, FK_ABSTRACT, specialFlag,
2236 "czech naming convention (sets accessczech, czechfunctions, czechvars, "
2237 "czechconstants, czechenums, and czechmacros)",
2238 "Name is not consistent with Czech naming convention.", 0, 0
2241 FK_NAMES, FK_ABSTRACT, plainFlag,
2244 "czech naming convention violated in a function or iterator declaration",
2245 "Function or iterator name is not consistent with Czech naming convention.", 0, 0
2248 FK_NAMES, FK_ABSTRACT, plainFlag,
2251 "czech naming convention violated in a variable declaration",
2252 "Variable name is not consistent with Czech naming convention.", 0, 0
2255 FK_NAMES, FK_ABSTRACT, plainFlag,
2258 "czech naming convention violated in an expanded macro name",
2259 "Expanded macro name is not consistent with Czech naming convention.", 0, 0
2262 FK_NAMES, FK_ABSTRACT, plainFlag,
2265 "czech naming convention violated in a constant declaration",
2266 "Constant name is not consistent with Czech naming convention.", 0, 0
2269 FK_NAMES, FK_ABSTRACT, plainFlag,
2272 "czech naming convention violated in a user-defined type definition",
2273 "Type name is not consistent with Czech naming convention. Czech type "
2274 "names must not use the underscore character.", 0, 0
2277 FK_NAMES, FK_ABSTRACT, specialFlag,
2280 "slovak naming convention violated",
2281 "Name is not consistent with Slovak naming convention.", 0, 0
2284 FK_NAMES, FK_ABSTRACT, plainFlag,
2286 FLG_SLOVAKFUNCTIONS,
2287 "slovak naming convention violated in a function or iterator declaration",
2288 "Function or iterator name is not consistent with Slovak naming convention.", 0, 0
2291 FK_NAMES, FK_ABSTRACT, plainFlag,
2294 "slovak naming convention violated in an expanded macro name",
2295 "Expanded macro name is not consistent with Slovak naming convention.", 0, 0
2298 FK_NAMES, FK_ABSTRACT, plainFlag,
2301 "slovak naming convention violated in a variable declaration",
2302 "Variable name is not consistent with Slovak naming convention.", 0, 0
2305 FK_NAMES, FK_ABSTRACT, plainFlag,
2307 FLG_SLOVAKCONSTANTS,
2308 "slovak naming convention violated in a constant declaration",
2309 "Constant name is not consistent with Slovak naming convention.", 0, 0
2312 FK_NAMES, FK_ABSTRACT, plainFlag,
2315 "slovak naming convention violated in a use-defined type definition",
2316 "Type name is not consistent with Slovak naming convention. Slovak type "
2317 "names may not include uppercase letters.", 0, 0
2320 FK_NAMES, FK_ABSTRACT, specialFlag,
2323 "czech or slovak naming convention violated",
2324 "Name is not consistent with either Czech or Slovak naming convention.", 0, 0
2327 FK_NAMES, FK_ABSTRACT, plainFlag,
2329 FLG_CZECHOSLOVAKFUNCTIONS,
2330 "czechoslovak naming convention violated in a function or iterator declaration",
2331 "Function name is not consistent with Czechoslovak naming convention.", 0, 0
2334 FK_NAMES, FK_ABSTRACT, plainFlag,
2335 "czechoslovakmacros",
2336 FLG_CZECHOSLOVAKMACROS,
2337 "czechoslovak naming convention violated in an expanded macro name",
2338 "Expanded macro name is not consistent with Czechoslovak naming convention.", 0, 0
2341 FK_NAMES, FK_ABSTRACT, plainFlag,
2343 FLG_CZECHOSLOVAKVARS,
2344 "czechoslovak naming convention violated in a variable declaration",
2345 "Variable name is not consistent with Czechoslovak naming convention.", 0, 0
2348 FK_NAMES, FK_ABSTRACT, plainFlag,
2349 "czechoslovakconsts",
2350 FLG_CZECHOSLOVAKCONSTANTS,
2351 "czechoslovak naming convention violated in a constant declaration",
2352 "Constant name is not consistent with Czechoslovak naming convention.", 0, 0
2355 FK_NAMES, FK_ABSTRACT, plainFlag,
2356 "czechoslovaktypes",
2357 FLG_CZECHOSLOVAKTYPES,
2358 "czechoslovak naming convention violated in a user-defined type definition",
2359 "Type name is not consistent with Czechoslovak naming convention. Czechoslovak "
2360 "type names may not include uppercase letters or the underscore character.", 0, 0
2363 FK_NAMES, FK_ANSI, modeFlag,
2366 "external name conflicts with name reserved for system or standard library",
2367 "External name is reserved for system in ANSI standard.",
2371 FK_NAMES, FK_ANSI, modeFlag,
2374 "external or internal name is a C++ keyword or reserved word",
2375 "External name is a C++ keyword or reserved word. "
2376 "This could lead to problems if the "
2377 "code is compiled with a C++ compiler.",
2381 FK_NAMES, FK_ANSI, modeFlag,
2382 "ansireservedinternal",
2383 FLG_ANSIRESERVEDLOCAL,
2384 "internal name conflicts with name reserved for system or standard library",
2385 "Internal name is reserved for system in ANSI standard.",
2389 FK_NAMES, FK_ANSI, plainFlag,
2390 "distinctexternalnames",
2391 FLG_DISTINCTEXTERNALNAMES,
2392 "external name is not distinguishable from another external name using "
2393 "the number of significant characters",
2394 "An external name is not distinguishable from another external name "
2395 "using the number of significant characters. According to "
2396 "ANSI Standard (3.1), an implementation may only consider the first 6 "
2397 "characters significant, and ignore alphabetical case "
2398 "distinctions. The "
2399 "+externalnamelen <n> flag may be used to change the number "
2400 "of significant characters, and -externalnamecaseinsensitive to make "
2401 "alphabetical case significant in external names.",
2405 FK_NAMES, FK_ANSI, specialValueFlag,
2407 FLG_EXTERNALNAMELEN,
2408 "set the number of significant characters in an external name",
2409 "Sets the number of significant characters in an external name (ANSI "
2410 "default is 6.) Sets +distinctexternalnames.",
2414 FK_NAMES, FK_ANSI, plainSpecialFlag,
2415 "externalnamecaseinsensitive",
2416 FLG_EXTERNALNAMECASEINSENSITIVE,
2417 "alphabetic comparisons for external names are case-insensitive",
2418 "Make alphabetic case insignificant in external names. By ANSI "
2419 "standard, case need not be significant in an external name. "
2420 "If +distinctexternalnames is not set, sets "
2421 "+distinctexternalnames with unlimited external name length.",
2425 FK_NAMES, FK_ANSI, plainFlag,
2426 "distinctinternalnames",
2427 FLG_DISTINCTINTERNALNAMES,
2428 "internal name is not distinguishable from another internal name using "
2429 "the number of significant characters",
2430 "An internal name is not distinguishable from another internal name "
2431 "using the number of significant characters. According to "
2432 "ANSI Standard (3.1), an implementation may only consider the first 31 "
2433 "characters significant. The "
2434 "+internalnamelen <n> flag changes the number "
2435 "of significant characters, -internalnamecaseinsensitive to makes "
2436 "alphabetical case significant, and "
2437 "+internalnamelookalike to make similar-looking characters "
2442 FK_NAMES, FK_ANSI, specialValueFlag,
2444 FLG_INTERNALNAMELEN,
2445 "set the number of significant characters in an internal name",
2446 "Sets the number of significant characters in an internal name (ANSI "
2447 "default is 31.) Sets +distinctinternalnames.",
2451 FK_NAMES, FK_ANSI, plainSpecialFlag,
2452 "internalnamecaseinsensitive",
2453 FLG_INTERNALNAMECASEINSENSITIVE,
2454 "set whether case is significant an internal names "
2455 "(-internalnamecaseinsensitive means case is significant)" ,
2456 "Set whether case is significant an internal names "
2457 "(-internalnamecaseinsensitive "
2458 "means case is significant). By ANSI default, case is not "
2459 "significant. If +distinctinternalnames is not set, sets "
2460 "+distinctinternalnames with unlimited internal name length.",
2464 FK_NAMES, FK_ANSI, plainSpecialFlag,
2465 "internalnamelookalike",
2466 FLG_INTERNALNAMELOOKALIKE,
2467 "lookalike characters match in internal names",
2468 "Set whether similar looking characters (e.g., \"1\" and \"l\") "
2469 "match in internal names.",
2473 FK_NAMES, FK_PREFIX, idemStringFlag,
2476 "set namespace prefix for variables declared in a macro body",
2477 "A variable declared in a macro body does not start with the macrovarprefix.",
2481 FK_NAMES, FK_PREFIX, plainFlag,
2482 "macrovarprefixexclude",
2483 FLG_MACROVARPREFIXEXCLUDE,
2484 "the macrovarprefix may not be used for non-macro variables",
2485 "A variable declared outside a macro body starts with the macrovarprefix.",
2489 FK_NAMES, FK_PREFIX, idemStringFlag,
2492 "set namespace prefix for struct, union and enum tags",
2493 "A tag identifier does not start with the tagprefix.",
2497 FK_NAMES, FK_PREFIX, plainFlag,
2499 FLG_TAGPREFIXEXCLUDE,
2500 "the tagprefix may not be used for non-tag identifiers",
2501 "An identifier that is not a tag starts with the tagprefix.",
2505 FK_NAMES, FK_PREFIX, idemStringFlag,
2508 "set namespace prefix for enum members",
2509 "An enum member does not start with the enumprefix.",
2513 FK_NAMES, FK_PREFIX, plainFlag,
2514 "enumprefixexclude",
2515 FLG_ENUMPREFIXEXCLUDE,
2516 "the enumprefix may not be used for non-enum member identifiers",
2517 "An identifier that is not an enum member starts with the enumprefix.",
2521 FK_NAMES, FK_PREFIX, idemStringFlag,
2523 FLG_FILESTATICPREFIX,
2524 "set namespace prefix for file static declarations",
2525 "A file-static identifier does not start with the filestaticprefix.",
2529 FK_NAMES, FK_PREFIX, plainFlag,
2530 "filestaticprefixexclude",
2531 FLG_FILESTATICPREFIXEXCLUDE,
2532 "the filestaticprefix may not be used for identifiers that are not file static",
2533 "An identifier that is not file static starts with the filestaticprefix.",
2537 FK_NAMES, FK_PREFIX, idemStringFlag,
2540 "set namespace prefix for global variables",
2541 "A global variable does not start with the globalprefix",
2545 FK_NAMES, FK_PREFIX, plainFlag,
2546 "globalprefixexclude",
2547 FLG_GLOBPREFIXEXCLUDE,
2548 "the globalprefix may not be used for non-global identifiers",
2549 "An identifier that is not a global variable starts with the globalprefix.",
2553 FK_NAMES, FK_PREFIX, idemStringFlag,
2556 "set namespace prefix for user-defined types",
2557 "A user-defined type does not start with the typeprefix",
2561 FK_NAMES, FK_PREFIX, plainFlag,
2562 "typeprefixexclude",
2563 FLG_TYPEPREFIXEXCLUDE,
2564 "the typeprefix may not be used for identifiers that are not type names",
2565 "An identifier that is not a type name starts with the typeprefix.",
2569 FK_NAMES, FK_PREFIX, idemStringFlag,
2572 "set namespace prefix for external identifiers",
2573 "An external identifier does not start with the externalprefix",
2577 FK_NAMES, FK_PREFIX, plainFlag,
2578 "externalprefixexclude",
2579 FLG_EXTERNALPREFIXEXCLUDE,
2580 "the externalprefix may not be used for non-external identifiers",
2581 "An identifier that is not external starts with the externalprefix.",
2585 FK_NAMES, FK_PREFIX, idemStringFlag,
2588 "set namespace prefix for local variables",
2589 "A local variable does not start with the localprefix",
2593 FK_NAMES, FK_PREFIX, plainFlag,
2594 "localprefixexclude",
2595 FLG_LOCALPREFIXEXCLUDE,
2596 "the localprefix may not be used for non-local identifiers",
2597 "An identifier that is not a local variable starts with the localprefix.",
2601 FK_NAMES, FK_PREFIX, idemStringFlag,
2602 "uncheckedmacroprefix",
2603 FLG_UNCHECKEDMACROPREFIX,
2604 "set namespace prefix for unchecked macros",
2605 "An unchecked macro name does not start with the uncheckedmacroprefix",
2609 FK_NAMES, FK_PREFIX, plainFlag,
2610 "uncheckedmacroprefixexclude",
2611 FLG_UNCHECKEDMACROPREFIXEXCLUDE,
2612 "the uncheckmacroprefix may not be used for identifiers that are not "
2614 "An identifier that is not the name of an unchecked macro "
2615 "starts with the uncheckedmacroprefix.",
2619 FK_NAMES, FK_PREFIX, idemStringFlag,
2622 "set namespace prefix for constants",
2623 "A constant does not start with the constantprefix",
2627 FK_NAMES, FK_PREFIX, plainFlag,
2628 "constprefixexclude",
2629 FLG_CONSTPREFIXEXCLUDE,
2630 "the constprefix may not be used for non-constant identifiers",
2631 "An identifier that is not a constant starts with the constantprefix.",
2635 FK_NAMES, FK_PREFIX, idemStringFlag,
2638 "set namespace prefix for iterators",
2639 "An iter does not start with the iterator prefix",
2643 FK_NAMES, FK_PREFIX, plainFlag,
2644 "iterprefixexclude",
2645 FLG_ITERPREFIXEXCLUDE,
2646 "the iterprefix may not be used for non-iter identifiers",
2647 "An identifier that is not a iter starts with the iterprefix.",
2651 FK_NAMES, FK_PREFIX, idemStringFlag,
2653 FLG_DECLPARAMPREFIX,
2654 "set namespace prefix for parameters in function prototype declarations",
2655 "A parameter name in a function prototype declaration does not start with the "
2656 "declaration parameter prefix",
2660 FK_NAMES, FK_PREFIX, modeFlag,
2663 "a parameter in a function prototype has a name",
2664 "A parameter in a function prototype has a name. This is dangerous, "
2665 "since a macro definition could be visible here.",
2669 FK_NAMES, FK_PREFIX, modeFlag,
2672 "the name of a parameter in a function prototype and corresponding "
2673 "declaration must match (after removing the protoparamprefix",
2674 "A parameter in a function definition does not have the same name as "
2675 "the corresponding in the declaration of the function after "
2676 "removing the protoparamprefix",
2680 FK_NAMES, FK_PREFIX, plainFlag,
2681 "protoparamprefixexclude",
2682 FLG_DECLPARAMPREFIXEXCLUDE,
2683 "the protoparamprefix may not be used for non-declaraction parameter identifiers",
2684 "An identifier that is not a parameter name in a function prototype "
2685 "starts with the protoparamprefix.",
2689 FK_LIMITS, FK_ANSI, modeValueFlag,
2691 FLG_CONTROLNESTDEPTH,
2692 "set maximum nesting depth of compound statements, iteration control "
2693 "structures, and selection control structures (ANSI minimum is 15)",
2694 "Maximum number of control levels exceeded.",
2698 FK_LIMITS, FK_ANSI, modeValueFlag,
2700 FLG_STRINGLITERALLEN,
2701 "set maximum length of string literals (ANSI minimum is 509)",
2702 "Maximum length of string literal exceeded.",
2706 FK_LIMITS, FK_ANSI, modeValueFlag,
2708 FLG_NUMSTRUCTFIELDS,
2709 "set maximum number of fields in a struct or union (ANSI minimum is 127)",
2710 "Maximum number of fields in a struct or union exceeded.",
2714 FK_LIMITS, FK_ANSI, modeValueFlag,
2717 "set maximum number of members of an enum (ANSI minimum is 127)",
2718 "Limit on maximum number of members of an enum is exceeded.",
2722 FK_LIMITS, FK_ANSI, modeValueFlag,
2725 "set maximum number of nested #include files",
2726 "Maximum number of nested #include files exceeded.",
2730 FK_LIMITS, FK_ANSI, specialFlag,
2733 "check for violations of standard limits (controlnestdepth, "
2734 "stringliterallen, includenest, numstructfields, numenummembers)",
2739 FK_NAMES, FK_NONE, plainFlag,
2743 "Naming convention is violated.",
2747 FK_NONE, FK_NONE, plainFlag,
2754 FK_NULL, FK_MEMORY, specialFlag,
2757 "misuses of null pointer",
2758 "A possibly null pointer is misused (sets nullderef, nullpass, "
2759 "nullref, nullassign, and nullstate).",
2763 FK_NT, FK_MEMORY, modeFlag,
2766 "misuse of nullterminated allocation",
2767 "A possibly non-nullterminated string/memory is used/referenced as a nullterminated one, ",
2771 FK_NT, FK_MEMORY, modeFlag,
2774 "possible buffer overflow",
2775 "A possibly buffer overflow has been detected, ",
2779 FK_NT, FK_MEMORY, modeFlag,
2782 "possible out of bounds read",
2783 "An array or pointer access references memory beyond the array or buffer, ",
2787 FK_NT, FK_MEMORY, modeFlag,
2790 "possible buffer overflow from an out of bounds write",
2791 "Memory is set past the end of an array or or after the allocated buffer, ",
2796 FK_NT, FK_MEMORY, modeFlag,
2799 "Function has the post condition",
2800 "LCLint has determined that the following statement is true after the function, ",
2804 FK_NT, FK_MEMORY, modeFlag,
2806 FLG_FUNCTIONCONSTRAINT,
2807 "unresolved constraint",
2808 "LCLint was unable to resolve a constraint at the top of the function. If code is correct consider using explict annotation assertions, ",
2811 /*drl7x added 6/18/01 */
2813 FK_NT, FK_MEMORY, modeFlag,
2816 "unable to verify ensures annotation",
2817 "LCLint was unable to determine that the function satisfies a post condition given in an ensures annotation, ",
2822 FK_NT, FK_MEMORY, modeFlag,
2823 "constraintlocation",
2824 FLG_CONSTRAINTLOCATION,
2825 "display full c expression for every constraint generated",
2828 },/*drl added flag 4/26/01*/
2830 FK_NT, FK_MEMORY, modeFlag,
2831 "implictconstraint",
2832 FLG_IMPLICTCONSTRAINT,
2833 "Try to generate implicit constraints for functions",
2837 /*drl7x added 4/29/01 */
2839 FK_NT, FK_MEMORY, modeFlag,
2842 "Use limited OR expressions to resolve constraints",
2848 FK_NT, FK_MEMORY, modeFlag,
2850 FLG_NULLTERMINATEDWARNING,
2851 "misuse of nullterminated allocation",
2852 "WARNING:A user annotated non-nullterminated buffer is used/referenced as a nullterminated one, ",
2856 FK_NULL, FK_MEMORY, modeFlag,
2859 "possible dereferencce of null pointer",
2860 "A possibly null pointer is dereferenced. Value is "
2861 "either the result of a function which may return null "
2862 "(in which case, code should check it is not null), or a "
2863 "global, parameter or structure field declared with the "
2868 FK_TYPE, FK_NONE, modeFlag,
2871 "dereferencce of a function type",
2872 "A function type is dereferenced. The ANSI standard allows this "
2873 "because of implicit conversion of function designators, however the "
2874 "dereference is unnecessary.",
2878 FK_NULL, FK_MEMORY, modeFlag,
2881 "possibly null pointer passed as formal with no null annotation",
2882 "A possibly null pointer is passed as a parameter corresponding to "
2883 "a formal parameter with no /*@null@*/ annotation. If NULL "
2884 "may be used for this parameter, add a /*@null@*/ annotation "
2885 "to the function parameter declaration.",
2889 FK_NULL, FK_MEMORY, modeFlag,
2892 "possibly null pointer returned as result with no null annotation",
2893 "Function returns a possibly null pointer, but is not declared "
2894 "using /*@null@*/ annotation of result. If function may "
2895 "return NULL, add /*@null@*/ annotation to the return "
2896 "value declaration.",
2900 FK_NULL, FK_MEMORY, modeFlag,
2903 "possibly null pointer reachable from a reference with no null annotation",
2904 "A possibly null pointer is reachable from a parameter or global "
2905 "variable that is not declared using a /*@null@*/ annotation.",
2909 FK_NULL, FK_MEMORY, modeFlag,
2912 "inconsistent assignment or initialization involving null pointer",
2913 "A reference with no null annotation is assigned or initialized "
2914 "to NULL. Use /*@null@*/ to declare the reference as "
2915 "a possibly null pointer.",
2919 FK_OPS, FK_BOOL, modeFlag,
2922 "comparison between bools (dangerous because of multiple TRUE values)",
2923 "Two bool values are compared directly using a C primitive. This "
2924 "may produce unexpected results since all non-zero values are "
2925 "considered TRUE, so different TRUE values may not be equal. "
2926 "The file bool.h (included in lclint/lib) provides bool_equal "
2927 "for safe bool comparisons.", 0, 0
2930 FK_OPS, FK_NONE, modeFlag,
2933 "dangerous comparison between reals (dangerous because of inexact "
2934 "floating point representations)",
2935 "Two real (float, double, or long double) values are compared "
2936 "directly using a C primitive. "
2937 "This may produce unexpected results since floating point "
2938 "representations are inexact. Instead, compare the difference to "
2939 "FLT_EPSILON or DBL_EPSILON.",
2943 FK_OPS, FK_POINTER, modeFlag,
2946 "arithmetic involving pointer and integer",
2947 "Pointer arithmetic using pointer and integer.", 0, 0
2950 FK_OPS, FK_POINTER, modeFlag,
2952 FLG_NULLPOINTERARITH,
2953 "arithmetic involving possibly null pointer and integer",
2954 "Pointer arithmetic using a possibly null pointer and integer.", 0, 0
2957 FK_OPS, FK_POINTER, modeFlag,
2960 "comparison between pointer and number",
2961 "A pointer is compared to a number.", 0, 0
2964 FK_OPS, FK_TYPE, modeFlag,
2967 "primitive operation does not type check strictly",
2968 "A primitive operation does not type check strictly.", 0, 0
2971 FK_OPS, FK_TYPE, modeFlag,
2974 "a bitwise logical operator does not have unsigned operands",
2975 "An operand to a bitwise operator is not an unsigned values. This "
2976 "may have unexpected results depending on the signed "
2977 "representations.", 0, 0
2980 FK_OPS, FK_TYPE, modeFlag,
2983 "a shift operator does not have unsigned operands",
2984 "An operand to a shift operator is not unsigned values. This "
2985 "may have unexpected results depending on the signed "
2986 "representations.", 0, 0
2989 FK_OPS, FK_BOOL, modeFlag,
2992 "primitive operation (!, && or ||) does not has a boolean argument",
2993 "The operand of a boolean operator is not a boolean. Use +ptrnegate "
2994 "to allow ! to be used on pointers.",
2998 FK_OPS, FK_POINTER, modeFlag,
3001 "allow ! to be used on pointer operand",
3002 "The operand of ! operator is a pointer.", 0, 0
3005 FK_OPS, FK_TYPE, modeFlag,
3008 "sizeof operator has a type argument",
3009 "Operand of sizeof operator is a type. (Safer to use expression, "
3010 "int *x = sizeof (*x); instead of sizeof (int).)",
3014 FK_OPS, FK_TYPE, plainFlag,
3015 "sizeofformalarray",
3016 FLG_SIZEOFFORMALARRAY,
3017 "sizeof operator has an array formal parameter argument",
3018 "Operand of a sizeof operator is a function parameter declared as "
3019 "an array. The value of sizeof will be the size of a pointer to the "
3020 "element type, not the number of elements in the array.",
3024 FK_DECL, FK_TYPE, plainFlag,
3026 FLG_FIXEDFORMALARRAY,
3027 "formal parameter of type array is declared with size",
3028 "A formal parameter is declared as an array with size. The size of the array "
3029 "is ignored in this context, since the array formal parameter is treated "
3034 FK_DECL, FK_TYPE, plainFlag,
3037 "formal parameter has an incomplete type",
3038 "A formal parameter is declared with an incomplete type.",
3042 FK_DECL, FK_TYPE, plainFlag,
3045 "formal parameter is an array",
3046 "A formal parameter is declared as an array. This can be confusing, since "
3047 "a formal array parameter is treated as a pointer.",
3051 FK_PRED, FK_BOOL, plainFlag,
3054 "condition test (if, while or for) is an assignment",
3055 "The condition test is an assignment expression. Probably, you mean "
3056 "to use == instead of =. If an assignment is intended, add an "
3057 "extra parentheses nesting (e.g., if ((a = b)) ...) to suppress "
3062 FK_PRED, FK_BOOL, specialFlag,
3065 "type of condition test (if, while or for) not bool (sets predboolint, "
3066 "predboolptr and predboolothers)",
3067 "Test expression type is not boolean.", 0, 0
3070 FK_PRED, FK_BOOL, modeFlag,
3073 "type of condition test (if, while or for) is an integral type",
3074 "Test expression type is not boolean or int.", 0, 0
3077 FK_PRED, FK_BOOL, modeFlag,
3080 "type of condition test (if, while or for) not bool, int or pointer",
3081 "Test expression type is not boolean.", 0, 0
3084 FK_PRED, FK_BOOL, modeFlag,
3087 "type of condition test (if, while or for) is a pointer",
3088 "Test expression type is not boolean.", 0, 0
3091 FK_PREPROC, FK_NONE, globalExtraArgFlag,
3094 "passed to pre-processor",
3098 FK_PREPROC, FK_NONE, globalExtraArgFlag,
3101 "passed to pre-processor",
3105 FK_GLOBALS, FK_NONE, modeFlag,
3108 "returns with global in inconsistent state (null or undefined)",
3109 "A global variable does not satisfy its annotations when control is transferred.",
3113 FK_SUPPRESS, FK_COMMENTS, globalFlag,
3116 "The number of errors detected does not match number in /*@i<n>@*/.",
3120 FK_SUPPRESS, FK_ERRORS, valueFlag,
3123 "limit <int> consecutive repeated errors",
3127 FK_SYNTAX, FK_NONE, plainFlag,
3130 "syntax error in parsing",
3131 "Code cannot be parsed. For help on parse errors, see lclint -help parseerrors.",
3135 FK_SYNTAX, FK_NONE, plainFlag,
3138 "try to recover from parse error",
3139 "Try to recover from parse error. It really means try --- this doesn't usually work.", 0, 0
3142 FK_SYNTAX, FK_PREPROC, plainFlag,
3149 FK_TYPE, FK_NONE, plainFlag,
3153 "Types are incompatible.",
3157 FK_TYPE, FK_NONE, plainFlag,
3160 "initializer sets all fields",
3161 "Initializer does not set every field in the structure.",
3165 FK_TYPE, FK_NONE, modeFlag,
3168 "enum members must be int values",
3169 "Type of initial values for enum members must be int.",
3174 FK_TYPE, FK_NONE, plainFlag,
3177 "type of main does not match expected type",
3178 "The function main does not match the expected type.",
3182 FK_TYPE, FK_NONE, plainFlag,
3185 "type-mismatch in parameter corresponding to format code in a printf or scanf-like function",
3186 "Type of parameter is not consistent with corresponding code in format string.",
3190 FK_TYPE, FK_NONE, plainFlag,
3193 "invalid format code in format string for printf or scanf-like function",
3194 "Format code in a format string is not valid.",
3198 FK_TYPEEQ, FK_ABSTRACT, modeFlag,
3201 "forward declarations of pointers to abstract representation match abstract type",
3205 FK_TYPEEQ, FK_ABSTRACT, modeFlag,
3208 "void * matches pointers to abstract types, casting ok (dangerous)",
3209 "A pointer to void is cast to a pointer to an abstract type (or vice versa).",
3213 FK_TYPEEQ, FK_POINTER, plainFlag,
3216 "a pointer to a function is cast to a pointer to void (or vice versa)",
3217 "A pointer to a function is cast to (or used as) a pointer to void (or vice versa).",
3221 FK_TYPEEQ, FK_ARRAY, modeFlag,
3224 "char can be used to index arrays",
3225 "To allow char types to index arrays, use +charindex.", 0, 0
3228 FK_TYPEEQ, FK_ARRAY, modeFlag,
3231 "enum can be used to index arrays",
3232 "To allow enum types to index arrays, use +enumindex.", 0, 0
3235 FK_TYPEEQ, FK_BOOL, modeFlag,
3238 "bool and int are equivalent",
3239 "To make bool and int types equivalent, use +boolint.",
3243 FK_TYPEEQ, FK_NONE, modeFlag,
3246 "char and int are equivalent",
3247 "To make char and int types equivalent, use +charint.",
3251 FK_TYPEEQ, FK_NONE, modeFlag,
3254 "enum and int are equivalent",
3255 "To make enum and int types equivalent, use +enumint.",
3259 FK_TYPEEQ, FK_NONE, modeFlag,
3262 "float and double are equivalent",
3263 "To make float and double types equivalent, use +floatdouble.",
3267 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3270 "ignore type qualifiers (long, short, unsigned)",
3271 "To ignore type qualifiers in type comparisons use +ignorequals.",
3275 FK_TYPEEQ, FK_SYNTAX, plainFlag,
3278 "report duplicate type qualifiers (e.g., long long)",
3279 "Duplicate type qualifiers not supported by ANSI. Some "
3280 "compilers (e.g., gcc) do support duplicate qualifiers.",
3284 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3287 "ignore signs in type comparisons (unsigned matches signed)",
3288 "To ignore signs in type comparisons use +ignoresigns",
3292 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3295 "int literals can be reals",
3296 "An int literal is used as any numeric type (including float and long long). Use +numliteral to "
3297 "allow int literals to be used as any numeric type.",
3301 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3304 "character constants (e.g., 'a') can be used as ints",
3305 "A character constant is used as an int. Use +charintliteral to "
3306 "allow character constants to be used as ints. (This is safe "
3307 "since the actual type of a char constant is int.)",
3311 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3314 "report qualifier mismatches only if dangerous",
3318 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3321 "allow all numeric types to match",
3325 FK_TYPEEQ, FK_NONE, modeFlag,
3327 FLG_CHARUNSIGNEDCHAR,
3328 "allow char and unsigned char types to match",
3329 "To allow char and unsigned char types to match use +charunsignedchar.",
3333 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3335 FLG_MATCHANYINTEGRAL,
3336 "allow any intergral type to match an arbitrary integral type (e.g., dev_t)",
3337 "To allow arbitrary integral types to match any integral type, use +matchanyintegral.",
3341 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3342 "longunsignedintegral",
3343 FLG_LONGUNSIGNEDINTEGRAL,
3344 "allow long unsigned type to match an arbitrary integral type (e.g., dev_t)",
3345 "To allow arbitrary integral types to match long unsigned, use +longunsignedintegral.",
3349 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3352 "allow long type to match an arbitrary integral type (e.g., dev_t)",
3353 "To allow arbitrary integral types to match long unsigned, use +longintegral.",
3357 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3358 "longunsignedunsignedintegral",
3359 FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL,
3360 "allow long unsigned type to match an arbitrary unsigned integral type (e.g., size_t)",
3361 "To allow arbitrary unsigned integral types to match long unsigned, "
3362 "use +longunsignedunsignedintegral.",
3366 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3367 "longsignedintegral",
3368 FLG_LONGSIGNEDINTEGRAL,
3369 "allow long type to match an arbitrary signed integral type (e.g., ssize_t)",
3370 "To allow arbitrary signed integral types to match long unsigned, use +longsignedintegral.",
3374 FK_TYPEEQ, FK_POINTER, plainFlag,
3377 "0 is treated as a pointer",
3381 FK_TYPEEQ, FK_BOOL, modeFlag,
3384 "0 is treated as a boolean",
3388 FK_UNRECOG, FK_DISPLAY, plainFlag,
3391 "do not suppress repeated unrecognized identifier messages (instead of only reporting the first error)",
3392 "Identifier used in code has not been declared. (Message repeated for future uses in this file.)",
3396 FK_UNRECOG, FK_DISPLAY, plainFlag,
3399 "report unrecognized identifiers with system (__) prefix",
3400 "Identifier used in code has not been declared. (Message repeated for "
3401 "future uses in this file.) Use +gnuextensions to make lclint "
3402 "recognize some keywords that are gnu extensions.",
3406 FK_UNRECOG, FK_NONE, plainFlag,
3409 "unrecognized identifier",
3410 "Identifier used in code has not been declared.", 0, 0
3413 FK_USE, FK_COMPLETE, modeFlag,
3416 "declaration at top level not used",
3417 "An external declaration not used in any source file.", 0, 0
3420 FK_USE, FK_EXPORT, modeFlag,
3423 "a declaration is exported but not used outside this module",
3424 "A declaration is exported, but not used outside this module. "
3425 "Declaration can use static qualifier.",
3429 FK_USE, FK_EXPORT, modeFlag,
3432 "a declaration is exported but does not appear in a header file",
3433 "A declaration is exported, but does not appear in a header file.",
3437 FK_USE, FK_EXPORT, modeFlag,
3439 FLG_EXPORTHEADERVAR,
3440 "a variable declaration is exported but does not appear in a header file",
3441 "A variable declaration is exported, but does not appear in a header "
3442 "file. (Used with exportheader.)",
3446 FK_USE, FK_NONE, modeFlag,
3449 "field of structure type not used",
3450 "A field is present in a structure type but never used. Use /*@unused@*/ in front of field declaration to suppress message.",
3454 FK_USE, FK_NONE, modeFlag,
3457 "member of an enum type not used",
3458 "A member of an enum type is never used.",
3462 FK_USE, FK_NONE, modeFlag,
3465 "constant declared but not used",
3466 "A constant is declared but not used. Use unused in the constant declaration to suppress message.",
3470 FK_USE, FK_NONE, modeFlag,
3473 "function declared but not used",
3474 "A function is declared but not used. Use /*@unused@*/ in front of function header to suppress message.",
3478 FK_USE, FK_PARAMS, modeFlag,
3481 "function parameter not used ",
3482 "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.",
3486 FK_USE, FK_TYPE, modeFlag,
3489 "type declared but not used",
3490 "A type is declared but not used. Use /*@unused@*/ in front of typedef to suppress messages.",
3494 FK_USE, FK_NONE, modeFlag,
3497 "variable declared but not used",
3498 "A variable is declared but never used. Use /*@unused@*/ in front "
3499 "of declaration to suppress message.",
3504 FK_USE, FK_COMPLETE, modeFlag,
3507 "unused declaration in special file (corresponding to .l or .y file)",