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 (Splint 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,
359 FLG_SLASHSLASHCOMMENT,
360 "C++ style // comment",
361 "A C++ style // comment is used here. This type of comment has been officially supported in C99 and was often allowed by compiler extensions prior to this. However, some older C89 compilers are not able to handle these comments.",
365 FK_COMMENTS, FK_SYNTAX, plainFlag,
368 "comment begins inside comment",
369 "A comment open sequence (/*) appears within a comment. This usually "
370 "means an earlier comment was not closed.",
374 FK_COMMENTS, FK_SUPPRESS, modeFlag,
377 "interpret t comments (ignore errors in lines marked with /*@t<n>@*/",
381 FK_COMMENTS, FK_SUPPRESS, plainFlag,
384 "interpret traditional lint comments (/*FALLTHROUGH*/, /*NOTREACHED*/)",
388 FK_COMMENTS, FK_SUPPRESS, modeFlag,
390 FLG_WARNLINTCOMMENTS,
391 "print a warning and suggest an alternative when a traditional lint "
393 "A traditional lint comment is used. Some traditional lint comments "
394 "are interpreted by Splint to enable easier checking of legacy "
395 "code. It is preferable to replace these comments with the "
396 "suggested Splint alternative.",
400 FK_COMPLETE, FK_NONE, modeFlag,
403 "function or variable declared but never defined",
404 "A function or variable is declared, but not defined in any source code file.",
408 FK_COMPLETE, FK_SPEC, modeFlag,
411 "function or variable specified but never defined",
412 "A function or variable is declared in an .lcl file, but not defined in any source code file.",
416 FK_COMPLETE, FK_SPEC, plainFlag,
419 "function or variable specified but never declared in a source file",
420 "A function or variable is declared in an .lcl file, but not declared "
421 "in any source code file.",
425 FK_CONTROL, FK_MEMORY, modeFlag,
428 "assume all loops execute at least once",
432 FK_CONTROL, FK_NONE, plainFlag,
439 FK_CONTROL, FK_NONE, modeFlag,
442 "likely infinite loop is detected",
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 "Perhaps the specification of a function called in the loop "
446 "body is missing a modification.",
450 FK_CONTROL, FK_NONE, modeFlag,
453 "likely infinite loop is detected (may result from unconstrained function)",
454 "This appears to be an infinite loop. Nothing in the body of the "
455 "loop or the loop test modifies the value of the loop test. "
456 "There may be a modification through a call to an unconstrained "
457 "function, or an unconstrained function in the loop test may use "
458 "a global variable modified by the loop body.",
462 FK_CONTROL, FK_NONE, specialFlag,
465 "break inside nested while or for or switch",
466 "A break statement appears inside the body of a nested while, for or "
467 "switch statement. Sets looploopbreak, loopswitchbreak, "
468 "switchloopbreak, switchswitchbreak, and looploopcontinue.",
472 FK_CONTROL, FK_NONE, modeFlag,
475 "break inside nested while or for",
476 "A break statement appears inside the body of a nested while or for "
477 "statement. This is perfectly reasonable code, but check that "
478 "the break is intended to break only the inner loop. The "
479 "break statement may be preceded by /*@innerbreak@*/ to suppress "
480 "the message for this break only.",
484 FK_CONTROL, FK_NONE, modeFlag,
487 "break in loop inside switch",
488 "A break statement appears inside the body of a while or for "
489 "statement within a switch. This is perfectly reasonable code, but check that "
490 "the break is intended to break only the inner loop. The "
491 "break statement may be preceded by /*@loopbreak@*/ to suppress "
492 "the message for this break only.",
496 FK_CONTROL, FK_NONE, modeFlag,
499 "break in switch inside loop",
500 "A break statement appears inside a switch statement within a while or "
501 "for loop. This is perfectly reasonable code, but check that "
502 "the break is intended to break only the inner loop. The "
503 "break statement may be preceded by /*@switchbreak@*/ to suppress "
504 "the message for this break only.",
508 FK_CONTROL, FK_NONE, modeFlag,
510 FLG_SWITCHSWITCHBREAK,
511 "break in switch inside switch",
512 "A break statement appears inside a switch statement within another "
513 "switch statement. This is perfectly reasonable code, but check that "
514 "the break is intended to break only the inner switch. The "
515 "break statement may be preceded by /*@innerbreak@*/ to suppress "
516 "the message for this break only.",
520 FK_CONTROL, FK_NONE, modeFlag,
522 FLG_LOOPLOOPCONTINUE,
523 "continue inside nested loop",
524 "A continue statement appears inside a loop within a loop. "
525 "This is perfectly reasonable code, but check that "
526 "the continue is intended to continue only the inner loop. The "
527 "continue statement may be preceded by /*@innercontinue@*/ to suppress "
528 "the message for this continue only.",
532 FK_CONTROL, FK_NONE, modeFlag,
535 "unreachable code detected",
536 "This code will never be reached on any possible execution.",
540 FK_CONTROL, FK_NONE, modeFlag,
543 "a while statement has no body",
544 "While statement has no body.",
548 FK_CONTROL, FK_NONE, modeFlag,
551 "the body of a while statement is not a block",
552 "While body is a single statement, not a compound block.",
556 FK_CONTROL, FK_NONE, modeFlag,
559 "a for statement has no body",
560 "For statement has no body.",
564 FK_CONTROL, FK_NONE, modeFlag,
567 "the body of a for statement is not a block",
568 "Loop body is a single statement, not a compound block.",
572 FK_CONTROL, FK_NONE, modeFlag,
575 "an if statement has no body",
576 "If statement has no body.",
580 FK_CONTROL, FK_NONE, modeFlag,
583 "the body of an if statement is not a block",
584 "If body is a single statement, not a compound block.",
588 FK_CONTROL, FK_NONE, specialFlag,
591 "an if, while or for statement has no body (sets ifempty, "
592 "whileempty and forempty",
597 FK_CONTROL, FK_NONE, specialFlag,
600 "the body of an if, while or for statement is not a block "
601 "(sets ifblock, whileblock and forblock)",
602 "Body is a single statement, not a compound block.",
606 FK_CONTROL, FK_NONE, modeFlag,
609 "if ... else if chains must have final else",
610 "There is no final else following an else if construct.",
614 FK_CONTROL, FK_NONE, modeFlag,
617 "path with no return detected in non-void function",
618 "There is a path through a function declared to return a value on "
619 "which there is no return statement. This means the execution "
620 "may fall through without returning a meaningful result to "
625 FK_CONTROL, FK_NONE, modeFlag,
628 "non-empty case in a switch without preceding break",
629 "Execution falls through from the previous case.", 0, 0
632 FK_CONTROL, FK_NONE, modeFlag,
635 "switch on enum type missing case for some value",
636 "Not all values in an enumeration are present as cases in the switch.",
640 FK_CONTROL, FK_NONE, modeFlag,
643 "first statement in switch is not a case",
644 "The first statement after a switch is not a case.",
648 FK_DEBUG, FK_NONE, specialDebugFlag,
655 FK_DEBUG, FK_NONE, debugFlag,
662 FK_DECL, FK_NONE, modeFlag,
665 "declaration reuses name visible in outer scope",
666 "An outer declaration is shadowed by the local declaration.",
670 FK_DECL, FK_LIBS, modeFlag,
673 "function, variable or constant defined in a library is redefined with inconsistent type",
674 "A function, variable or constant previously defined in a library is "
675 "redefined with a different type.",
679 FK_DECL, FK_LIBS, modeFlag,
682 "library function overloaded",
683 "A function, variable or constant defined in the library is redefined "
684 "with a different type.",
688 FK_DECL, FK_NONE, modeFlag,
691 "an extern declaration is inside a function scope",
692 "An extern declaration is used inside a function scope.",
696 FK_DECL, FK_NONE, modeFlag,
699 "function or variable redeclared",
700 "A function or variable is declared in more than one place. This is "
701 "not necessarily a problem, since the declarations are consistent.",
705 FK_DECL, FK_NONE, plainFlag,
708 "function or variable redefined",
709 "A function or variable is redefined. One of the declarations should use extern.",
713 FK_DECL, FK_TYPE, modeFlag,
716 "function, variable or constant redefined with inconsistent type",
717 "A function, variable or constant is redefined with a different type.",
721 FK_DECL, FK_TYPE, modeFlag,
724 "variable declaration has unknown (implicitly int) type",
725 "A variable declaration has no explicit type. The type is implicitly int.",
729 FK_DECL, FK_TYPE, modeFlag,
732 "struct or enum type redefined with inconsistent fields or members",
733 "A struct, union or enum type is redefined with inconsistent fields or members.",
737 FK_DEF, FK_NONE, modeFlag,
740 "use before definition",
741 "An rvalue is used that may not be initialized to a value on some execution path.",
745 FK_DEF, FK_IMPLICIT, modeFlag,
748 "pointer parameters to unspecified functions may be implicit out parameters",
752 FK_DIRECT, FK_FILES, globalStringFlag,
755 "set directory for writing temp files",
759 FK_DIRECT, FK_FILES, globalStringFlag,
762 "set path for searching for library files (overrides LARCH_PATH environment variable)",
766 FK_DIRECT, FK_FILES, globalStringFlag,
769 "set directory to search for LCL import files (overrides LCLIMPORTDIR)",
773 FK_DIRECT, FK_FILES, globalStringFlag,
776 "set directories for system files (default /usr/include). Separate "
777 "directories with path separator (colons in Unix, semi-colons in Windows). "
778 "Flag settings propagate to files in a system directory. If "
779 "-sysdirerrors is set, no errors are reported for files in "
780 "system directories.",
784 FK_DIRECT, FK_FILES, plainFlag,
787 "prevent inclusion of header files in a system directory with "
788 "names that match standard ANSI headers. The symbolic information "
789 "in the standard library is used instead. Flag in effect only "
790 "if a library including the ANSI library is loaded. The ANSI "
791 "headers are: assert, ctype, errno, float, limits, locale, math, "
792 "setjmp, signal, stdarg, stddef, stdio, stdlib, strings, string, "
797 FK_DIRECT, FK_FILES, plainFlag,
799 FLG_SKIPPOSIXHEADERS,
800 "prevent inclusion of header files in a system directory with "
801 "names that match standard POSIX headers. The symbolic information "
802 "in the posix library is used instead. The POSIX headers are: "
803 "dirent, fcntl, grp, pwd, termios, sys/stat, sys/times, "
804 "sys/types, sys/utsname, sys/wait, unistd, and utime.",
808 FK_DIRECT, FK_SUPPRESS, modeFlag,
811 "report errors in files in system directories (set by -sysdirs)",
815 FK_HEADERS, FK_MACROS, plainFlag,
816 "sysdirexpandmacros",
818 "expand macros in system directories regardless of other settings, "
819 "except for macros corresponding to names defined in a load library",
824 FK_DIRECT, FK_HEADERS, globalExtraArgFlag,
827 "add to C include path",
831 FK_DIRECT, FK_SPEC, globalExtraArgFlag,
838 FK_DISPLAY, FK_ERRORS, plainFlag,
841 "suppress herald and error count",
845 FK_DISPLAY, FK_ERRORS, plainFlag,
848 "send error messages to standard error (instead of standard out)",
852 FK_DISPLAY, FK_ERRORS, plainFlag,
855 "show summary of all errors reported and suppressed",
859 FK_DISPLAY, FK_FILES, plainFlag,
862 "show file names are they are processed",
866 FK_DISPLAY, FK_NONE, globalFlag,
869 "display lines processed and time",
873 FK_DISPLAY, FK_NONE, globalFlag,
876 "display time distribution",
880 FK_DISPLAY, FK_USE, globalFlag,
883 "show sorted list of uses of all globals",
887 FK_EFFECT, FK_CONTROL, modeFlag,
890 "statement with no effect",
891 "Statement has no visible effect --- no values are modified.",
895 FK_EFFECT, FK_CONTROL, modeFlag,
898 "statement with no effect (except possibly through call to "
899 "unconstrained function)",
900 "Statement has no visible effect --- no values are modified. It may "
901 "modify something through a call to an unconstrained function.",
905 FK_EXPORT, FK_SPEC, specialFlag,
908 "variable, function or type exported but not specified",
909 "A variable, function or type is exported, but not specified.",
913 FK_EXPORT, FK_SPEC, modeFlag,
916 "function exported but not specified",
917 "A function is exported, but not specified.", 0, 0
920 FK_EXPORT, FK_SPEC, modeFlag,
923 "expanded macro exported but not specified",
924 "A macro is exported, but not specified.", 0, 0
927 FK_EXPORT, FK_SPEC, modeFlag,
930 "type definition exported but not specified",
931 "A type is exported, but not specified.", 0, 0
934 FK_EXPORT, FK_SPEC, modeFlag,
937 "variable exported but not specified",
938 "A variable is exported, but not specified.", 0, 0
941 FK_EXPORT, FK_SPEC, modeFlag,
944 "constant exported but not specified",
945 "A constant is exported, but not specified.", 0, 0
948 FK_EXPORT, FK_SPEC, modeFlag,
951 "constant exported but not specified",
952 "A constant is exported, but not specified.", 0, 0
955 FK_EXPOSURE, FK_ABSTRACT, specialFlag,
958 "abstract representation is exposed (sets assignexpose, retexpose, and castexpose)",
959 "The internal representation of an abstract type is visible to the "
960 "caller. This means clients may have access to a pointer "
961 "into the abstract representation.",
965 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
968 "abstract representation is exposed (return values only)",
969 "The return value shares storage with an instance of an abstract "
970 "type. This means clients may have access to a pointer into "
971 "the abstract representation. Use the observer qualifier to "
972 "return exposed storage that may not be modified by the "
973 "client. Use the exposed qualifier to return modifiable "
974 "(but not deallocatable) exposed storage (dangerous).",
978 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
981 "abstract representation is exposed (assignments only)",
982 "Storage internal to the representation of an abstract type is "
983 "assigned to an external pointer. This means clients may "
984 "have access to a pointer into the abstract representation. "
985 "If the external pointer is a parameter, the exposed qualifier "
986 "can be used to allow the assignment, however, this is "
987 "considered dangerous programming practice.",
991 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
994 "abstract representation is exposed through a cast",
995 "Storage internal to the representation of an abstract type is exposed "
996 "through a type cast. This means clients may have access to a "
997 "pointer into the abstract representation.",
1002 FK_FORMAT, FK_DISPLAY, valueFlag,
1005 "set length of messages (number of chars)",
1009 FK_FORMAT, FK_DISPLAY, valueFlag,
1012 "set number of spaces to indent sub-messages",
1016 FK_FORMAT, FK_DISPLAY, plainFlag,
1019 "show column number where error is found",
1023 FK_FORMAT, FK_DISPLAY, plainFlag,
1025 FLG_PARENFILEFORMAT,
1026 "show column number where error is found",
1030 FK_FORMAT, FK_NONE, plainFlag,
1033 "show name of function containing error",
1037 FK_FORMAT, FK_NONE, plainFlag,
1040 "show all possible types",
1041 "When a library function is declared with multiple possible type, the "
1042 "alternate types are shown only if +showallconjs.",
1046 FK_LIBS, FK_NONE, plainFlag,
1049 "make all alternate types implicit (useful for making system libraries",
1053 FK_GLOBAL, FK_ERRORS, globalValueFlag,
1056 "expect <int> code errors",
1060 FK_GLOBAL, FK_ERRORS, globalValueFlag,
1063 "expect <int> spec errors",
1067 FK_GLOBAL, FK_USE, idemSpecialFlag,
1070 "check as partial system (-specundef, -declundef, -exportlocal, "
1071 "don't check macros in headers without corresponding .c files)",
1075 FK_GLOBALS, FK_SPEC, plainFlag,
1078 "undocumented use of a checked global variable",
1079 "A checked global variable is used in the function, but not listed in "
1080 "its globals clause. By default, only globals specified in .lcl "
1081 "files are checked. To check all globals, use +allglobals. To "
1082 "check globals selectively use /*@checked@*/ in the global "
1087 FK_GLOBALS, FK_SPEC, modeFlag,
1090 "global listed for a function not used",
1091 "A global variable listed in the function's globals list is not used "
1092 "in the body of the function.",
1096 FK_GLOBALS, FK_NONE, modeFlag,
1099 "use of internalState",
1100 "A called function uses internal state, but the globals list for the "
1101 "function being checked does not include internalState",
1105 FK_GLOBALS, FK_NONE, modeFlag,
1106 "internalglobsnoglobs",
1107 FLG_INTERNALGLOBSNOGLOBS,
1108 "use of internalState (in function with no globals list)",
1109 "A called function uses internal state, but the function being checked "
1110 "has no globals list",
1114 FK_GLOBALS, FK_MODIFIES, modeFlag,
1116 FLG_WARNMISSINGGLOBALS,
1117 "global variable used in modifies clause is not listed in globals list",
1118 "A global variable is used in the modifies clause, but it not listed in "
1119 "the globals list. The variable will be added to the globals list.",
1124 FK_GLOBALS, FK_MODIFIES, modeFlag,
1125 "warnmissingglobsnoglobs",
1126 FLG_WARNMISSINGGLOBALSNOGLOBS,
1127 "global variable used in modifies clause in a function with no globals list",
1128 "A global variable is used in the modifies clause, but the function "
1129 "has no globals list. The variable will be added to the globals list.",
1133 FK_GLOBALS, FK_UNSPEC, modeFlag,
1136 "use of checked global in a function with no globals list or specification",
1137 "A specified global variable is used in the function, but not listed "
1138 "in its globals list. Without +globnoglobs, only globals "
1139 "declared with /*@checkedstrict@*/ will produce use "
1140 "errors in functions without globals "
1141 "lists. The /*@globals ... @*/ control comment can be used to give "
1142 "a globals list for an unspecified function.",
1146 FK_GLOBALS, FK_IMPLICIT, modeFlag,
1149 "report use and modification errors for globals not annotated with unchecked",
1153 FK_GLOBALS, FK_UNSPEC, modeFlag,
1155 FLG_CHECKSTRICTGLOBALS,
1156 "report use and modification errors for checkedstrict globals",
1160 FK_GLOBALS, FK_UNSPEC, modeFlag,
1161 "impcheckedspecglobs",
1162 FLG_IMPCHECKEDSPECGLOBALS,
1163 "assume checked qualifier for unqualified global declarations in .lcl files",
1167 FK_GLOBALS, FK_UNSPEC, modeFlag,
1168 "impcheckmodspecglobs",
1169 FLG_IMPCHECKMODSPECGLOBALS,
1170 "assume checkmod qualifier for unqualified global declarations in .lcl files",
1174 FK_GLOBALS, FK_UNSPEC, modeFlag,
1175 "impcheckedstrictspecglobs",
1176 FLG_IMPCHECKEDSTRICTSPECGLOBALS,
1177 "assume checkmod qualifier for unqualified global declarations in .lcl files",
1181 FK_GLOBALS, FK_UNSPEC, modeFlag,
1183 FLG_IMPCHECKEDGLOBALS,
1184 "assume checked qualifier for unqualified global declarations",
1188 FK_GLOBALS, FK_UNSPEC, modeFlag,
1190 FLG_IMPCHECKMODGLOBALS,
1191 "assume checkmod qualifier for unqualified global declarations",
1195 FK_GLOBALS, FK_UNSPEC, modeFlag,
1196 "impcheckedstrictglobs",
1197 FLG_IMPCHECKEDSTRICTGLOBALS,
1198 "assume checkedstrict qualifier for unqualified global declarations",
1202 FK_GLOBALS, FK_UNSPEC, modeFlag,
1203 "impcheckedstatics",
1204 FLG_IMPCHECKEDSTATICS,
1205 "assume checked qualifier for unqualified file static declarations",
1209 FK_GLOBALS, FK_UNSPEC, modeFlag,
1210 "impcheckmodstatics",
1211 FLG_IMPCHECKMODSTATICS,
1212 "assume checkmod qualifier for unqualified file static declarations",
1216 FK_GLOBALS, FK_UNSPEC, modeFlag,
1217 "impcheckmodinternals",
1218 FLG_IMPCHECKMODINTERNALS,
1219 "assume checkmod qualifier for unqualified local "
1220 "static declarations (for internal state modifications)",
1224 FK_GLOBALS, FK_UNSPEC, modeFlag,
1225 "impcheckedstrictstatics",
1226 FLG_IMPCHECKEDSTRICTSTATICS,
1227 "assume checkedstrict qualifier for unqualified file static declarations",
1231 FK_GLOBALS, FK_MODIFIES, modeFlag,
1234 "undocumented modification of a checked global variable",
1235 "A checked global variable is modified by the function, but not listed in "
1236 "its modifies clause.",
1240 FK_GLOBALS, FK_MODIFIES, modeFlag,
1243 "undocumented modification of a checked global variable in a function "
1244 "declared with no modifies clause",
1245 "A checked global variable is modified by the function, but not listed in "
1246 "its modifies clause.",
1250 FK_GLOBALS, FK_MODIFIES, modeFlag,
1251 "modstrictglobsnomods",
1252 FLG_MODSTRICTGLOBSUNSPEC,
1253 "undocumented modification of a strict checked global variable in a "
1254 "function declared with no modifies clause",
1255 "A checked global variable is modified by the function, but not listed in "
1256 "its modifies clause.",
1260 FK_GLOBALS, FK_MODIFIES, modeFlag,
1261 "modglobsunchecked",
1262 FLG_MODGLOBSUNCHECKED,
1263 "undocumented modification of an unchecked checked global variable",
1264 "An unchecked global variable is modified by the function, but not listed in "
1265 "its modifies clause.",
1269 FK_HEADERS, FK_DEBUG, debugFlag,
1276 FK_HEADERS, FK_SPEC, globalFlag,
1279 "generate .lh files", NULL,
1283 FK_HEADERS, FK_SPEC, globalFlag,
1286 "generate .lcs files", NULL,
1290 FK_HEADERS, FK_SPEED, globalFlag,
1293 "optimize header inclusion to eliminate redundant includes",
1294 "When checking multiple files, each header file is processed only "
1295 "once. This may change the meaning of the code, if the "
1296 "same header file is included in different contexts (e.g., the "
1297 "header file includes #if directives and the values are "
1298 "different when it is included in different places.)",
1302 FK_HEADERS, FK_SPEED, globalFlag,
1305 "optimize header inclusion to not include any header files",
1306 "Ignore header includes. Only works if relevant information is "
1307 "loaded from a library.",
1311 FK_HEADERS, FK_SPEED, globalFlag,
1314 "do not include header files in system directories (set by -sysdirs)",
1315 "Do not include header files in system directories (set by -sysdirs)",
1319 FK_HELP, FK_NONE, plainFlag,
1322 "warn when command line sets flag in abnormal way",
1323 "Command line sets flag in abnormal way",
1327 FK_HELP, FK_NONE, plainFlag,
1330 "warn when there are problems with reading the initialization files",
1331 "There was a problem reading an initialization file",
1335 FK_HELP, FK_NONE, plainFlag,
1338 "warn when the unix library is used",
1339 "Unix library may not be compatible with all platforms",
1343 FK_HELP, FK_NONE, plainFlag,
1346 "warn about bad command line flags",
1347 "A flag is not recognized or used in an incorrect way",
1351 FK_HELP, FK_NONE, plainFlag,
1354 "provide a hint for every warnings",
1355 "Provide a hint for every warning",
1359 FK_HELP, FK_NONE, globalExtraArgFlag,
1362 "-help <flags> will describe flags",
1367 FK_HELP, FK_FORMAT, plainFlag,
1370 "provide a hint the first time a particular warning appears",
1371 "Provide a hint the first time a particular warning appears",
1375 FK_IGNORERET, FK_NONE, specialFlag,
1378 "return value ignored (sets retvalint, retvalbool and retvalother)",
1379 "Result returned by function call is not used. If this is intended, "
1380 "cast result to (void) to eliminate message.",
1384 FK_IGNORERET, FK_BOOL, modeFlag,
1387 "return value of type other than bool or int ignored",
1388 "Result returned by function call is not used. If this is intended, "
1389 "can cast result to (void) to eliminate message.",
1393 FK_IGNORERET, FK_BOOL, modeFlag,
1396 "return value of manifest type bool ignored",
1397 "Result returned by function call is not used. If this is intended, "
1398 "can cast result to (void) to eliminate message.",
1402 FK_IGNORERET, FK_NONE, modeFlag,
1405 "return value of type int ignored",
1406 "Result returned by function call is not used. If this is intended, "
1407 "can cast result to (void) to eliminate message.",
1411 FK_INIT, FK_FILES, globalExtraArgFlag,
1414 "read an options file (default ~/.splintrc not loaded)",
1415 "Read an options file (instead of loading default ~/.splintc)",
1419 FK_INIT, FK_FILES, globalExtraArgFlag,
1422 "set LCL initilization file",
1426 FK_INIT, FK_FILES, globalFlag,
1429 "do not read options file",
1430 "Do not read the default options file (~/.splintrc)",
1434 FK_INIT, FK_SPEC, plainFlag,
1437 "information in specifications is not also included in syntactic comments",
1438 "There is information in the specification that is not duplicated "
1439 "in syntactic comments. Normally, this is not an "
1440 "error, but it may be useful to detect it to make "
1441 "sure checking incomplete systems without the specifications will "
1442 "still use this information.",
1446 FK_DECL, FK_LIBS, plainFlag,
1449 "report new global declarations in source files",
1450 "There is a new declaration that is not declared in a loaded library "
1451 "or earlier file. (Use this flag to check for consistency "
1452 "against a library.)",
1456 FK_ITER, FK_NONE, plainFlag,
1463 FK_ITER, FK_NONE, plainFlag,
1466 "iter declaration has no yield parameters",
1467 "An iterator has been declared with no parameters annotated with "
1468 "yield. This may be what you want, if the iterator is meant "
1469 "to do something a fixed number of times, but returns no "
1470 "information to the calling context. Probably, a parameter "
1471 "is missing the yield annotation to indicate that it is "
1472 "assigned a value in the calling context.",
1476 FK_LIBS, FK_FILES, globalStringFlag,
1479 "save state for merging (default suffix .lcd)",
1483 FK_LIBS, FK_FILES, globalStringFlag,
1486 "load state from dump file (default suffix .lcd)",
1490 FK_LIBS, FK_INIT, idemGlobalFlag,
1493 "do not load standard library",
1497 FK_LIBS, FK_INIT, globalFlag,
1500 "use ANSI (ISO) standard library",
1501 "Library based on the ANSI standard library specification is used.",
1505 FK_LIBS, FK_INIT, globalFlag,
1508 "interpret standard library strictly",
1509 "Stricter version of the standard library is used. (The default "
1510 "library is standard.lcd; strict library is strict.lcd.)",
1514 FK_LIBS, FK_INIT, globalFlag,
1517 "use UNIX (sort-of) standard library",
1518 "UNIX version of the standard library is used.",
1522 FK_LIBS, FK_INIT, globalFlag,
1525 "use strict version of UNIX (sort-of) library",
1526 "strict version of the UNIX library is used.",
1530 FK_LIBS, FK_INIT, globalFlag,
1533 "use POSIX standard library",
1534 "POSIX version of the standard library is used.",
1538 FK_LIBS, FK_INIT, globalFlag,
1541 "use strict POSIX standard library",
1542 "POSIX version of the strict standard library is used.",
1546 FK_LIBS, FK_INIT, globalFlag,
1549 "show standard library filename",
1553 FK_LIBS, FK_FILES, globalStringFlag,
1556 "load meta state declaration and corresponding xh file",
1560 FK_INIT, FK_COMMENTS, valueFlag,
1563 "set marker character for syntactic comments (default is '@')",
1564 "Set the marker character for syntactic comments. Comments beginning "
1565 "with /*<char> are interpreted by Splint, where <char> is the "
1566 "comment marker character.",
1570 FK_MACROS, FK_NONE, plainSpecialFlag,
1573 "sets fcnmacros and constmacros",
1574 "All macros (not preceded by /*@notfunction@*/) are checked as functions or "
1575 "constants depending on whether or not they have parameter lists.",
1579 FK_MACROS, FK_NONE, plainFlag,
1582 "check all macros with declarations in library as functions",
1583 "Every macro declared in the load library is checked.",
1587 FK_MACROS, FK_NONE, plainFlag,
1590 "check all macros corresponding to specified functions or constants",
1591 "Every macro declared a specification file is checked.",
1595 FK_MACROS, FK_NONE, plainFlag,
1598 "check all macros with parameter lists as functions",
1599 "Every parameterized macro (not preceded by /*@notfunction@*/) "
1600 "is checked as a function.",
1604 FK_MACROS, FK_NONE, plainFlag,
1607 "check all macros without parameter lists as constants",
1608 "Every non-parameterized macro (not preceded by /*@notfunction@*/) "
1609 "is checked as a constant.",
1613 FK_MACROS, FK_NONE, modeFlag,
1616 "macro definition does not match iter or constant declaration",
1617 "A iter or constant macro is defined using a different name from the "
1618 "one used in the previous syntactic comment",
1622 FK_MACROS, FK_NONE, plainFlag,
1625 "the line after a constant or iter declaration must be a macro definition",
1626 "A constant or iter declaration is not immediately followed by a macro definition.",
1630 FK_MACROS, FK_NONE, modeFlag,
1633 "macro definition is syntactically not equivalent to function",
1634 "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.",
1638 FK_MACROS, FK_NONE, modeFlag,
1641 "macro definition for is empty",
1642 "A macro definition has no body.",
1646 FK_MACROS, FK_PARAMS, modeFlag,
1649 "macro parameter not used exactly once",
1650 "A macro parameter is not used exactly once in all possible "
1651 "invocations of the macro. To behave like a function, "
1652 "each macro parameter must be used exactly once on all "
1653 "invocations of the macro so that parameters with "
1654 "side-effects are evaluated exactly once. Use /*@sef@*/ to "
1655 "denote parameters that must be side-effect free.",
1659 FK_MACROS, FK_PARAMS, modeFlag,
1662 "assignment to a macro parameter",
1663 "A macro parameter is used as the left side of an "
1664 "assignment expression. This exhibits behavior that "
1665 "could not be implemented by a function.",
1669 FK_MACROS, FK_PARAMS, modeFlag,
1672 "a parameter with side-effects is passed as a sef parameter",
1673 "An actual parameter corresponding to a sef parameter may have a side-effect.",
1677 FK_MACROS, FK_PARAMS, modeFlag,
1680 "a parameter with unconstrained side-effects is passed as a sef parameter",
1681 "An actual parameter corresponding to a sef parameter involves a call "
1682 "to a procedure with no modifies clause that may have a side-effect.",
1686 FK_MACROS, FK_NONE, modeFlag,
1689 "macro parameter used without parentheses (in potentially dangerous context)",
1690 "A macro parameter is used without parentheses. This could be "
1691 "dangerous if the macro is invoked with a complex expression "
1692 "and precedence rules will change the evaluation inside the macro.",
1696 FK_MACROS, FK_PROTOS, modeFlag,
1699 "macro without prototype or specification (sets macrofcndecl and macroconstdecl)",
1700 "Argument checking cannot be done well for macros without prototypes "
1701 "or specifications, since the types of the arguments are unknown.",
1705 FK_MACROS, FK_PROTOS, modeFlag,
1708 "parameterized macro without prototype or specification",
1709 "Function macro has no declaration.",
1713 FK_MACROS, FK_PROTOS, modeFlag,
1716 "non-parameterized macro without prototype or specification",
1717 "Macro constant has no declaration. Use /*@constant ...@*/ to "
1718 "declare the macro.",
1722 FK_MACROS, FK_NONE, modeFlag,
1726 "A macro is defined in more than one place.", 0, 0
1729 FK_MACROS, FK_UNRECOG, modeFlag,
1732 "unrecognized identifier in macro",
1733 "An unrecognized identifier appears in a macro. If the identifier "
1734 "is defined before the macro is used, then this is okay.",
1738 FK_MEMORY, FK_DEAD, modeFlag,
1741 "external reference to stack-allocated storage is created",
1742 "A stack reference is pointed to by an external reference when the "
1743 "function returns. The stack-allocated storage is destroyed "
1744 "after the call, leaving a dangling reference.",
1748 FK_MEMORY, FK_DEAD, modeFlag,
1751 "storage used after release",
1752 "Memory is used after it has been released (either by passing "
1753 "as an only param or assigning to an only global).",
1757 FK_MEMORY, FK_DEAD, modeFlag,
1758 "strictusereleased",
1759 FLG_STRICTUSERELEASED,
1760 "element used after it may have been released",
1761 "Memory (through fetch) is used after it may have been released "
1762 "(either by passing as an only param or assigning to an only global).",
1766 FK_MEMORY, FK_DEF, modeFlag,
1769 "parameter, return value or global completely defined",
1770 "Storage derivable from a parameter, return value or global is "
1771 "not defined. Use /*@out@*/ to denote passed or returned "
1772 "storage which need not be defined.",
1776 FK_MEMORY, FK_DEF, modeFlag,
1779 "actual parameter matches alias kind of formal parameter completely ",
1780 "Storage derivable from a parameter does not match the alias kind "
1781 "expected for the formal parameter.",
1785 FK_MEMORY, FK_DEF, modeFlag,
1788 "out storage not defined before return or scope exit",
1789 "An out parameter or global is not defined before control is transferred.",
1793 FK_MEMORY, FK_DEF, modeFlag,
1796 "at least one field of a union must be defined",
1797 "No field of a union is defined. Generally, one field of a union is "
1798 "expected to be defined.",
1802 FK_MEMORY, FK_IMPLICIT, modeFlag,
1805 "memory errors for unqualified storage",
1809 FK_MEMORY, FK_IMPLICIT, plainFlag,
1812 "assume unannotated parameter is temp",
1816 FK_MEMORY, FK_IMPLICIT, specialFlag,
1819 "sets globimponly, retimponly, structimponly, specglobimponly, "
1820 "specretimponly and specstructimponly",
1824 FK_MEMORY, FK_IMPLICIT, specialFlag,
1827 "sets globimponly, retimponly and structimponly",
1831 FK_MEMORY, FK_IMPLICIT, specialFlag,
1834 "sets specglobimponly, specretimponly and specstructimponly",
1838 FK_MEMORY, FK_IMPLICIT, plainFlag,
1841 "assume unannotated global storage is only",
1845 FK_MEMORY, FK_IMPLICIT, plainFlag,
1848 "assume unannotated returned storage is only",
1852 FK_MEMORY, FK_IMPLICIT, plainFlag,
1855 "assume unannotated structure field is only",
1859 FK_MEMORY, FK_IMPLICIT, plainFlag,
1861 FLG_SPECGLOBIMPONLY,
1862 "assume unannotated global storage is only",
1866 FK_MEMORY, FK_IMPLICIT, plainFlag,
1869 "assume unannotated returned storage is only",
1873 FK_MEMORY, FK_IMPLICIT, plainFlag,
1874 "specstructimponly",
1875 FLG_SPECSTRUCTIMPONLY,
1876 "assume unannotated structure field is only",
1880 FK_MEMORY, FK_ARRAY, modeFlag,
1883 "array elements are dependent storage",
1884 "When an element is fetched from an array, Splint analysis is "
1885 "not able to determine if the same element is reused. "
1886 "If +deparrays, Splint will mark local storage assigned from "
1887 "array fetches as dependent.",
1891 FK_MEMORY, FK_LEAK, modeFlag,
1894 "all only references derivable from void pointer out only parameter are released",
1895 "A storage leak due to incomplete deallocation of a structure or deep "
1896 "pointer is suspected. Unshared storage that is reachable from "
1897 "a reference that is being deallocated has not yet been deallocated. "
1898 "Splint assumes when an object is passed "
1899 "as an out only void pointer that the outer object will be "
1900 "deallocated, but the inner objects will not.",
1904 FK_MEMORY, FK_LEAK, modeFlag,
1907 "report complete destruction errors for array elements that "
1908 "may have been released",
1913 FK_MEMORY, FK_LEAK, modeFlag,
1916 "only storage not released before return or scope exit",
1917 "A memory leak has been detected. Newly-allocated or "
1918 "only-qualified storage is not released before the last "
1919 "reference to it is lost.",
1923 FK_MEMORY, FK_NONE, modeFlag,
1926 "storage has inconsistent states of alternate paths through a branch",
1927 "The state of a variable is different depending on which branch "
1928 "is taken. This means no annotation can sensibly be applied "
1933 FK_MEMORY, FK_NONE, modeFlag,
1934 "strictbranchstate",
1935 FLG_STRICTBRANCHSTATE,
1936 "storage through array fetch has inconsistent states of alternate "
1937 "paths through a branch",
1938 "The state of a variable through an array fetch is different depending "
1939 "on which branch is taken. This means no annotation can sensibly be applied "
1944 FK_MEMORY, FK_NONE, specialFlag,
1947 "sets all dynamic memory checking flags (memimplicit, mustfree, mustdefine, "
1948 "mustnotalias, null, memtrans)",
1952 FK_MEMORY, FK_NONE, specialFlag,
1955 "memory transfer errors (sets all *trans flags)",
1956 "Memory is transferred in a way that violates annotations.",
1960 FK_MEMORY, FK_NONE, modeFlag,
1963 "exposure transfer errors",
1964 "Exposed storage is transferred to a non-exposed, non-observer reference.",
1968 FK_MEMORY, FK_NONE, modeFlag,
1971 "observer transfer errors",
1972 "Observer storage is transferred to a non-observer reference.",
1976 FK_MEMORY, FK_NONE, modeFlag,
1979 "dependent transfer errors",
1980 "Dependent storage is transferred to a non-dependent reference.",
1984 FK_MEMORY, FK_NONE, modeFlag,
1987 "new reference transfer to reference counted reference",
1988 "A new reference is transferred to a reference counted reference.",
1992 FK_MEMORY, FK_NONE, modeFlag,
1995 "only storage transferred to non-only reference (memory leak)",
1996 "The only reference to this storage is transferred to another "
1997 "reference (e.g., by returning it) that does not have the "
1998 "only annotation. This may lead to a memory leak, since the "
1999 "new reference is not necessarily released.",
2003 FK_MEMORY, FK_NONE, modeFlag,
2004 "onlyunqglobaltrans",
2005 FLG_ONLYUNQGLOBALTRANS,
2006 "only storage transferred to an unqualified global or "
2007 "static reference (memory leak)",
2008 "The only reference to this storage is transferred to another "
2009 "reference that does not have an aliasing annotation. "
2010 "This may lead to a memory leak, since the "
2011 "new reference is not necessarily released.",
2015 FK_MEMORY, FK_NONE, modeFlag,
2018 "owned storage transferred to non-owned reference (memory leak)",
2019 "The owned reference to this storage is transferred to another "
2020 "reference (e.g., by returning it) that does not have the "
2021 "owned annotation. This may lead to a memory leak, since the "
2022 "new reference is not necessarily released.",
2026 FK_MEMORY, FK_NONE, modeFlag,
2029 "fresh storage transferred to non-only reference (memory leak)",
2030 "Fresh storage (newly allocated in this function) is transferred "
2031 "in a way that the obligation to release storage is not "
2032 "propagated. Use the /*@only@*/ annotation to indicate "
2033 "the a return value is the only reference to the returned "
2038 FK_MEMORY, FK_NONE, modeFlag,
2041 "shared storage transferred to non-shared reference",
2042 "Shared storage is transferred to a non-shared reference. The other "
2043 "reference may release storage needed by this reference.",
2047 FK_MEMORY, FK_NONE, modeFlag,
2050 "temp storage transferred to non-temporary reference",
2051 "Temp storage (associated with a formal parameter) is transferred "
2052 "to a non-temporary reference. The storage may be released "
2053 "or new aliases created.",
2057 FK_MEMORY, FK_NONE, modeFlag,
2060 "kept storage transferred to non-temporary reference",
2061 "Kept storage is transferred "
2062 "to a non-temporary reference. The storage may be released "
2063 "or new aliases created.",
2067 FK_MEMORY, FK_NONE, modeFlag,
2070 "keep storage transferred inconsistently",
2071 "Keep storage is transferred inconsistently --- either in a way "
2072 "that may add a new alias to it, or release it.",
2076 FK_MEMORY, FK_NONE, modeFlag,
2079 "an immediate address (result of &) is transferred inconsistently",
2080 "An immediate address (result of & operator) is transferred "
2085 FK_MEMORY, FK_NONE, modeFlag,
2088 "reference counted storage is transferred in an inconsistent way",
2089 "Reference counted storage is transferred in a way that may not "
2090 "be consistent with the reference count.",
2094 FK_MEMORY, FK_NONE, modeFlag,
2097 "static storage is transferred in an inconsistent way",
2098 "Static storage is transferred in an inconsistent way.",
2102 FK_MEMORY, FK_NONE, modeFlag,
2105 "unqualified storage is transferred in an inconsistent way",
2106 "Unqualified storage is transferred in an inconsistent way.",
2110 FK_MEMORY, FK_NONE, modeFlag,
2112 FLG_STATICINITTRANS,
2113 "static storage is used as an initial value in an inconsistent way",
2114 "Static storage is used as an initial value in an inconsistent way.",
2118 FK_MEMORY, FK_NONE, modeFlag,
2119 "unqualifiedinittrans",
2120 FLG_UNKNOWNINITTRANS,
2121 "unqualified storage is used as an initial value in an inconsistent way",
2122 "Unqualified storage is used as an initial value in an inconsistent way.",
2126 FK_MEMORY, FK_NONE, modeFlag,
2128 FLG_READONLYSTRINGS,
2129 "string literals are read-only (error if one is modified or released)",
2130 "String literals are read-only (ANSI semantics). An error is reported "
2131 "if a string literal may be modified or released.",
2135 FK_MEMORY, FK_NONE, modeFlag,
2138 "report memory transfer errors for initializations to read-only string literals",
2139 "A read-only string literal is assigned to a non-observer reference.",
2143 FK_MEMORY, FK_PARAMS, modeFlag,
2146 "passing a value as an un-annotated parameter clears its annotation",
2150 FK_MODIFIES, FK_SPEC, plainFlag,
2153 "unspecified modification of caller-visible state",
2154 "An externally-visible object is modified by a function, but not "
2155 "listed in its modifies clause.",
2159 FK_MODIFIES, FK_SPEC, modeFlag,
2162 "specified modification is not detected",
2163 "An object listed in the modifies clause is not modified by the "
2164 "implementation of the function. The modification may not "
2165 "be detected if it is done through a call to an unspecified "
2170 FK_MODIFIES, FK_MEMORY, plainFlag,
2173 "possible modification of observer storage",
2174 "Storage declared with observer is possibly modified. Observer "
2175 "storage may not be modified.",
2179 FK_MODIFIES, FK_MEMORY, modeFlag,
2181 FLG_MODOBSERVERUNCON,
2182 "possible modification of observer storage through unconstrained call",
2183 "Storage declared with observer may be modified through a call to an "
2184 "unconstrained function.",
2188 FK_MODIFIES, FK_MEMORY, modeFlag,
2189 "modinternalstrict",
2190 FLG_MODINTERNALSTRICT,
2191 "possible modification of internal storage through function call",
2192 "A function that modifies internalState is called from a function that "
2193 "does not list internalState in its modifies clause",
2197 FK_MODIFIES, FK_UNSPEC, modeFlag,
2200 "report undocumented file system modifications (applies to unspecified "
2201 "functions if modnomods is set)",
2205 FK_MODIFIES, FK_UNSPEC, specialFlag,
2208 "modification in unspecified functions (sets modnomods, "
2209 "modglobunspec and modstrictglobsunspec)",
2213 FK_MODIFIES, FK_UNSPEC, modeFlag,
2216 "modification in a function with no modifies clause",
2217 "An externally-visible object is modified by a function with no "
2218 "/*@modifies@*/ comment. The /*@modifies ... @*/ control "
2219 "comment can be used to give a modifies list for an "
2220 "unspecified function.",
2224 FK_MODIFIES, FK_UNSPEC, modeFlag,
2227 "possible modification through a call to an unconstrained function",
2228 "An unconstrained function is called in a function body where "
2229 "modifications are checked. Since the unconstrained function "
2230 "may modify anything, there may be undetected modifications in "
2231 "the checked function.",
2235 FK_MODIFIES, FK_UNSPEC, modeFlag,
2238 "possible modification through a call to an unconstrained function in "
2239 "a function with no modifies clause",
2240 "An unconstrained function is called in a function body where "
2241 "modifications are checked. Since the unconstrained function "
2242 "may modify anything, there may be undetected modifications in "
2243 "the checked function.",
2247 FK_MODIFIES, FK_GLOBALS, modeFlag,
2248 "globsimpmodsnothing",
2249 FLG_GLOBALSIMPMODIFIESNOTHING,
2250 "functions declared with a globals list but no modifies clause are "
2251 "assumed to modify nothing",
2252 "An implicit modifies nothing clause is assumed for a function "
2253 "declared with a globals list but not modifies clause.",
2257 FK_MODIFIES, FK_GLOBALS, modeFlag,
2259 FLG_MODIFIESIMPNOGLOBALS,
2260 "functions declared with a modifies clause but no globals list "
2261 "are assumed to use no globals",
2262 "An implicit empty globals list is assumed for a function "
2263 "declared with a modifies clause but no globals list.",
2267 FK_NAMES, FK_ABSTRACT, plainFlag,
2270 "controls name checking without changing other settings",
2274 FK_NAMES, FK_ABSTRACT, specialFlag,
2277 "czech naming convention (sets accessczech, czechfunctions, czechvars, "
2278 "czechconstants, czechenums, and czechmacros)",
2279 "Name is not consistent with Czech naming convention.", 0, 0
2282 FK_NAMES, FK_ABSTRACT, plainFlag,
2285 "czech naming convention violated in a function or iterator declaration",
2286 "Function or iterator name is not consistent with Czech naming convention.", 0, 0
2289 FK_NAMES, FK_ABSTRACT, plainFlag,
2292 "czech naming convention violated in a variable declaration",
2293 "Variable name is not consistent with Czech naming convention.", 0, 0
2296 FK_NAMES, FK_ABSTRACT, plainFlag,
2299 "czech naming convention violated in an expanded macro name",
2300 "Expanded macro name is not consistent with Czech naming convention.", 0, 0
2303 FK_NAMES, FK_ABSTRACT, plainFlag,
2306 "czech naming convention violated in a constant declaration",
2307 "Constant name is not consistent with Czech naming convention.", 0, 0
2310 FK_NAMES, FK_ABSTRACT, plainFlag,
2313 "czech naming convention violated in a user-defined type definition",
2314 "Type name is not consistent with Czech naming convention. Czech type "
2315 "names must not use the underscore character.", 0, 0
2318 FK_NAMES, FK_ABSTRACT, specialFlag,
2321 "slovak naming convention violated",
2322 "Name is not consistent with Slovak naming convention.", 0, 0
2325 FK_NAMES, FK_ABSTRACT, plainFlag,
2327 FLG_SLOVAKFUNCTIONS,
2328 "slovak naming convention violated in a function or iterator declaration",
2329 "Function or iterator name is not consistent with Slovak naming convention.", 0, 0
2332 FK_NAMES, FK_ABSTRACT, plainFlag,
2335 "slovak naming convention violated in an expanded macro name",
2336 "Expanded macro name is not consistent with Slovak naming convention.", 0, 0
2339 FK_NAMES, FK_ABSTRACT, plainFlag,
2342 "slovak naming convention violated in a variable declaration",
2343 "Variable name is not consistent with Slovak naming convention.", 0, 0
2346 FK_NAMES, FK_ABSTRACT, plainFlag,
2348 FLG_SLOVAKCONSTANTS,
2349 "slovak naming convention violated in a constant declaration",
2350 "Constant name is not consistent with Slovak naming convention.", 0, 0
2353 FK_NAMES, FK_ABSTRACT, plainFlag,
2356 "slovak naming convention violated in a use-defined type definition",
2357 "Type name is not consistent with Slovak naming convention. Slovak type "
2358 "names may not include uppercase letters.", 0, 0
2361 FK_NAMES, FK_ABSTRACT, specialFlag,
2364 "czech or slovak naming convention violated",
2365 "Name is not consistent with either Czech or Slovak naming convention.", 0, 0
2368 FK_NAMES, FK_ABSTRACT, plainFlag,
2370 FLG_CZECHOSLOVAKFUNCTIONS,
2371 "czechoslovak naming convention violated in a function or iterator declaration",
2372 "Function name is not consistent with Czechoslovak naming convention.", 0, 0
2375 FK_NAMES, FK_ABSTRACT, plainFlag,
2376 "czechoslovakmacros",
2377 FLG_CZECHOSLOVAKMACROS,
2378 "czechoslovak naming convention violated in an expanded macro name",
2379 "Expanded macro name is not consistent with Czechoslovak naming convention.", 0, 0
2382 FK_NAMES, FK_ABSTRACT, plainFlag,
2384 FLG_CZECHOSLOVAKVARS,
2385 "czechoslovak naming convention violated in a variable declaration",
2386 "Variable name is not consistent with Czechoslovak naming convention.", 0, 0
2389 FK_NAMES, FK_ABSTRACT, plainFlag,
2390 "czechoslovakconsts",
2391 FLG_CZECHOSLOVAKCONSTANTS,
2392 "czechoslovak naming convention violated in a constant declaration",
2393 "Constant name is not consistent with Czechoslovak naming convention.", 0, 0
2396 FK_NAMES, FK_ABSTRACT, plainFlag,
2397 "czechoslovaktypes",
2398 FLG_CZECHOSLOVAKTYPES,
2399 "czechoslovak naming convention violated in a user-defined type definition",
2400 "Type name is not consistent with Czechoslovak naming convention. Czechoslovak "
2401 "type names may not include uppercase letters or the underscore character.", 0, 0
2404 FK_NAMES, FK_ANSI, modeFlag,
2407 "external name conflicts with name reserved for system or standard library",
2408 "External name is reserved for system in ANSI standard.",
2412 FK_NAMES, FK_ANSI, modeFlag,
2415 "external or internal name is a C++ keyword or reserved word",
2416 "External name is a C++ keyword or reserved word. "
2417 "This could lead to problems if the "
2418 "code is compiled with a C++ compiler.",
2422 FK_NAMES, FK_ANSI, modeFlag,
2423 "ansireservedinternal",
2424 FLG_ANSIRESERVEDLOCAL,
2425 "internal name conflicts with name reserved for system or standard library",
2426 "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).",
2430 FK_NAMES, FK_ANSI, plainFlag,
2431 "distinctexternalnames",
2432 FLG_DISTINCTEXTERNALNAMES,
2433 "external name is not distinguishable from another external name using "
2434 "the number of significant characters",
2435 "An external name is not distinguishable from another external name "
2436 "using the number of significant characters. According to "
2437 "ANSI Standard (3.1), an implementation may only consider the first 6 "
2438 "characters significant, and ignore alphabetical case "
2439 "distinctions. The "
2440 "+externalnamelen <n> flag may be used to change the number "
2441 "of significant characters, and -externalnamecaseinsensitive to make "
2442 "alphabetical case significant in external names.",
2446 FK_NAMES, FK_ANSI, specialValueFlag,
2448 FLG_EXTERNALNAMELEN,
2449 "set the number of significant characters in an external name",
2450 "Sets the number of significant characters in an external name (ANSI "
2451 "default is 6.) Sets +distinctexternalnames.",
2455 FK_NAMES, FK_ANSI, plainSpecialFlag,
2456 "externalnamecaseinsensitive",
2457 FLG_EXTERNALNAMECASEINSENSITIVE,
2458 "alphabetic comparisons for external names are case-insensitive",
2459 "Make alphabetic case insignificant in external names. By ANSI "
2460 "standard, case need not be significant in an external name. "
2461 "If +distinctexternalnames is not set, sets "
2462 "+distinctexternalnames with unlimited external name length.",
2466 FK_NAMES, FK_ANSI, plainFlag,
2467 "distinctinternalnames",
2468 FLG_DISTINCTINTERNALNAMES,
2469 "internal name is not distinguishable from another internal name using "
2470 "the number of significant characters",
2471 "An internal name is not distinguishable from another internal name "
2472 "using the number of significant characters. According to "
2473 "ANSI Standard (3.1), an implementation may only consider the first 31 "
2474 "characters significant. The "
2475 "+internalnamelen <n> flag changes the number "
2476 "of significant characters, -internalnamecaseinsensitive to makes "
2477 "alphabetical case significant, and "
2478 "+internalnamelookalike to make similar-looking characters "
2483 FK_NAMES, FK_ANSI, specialValueFlag,
2485 FLG_INTERNALNAMELEN,
2486 "set the number of significant characters in an internal name",
2487 "Sets the number of significant characters in an internal name (ANSI "
2488 "default is 31.) Sets +distinctinternalnames.",
2492 FK_NAMES, FK_ANSI, plainSpecialFlag,
2493 "internalnamecaseinsensitive",
2494 FLG_INTERNALNAMECASEINSENSITIVE,
2495 "set whether case is significant an internal names "
2496 "(-internalnamecaseinsensitive means case is significant)" ,
2497 "Set whether case is significant an internal names "
2498 "(-internalnamecaseinsensitive "
2499 "means case is significant). By ANSI default, case is not "
2500 "significant. If +distinctinternalnames is not set, sets "
2501 "+distinctinternalnames with unlimited internal name length.",
2505 FK_NAMES, FK_ANSI, plainSpecialFlag,
2506 "internalnamelookalike",
2507 FLG_INTERNALNAMELOOKALIKE,
2508 "lookalike characters match in internal names",
2509 "Set whether similar looking characters (e.g., \"1\" and \"l\") "
2510 "match in internal names.",
2514 FK_NAMES, FK_PREFIX, idemStringFlag,
2517 "set namespace prefix for variables declared in a macro body",
2518 "A variable declared in a macro body does not start with the macrovarprefix.",
2522 FK_NAMES, FK_PREFIX, plainFlag,
2523 "macrovarprefixexclude",
2524 FLG_MACROVARPREFIXEXCLUDE,
2525 "the macrovarprefix may not be used for non-macro variables",
2526 "A variable declared outside a macro body starts with the macrovarprefix.",
2530 FK_NAMES, FK_PREFIX, idemStringFlag,
2533 "set namespace prefix for struct, union and enum tags",
2534 "A tag identifier does not start with the tagprefix.",
2538 FK_NAMES, FK_PREFIX, plainFlag,
2540 FLG_TAGPREFIXEXCLUDE,
2541 "the tagprefix may not be used for non-tag identifiers",
2542 "An identifier that is not a tag starts with the tagprefix.",
2546 FK_NAMES, FK_PREFIX, idemStringFlag,
2549 "set namespace prefix for enum members",
2550 "An enum member does not start with the enumprefix.",
2554 FK_NAMES, FK_PREFIX, plainFlag,
2555 "enumprefixexclude",
2556 FLG_ENUMPREFIXEXCLUDE,
2557 "the enumprefix may not be used for non-enum member identifiers",
2558 "An identifier that is not an enum member starts with the enumprefix.",
2562 FK_NAMES, FK_PREFIX, idemStringFlag,
2564 FLG_FILESTATICPREFIX,
2565 "set namespace prefix for file static declarations",
2566 "A file-static identifier does not start with the filestaticprefix.",
2570 FK_NAMES, FK_PREFIX, plainFlag,
2571 "filestaticprefixexclude",
2572 FLG_FILESTATICPREFIXEXCLUDE,
2573 "the filestaticprefix may not be used for identifiers that are not file static",
2574 "An identifier that is not file static starts with the filestaticprefix.",
2578 FK_NAMES, FK_PREFIX, idemStringFlag,
2581 "set namespace prefix for global variables",
2582 "A global variable does not start with the globalprefix",
2586 FK_NAMES, FK_PREFIX, plainFlag,
2587 "globalprefixexclude",
2588 FLG_GLOBPREFIXEXCLUDE,
2589 "the globalprefix may not be used for non-global identifiers",
2590 "An identifier that is not a global variable starts with the globalprefix.",
2594 FK_NAMES, FK_PREFIX, idemStringFlag,
2597 "set namespace prefix for user-defined types",
2598 "A user-defined type does not start with the typeprefix",
2602 FK_NAMES, FK_PREFIX, plainFlag,
2603 "typeprefixexclude",
2604 FLG_TYPEPREFIXEXCLUDE,
2605 "the typeprefix may not be used for identifiers that are not type names",
2606 "An identifier that is not a type name starts with the typeprefix.",
2610 FK_NAMES, FK_PREFIX, idemStringFlag,
2613 "set namespace prefix for external identifiers",
2614 "An external identifier does not start with the externalprefix",
2618 FK_NAMES, FK_PREFIX, plainFlag,
2619 "externalprefixexclude",
2620 FLG_EXTERNALPREFIXEXCLUDE,
2621 "the externalprefix may not be used for non-external identifiers",
2622 "An identifier that is not external starts with the externalprefix.",
2626 FK_NAMES, FK_PREFIX, idemStringFlag,
2629 "set namespace prefix for local variables",
2630 "A local variable does not start with the localprefix",
2634 FK_NAMES, FK_PREFIX, plainFlag,
2635 "localprefixexclude",
2636 FLG_LOCALPREFIXEXCLUDE,
2637 "the localprefix may not be used for non-local identifiers",
2638 "An identifier that is not a local variable starts with the localprefix.",
2642 FK_NAMES, FK_PREFIX, idemStringFlag,
2643 "uncheckedmacroprefix",
2644 FLG_UNCHECKEDMACROPREFIX,
2645 "set namespace prefix for unchecked macros",
2646 "An unchecked macro name does not start with the uncheckedmacroprefix",
2650 FK_NAMES, FK_PREFIX, plainFlag,
2651 "uncheckedmacroprefixexclude",
2652 FLG_UNCHECKEDMACROPREFIXEXCLUDE,
2653 "the uncheckmacroprefix may not be used for identifiers that are not "
2655 "An identifier that is not the name of an unchecked macro "
2656 "starts with the uncheckedmacroprefix.",
2660 FK_NAMES, FK_PREFIX, idemStringFlag,
2663 "set namespace prefix for constants",
2664 "A constant does not start with the constantprefix",
2668 FK_NAMES, FK_PREFIX, plainFlag,
2669 "constprefixexclude",
2670 FLG_CONSTPREFIXEXCLUDE,
2671 "the constprefix may not be used for non-constant identifiers",
2672 "An identifier that is not a constant starts with the constantprefix.",
2676 FK_NAMES, FK_PREFIX, idemStringFlag,
2679 "set namespace prefix for iterators",
2680 "An iter does not start with the iterator prefix",
2684 FK_NAMES, FK_PREFIX, plainFlag,
2685 "iterprefixexclude",
2686 FLG_ITERPREFIXEXCLUDE,
2687 "the iterprefix may not be used for non-iter identifiers",
2688 "An identifier that is not a iter starts with the iterprefix.",
2692 FK_NAMES, FK_PREFIX, idemStringFlag,
2694 FLG_DECLPARAMPREFIX,
2695 "set namespace prefix for parameters in function prototype declarations",
2696 "A parameter name in a function prototype declaration does not start with the "
2697 "declaration parameter prefix",
2701 FK_NAMES, FK_PREFIX, modeFlag,
2704 "a parameter in a function prototype has a name",
2705 "A parameter in a function prototype has a name. This is dangerous, "
2706 "since a macro definition could be visible here.",
2710 FK_NAMES, FK_PREFIX, modeFlag,
2713 "the name of a parameter in a function prototype and corresponding "
2714 "declaration must match (after removing the protoparamprefix",
2715 "A parameter in a function definition does not have the same name as "
2716 "the corresponding in the declaration of the function after "
2717 "removing the protoparamprefix",
2721 FK_NAMES, FK_PREFIX, plainFlag,
2722 "protoparamprefixexclude",
2723 FLG_DECLPARAMPREFIXEXCLUDE,
2724 "the protoparamprefix may not be used for non-declaraction parameter identifiers",
2725 "An identifier that is not a parameter name in a function prototype "
2726 "starts with the protoparamprefix.",
2730 FK_LIMITS, FK_ANSI, modeValueFlag,
2732 FLG_CONTROLNESTDEPTH,
2733 "set maximum nesting depth of compound statements, iteration control "
2734 "structures, and selection control structures (ANSI minimum is 15)",
2735 "Maximum number of control levels exceeded.",
2739 FK_LIMITS, FK_ANSI, modeValueFlag,
2741 FLG_STRINGLITERALLEN,
2742 "set maximum length of string literals (ANSI minimum is 509)",
2743 "Maximum length of string literal exceeded.",
2747 FK_LIMITS, FK_ANSI, modeValueFlag,
2749 FLG_NUMSTRUCTFIELDS,
2750 "set maximum number of fields in a struct or union (ANSI minimum is 127)",
2751 "Maximum number of fields in a struct or union exceeded.",
2755 FK_LIMITS, FK_ANSI, modeValueFlag,
2758 "set maximum number of members of an enum (ANSI minimum is 127)",
2759 "Limit on maximum number of members of an enum is exceeded.",
2763 FK_LIMITS, FK_ANSI, modeValueFlag,
2766 "set maximum number of nested #include files",
2767 "Maximum number of nested #include files exceeded.",
2771 FK_LIMITS, FK_ANSI, specialFlag,
2774 "check for violations of standard limits (controlnestdepth, "
2775 "stringliterallen, includenest, numstructfields, numenummembers)",
2780 FK_NAMES, FK_NONE, plainFlag,
2784 "Naming convention is violated.",
2788 FK_NONE, FK_NONE, plainFlag,
2795 FK_NULL, FK_MEMORY, specialFlag,
2798 "misuses of null pointer",
2799 "A possibly null pointer is misused (sets nullderef, nullpass, "
2800 "nullref, nullassign, and nullstate).",
2804 FK_NT, FK_MEMORY, modeFlag,
2807 "misuse of nullterminated allocation",
2808 "A possibly non-nullterminated string/memory is used/referenced as a nullterminated one, ",
2812 FK_NT, FK_MEMORY, modeFlag,
2815 "possible out of bounds read",
2816 "An array or pointer access references memory beyond the array or buffer, ",
2820 FK_NT, FK_MEMORY, modeFlag,
2823 "possible buffer overflow from an out of bounds write",
2824 "Memory is set past the end of an array or or after the allocated buffer, ",
2829 FK_NT, FK_MEMORY, modeFlag,
2832 "Function has the post condition",
2833 "Splint has determined that the following statement is true after the function, ",
2838 FK_NT, FK_MEMORY, modeFlag,
2840 FLG_PARENCONSTRAINT,
2841 "parenthesize constraint term",
2842 "This flag is for debugging. This flag causes Splint to fully parentheses constraints, ",
2847 FK_NT, FK_MEMORY, modeFlag,
2848 "debugfcnconstraint",
2849 FLG_DEBUGFUNCTIONCONSTRAINT,
2850 "debuging constraint flas",
2851 "This flag is for debuging. It causes Splint to perform buffer overflow checking even if the errors would be surpressed. Normally buffer overflow checking will only be performed if the errors would be printed. ",
2856 FK_NT, FK_MEMORY, modeFlag,
2859 "Possible out-of-bounds store. Unable to resolve constraint:",
2860 "Splint was unable to resolve a constraint at the top of the function. If code is correct consider using explict annotation assertions, ",
2864 FK_NT, FK_MEMORY, modeFlag,
2866 FLG_ARRAYBOUNDSREAD,
2867 "Possible out-of-bounds read. Unable to resolve constraint:",
2868 "Splint was unable to resolve a constraint at the top of the function. If code is correct consider using explict annotation assertions, ",
2873 FK_NT, FK_MEMORY, modeFlag,
2875 FLG_FUNCTIONCONSTRAINT,
2876 "unresolved constraint",
2877 "Splint was unable to resolve a constraint at the top of the function. If code is correct consider using explict annotation assertions, ",
2880 /*drl7x added 6/18/01 */
2882 FK_NT, FK_MEMORY, modeFlag,
2885 "unable to verify ensures annotation",
2886 "Splint was unable to determine that the function satisfies a post condition given in an ensures annotation, ",
2891 FK_NT, FK_MEMORY, modeFlag,
2892 "constraintlocation",
2893 FLG_CONSTRAINTLOCATION,
2894 "display full c expression for every constraint generated",
2897 },/*drl added flag 4/26/01*/
2899 FK_NT, FK_MEMORY, modeFlag,
2900 "implictconstraint",
2901 FLG_IMPLICTCONSTRAINT,
2902 "Try to generate implicit constraints for functions",
2906 /*drl7x added 4/29/01 */
2908 FK_NT, FK_MEMORY, modeFlag,
2911 "Use limited OR expressions to resolve constraints",
2917 FK_NT, FK_MEMORY, modeFlag,
2919 FLG_NULLTERMINATEDWARNING,
2920 "misuse of nullterminated allocation",
2921 "WARNING:A user annotated non-nullterminated buffer is used/referenced as a nullterminated one, ",
2925 FK_NULL, FK_MEMORY, modeFlag,
2928 "possible dereferencce of null pointer",
2929 "A possibly null pointer is dereferenced. Value is "
2930 "either the result of a function which may return null "
2931 "(in which case, code should check it is not null), or a "
2932 "global, parameter or structure field declared with the "
2937 FK_TYPE, FK_NONE, modeFlag,
2940 "dereferencce of a function type",
2941 "A function type is dereferenced. The ANSI standard allows this "
2942 "because of implicit conversion of function designators, however the "
2943 "dereference is unnecessary.",
2947 FK_NULL, FK_MEMORY, modeFlag,
2950 "possibly null pointer passed as formal with no null annotation",
2951 "A possibly null pointer is passed as a parameter corresponding to "
2952 "a formal parameter with no /*@null@*/ annotation. If NULL "
2953 "may be used for this parameter, add a /*@null@*/ annotation "
2954 "to the function parameter declaration.",
2958 FK_NULL, FK_MEMORY, modeFlag,
2961 "possibly null pointer returned as result with no null annotation",
2962 "Function returns a possibly null pointer, but is not declared "
2963 "using /*@null@*/ annotation of result. If function may "
2964 "return NULL, add /*@null@*/ annotation to the return "
2965 "value declaration.",
2969 FK_NULL, FK_MEMORY, modeFlag,
2972 "possibly null pointer reachable from a reference with no null annotation",
2973 "A possibly null pointer is reachable from a parameter or global "
2974 "variable that is not declared using a /*@null@*/ annotation.",
2978 FK_NULL, FK_MEMORY, modeFlag,
2981 "inconsistent assignment or initialization involving null pointer",
2982 "A reference with no null annotation is assigned or initialized "
2983 "to NULL. Use /*@null@*/ to declare the reference as "
2984 "a possibly null pointer.",
2988 FK_OPS, FK_BOOL, modeFlag,
2991 "comparison between bools (dangerous because of multiple TRUE values)",
2992 "Two bool values are compared directly using a C primitive. This "
2993 "may produce unexpected results since all non-zero values are "
2994 "considered TRUE, so different TRUE values may not be equal. "
2995 "The file bool.h (included in splint/lib) provides bool_equal "
2996 "for safe bool comparisons.", 0, 0
2999 FK_OPS, FK_NONE, modeFlag,
3002 "dangerous comparison between reals (dangerous because of inexact "
3003 "floating point representations)",
3004 "Two real (float, double, or long double) values are compared "
3005 "directly using a C primitive. "
3006 "This may produce unexpected results since floating point "
3007 "representations are inexact. Instead, compare the difference to "
3008 "FLT_EPSILON or DBL_EPSILON.",
3012 FK_OPS, FK_NONE, modeFlag,
3014 FLG_UNSIGNEDCOMPARE,
3015 "comparison using <, <=, >= between an unsigned integral and zero constant",
3016 "An unsigned value is used in a comparison with zero in a way that is either a bug or confusing.",
3020 FK_OPS, FK_POINTER, modeFlag,
3023 "arithmetic involving pointer and integer",
3024 "Pointer arithmetic using pointer and integer.", 0, 0
3027 FK_OPS, FK_POINTER, modeFlag,
3029 FLG_NULLPOINTERARITH,
3030 "arithmetic involving possibly null pointer and integer",
3031 "Pointer arithmetic using a possibly null pointer and integer.", 0, 0
3034 FK_OPS, FK_POINTER, modeFlag,
3037 "comparison between pointer and number",
3038 "A pointer is compared to a number.", 0, 0
3041 FK_OPS, FK_TYPE, modeFlag,
3044 "primitive operation does not type check strictly",
3045 "A primitive operation does not type check strictly.", 0, 0
3048 FK_OPS, FK_TYPE, modeFlag,
3051 "a bitwise logical operator does not have unsigned operands",
3052 "An operand to a bitwise operator is not an unsigned values. This "
3053 "may have unexpected results depending on the signed "
3054 "representations.", 0, 0
3057 FK_OPS, FK_TYPE, modeFlag,
3060 "a shift operator does not have unsigned operands",
3061 "An operand to a shift operator is not unsigned values. This "
3062 "may have unexpected results depending on the signed "
3063 "representations.", 0, 0
3066 FK_OPS, FK_BOOL, modeFlag,
3069 "primitive operation (!, && or ||) does not has a boolean argument",
3070 "The operand of a boolean operator is not a boolean. Use +ptrnegate "
3071 "to allow ! to be used on pointers.",
3075 FK_OPS, FK_POINTER, modeFlag,
3078 "allow ! to be used on pointer operand",
3079 "The operand of ! operator is a pointer.", 0, 0
3082 FK_OPS, FK_TYPE, modeFlag,
3085 "sizeof operator has a type argument",
3086 "Operand of sizeof operator is a type. (Safer to use expression, "
3087 "int *x = sizeof (*x); instead of sizeof (int).)",
3091 FK_OPS, FK_TYPE, plainFlag,
3092 "sizeofformalarray",
3093 FLG_SIZEOFFORMALARRAY,
3094 "sizeof operator has an array formal parameter argument",
3095 "Operand of a sizeof operator is a function parameter declared as "
3096 "an array. The value of sizeof will be the size of a pointer to the "
3097 "element type, not the number of elements in the array.",
3101 FK_DECL, FK_TYPE, plainFlag,
3103 FLG_FIXEDFORMALARRAY,
3104 "formal parameter of type array is declared with size",
3105 "A formal parameter is declared as an array with size. The size of the array "
3106 "is ignored in this context, since the array formal parameter is treated "
3111 FK_DECL, FK_TYPE, plainFlag,
3114 "formal parameter has an incomplete type",
3115 "A formal parameter is declared with an incomplete type.",
3119 FK_DECL, FK_TYPE, plainFlag,
3122 "formal parameter is an array",
3123 "A formal parameter is declared as an array. This can be confusing, since "
3124 "a formal array parameter is treated as a pointer.",
3128 FK_PRED, FK_BOOL, plainFlag,
3131 "condition test (if, while or for) is an assignment",
3132 "The condition test is an assignment expression. Probably, you mean "
3133 "to use == instead of =. If an assignment is intended, add an "
3134 "extra parentheses nesting (e.g., if ((a = b)) ...) to suppress "
3139 FK_PRED, FK_BOOL, specialFlag,
3142 "type of condition test (if, while or for) not bool (sets predboolint, "
3143 "predboolptr and predboolothers)",
3144 "Test expression type is not boolean.", 0, 0
3147 FK_PRED, FK_BOOL, modeFlag,
3150 "type of condition test (if, while or for) is an integral type",
3151 "Test expression type is not boolean or int.", 0, 0
3154 FK_PRED, FK_BOOL, modeFlag,
3157 "type of condition test (if, while or for) not bool, int or pointer",
3158 "Test expression type is not boolean.", 0, 0
3161 FK_PRED, FK_BOOL, modeFlag,
3164 "type of condition test (if, while or for) is a pointer",
3165 "Test expression type is not boolean.", 0, 0
3168 FK_PREPROC, FK_NONE, globalExtraArgFlag,
3171 "passed to pre-processor",
3175 FK_PREPROC, FK_NONE, globalExtraArgFlag,
3178 "passed to pre-processor",
3182 FK_PREPROC, FK_SYNTAX, plainFlag,
3183 "unrecognizeddirective",
3184 FLG_UNRECOGDIRECTIVE,
3185 "unrecognized pre-processor directive",
3186 "Pre-processor directive is not recognized.",
3190 FK_GLOBALS, FK_NONE, modeFlag,
3193 "returns with global in inconsistent state (null or undefined)",
3194 "A global variable does not satisfy its annotations when control is transferred.",
3198 FK_SUPPRESS, FK_COMMENTS, globalFlag,
3201 "The number of errors detected does not match number in /*@i<n>@*/.",
3205 FK_SUPPRESS, FK_ERRORS, valueFlag,
3208 "limit <int> consecutive repeated errors",
3212 FK_SYNTAX, FK_NONE, plainFlag,
3215 "syntax error in parsing",
3216 "Code cannot be parsed. For help on parse errors, see splint -help parseerrors.",
3220 FK_SYNTAX, FK_NONE, plainFlag,
3223 "try to recover from parse error",
3224 "Try to recover from parse error. It really means try - this doesn't usually work.", 0, 0
3227 FK_SYNTAX, FK_PREPROC, plainFlag,
3234 FK_TYPE, FK_NONE, plainFlag,
3238 "Types are incompatible.",
3242 FK_TYPE, FK_NONE, plainFlag,
3245 "initializer sets all fields",
3246 "Initializer does not set every field in the structure.",
3250 FK_TYPE, FK_NONE, plainFlag,
3252 FLG_INITALLELEMENTS,
3253 "initializer defines all array elements",
3254 "Initializer does not define all elements of a declared array.",
3258 FK_TYPE, FK_NONE, plainFlag,
3261 "initializer defines extra array elements",
3262 "Initializer block contains more elements than the size of a declared array.",
3266 FK_TYPE, FK_NONE, plainFlag,
3267 "stringliteraltoolong",
3268 FLG_STRINGLITTOOLONG,
3269 "string literal too long for character array",
3270 "A string literal is assigned to a char array too small to hold it.",
3274 FK_TYPE, FK_NONE, modeFlag,
3275 "stringliteralnoroom",
3276 FLG_STRINGLITNOROOM,
3277 "string literal leaves no room for null terminator",
3278 "A string literal is assigned to a char array that is not big enough to hold the null terminator.",
3282 FK_TYPE, FK_NONE, modeFlag,
3283 "stringliteralsmaller",
3284 FLG_STRINGLITSMALLER,
3285 "string literal is smaller than the char array it is assigned to",
3286 "A string literal is assigned to a char array that smaller than the string literal needs.",
3290 FK_TYPE, FK_NONE, modeFlag,
3293 "enum members must be int values",
3294 "Type of initial values for enum members must be int.",
3299 FK_TYPE, FK_NONE, plainFlag,
3302 "type of main does not match expected type",
3303 "The function main does not match the expected type.",
3307 FK_TYPE, FK_NONE, plainFlag,
3310 "type-mismatch in parameter corresponding to format code in a printf or scanf-like function",
3311 "Type of parameter is not consistent with corresponding code in format string.",
3315 FK_TYPE, FK_NONE, modeFlag,
3318 "format parameter is not a string constant (hence variable arguments cannot be typechecked)",
3319 "Format parameter is not known at compile-time. This can lead to security vulnerabilities because the arguments cannot be type checked.",
3323 FK_TYPE, FK_NONE, plainFlag,
3326 "invalid format code in format string for printf or scanf-like function",
3327 "Format code in a format string is not valid.",
3331 FK_TYPEEQ, FK_ABSTRACT, modeFlag,
3334 "forward declarations of pointers to abstract representation match abstract type",
3338 FK_TYPEEQ, FK_ABSTRACT, modeFlag,
3341 "void * matches pointers to abstract types, casting ok (dangerous)",
3342 "A pointer to void is cast to a pointer to an abstract type (or vice versa).",
3346 FK_TYPEEQ, FK_POINTER, plainFlag,
3349 "a pointer to a function is cast to a pointer to void (or vice versa)",
3350 "A pointer to a function is cast to (or used as) a pointer to void (or vice versa).",
3354 FK_TYPEEQ, FK_ARRAY, modeFlag,
3357 "char can be used to index arrays",
3358 "To allow char types to index arrays, use +charindex.", 0, 0
3361 FK_TYPEEQ, FK_ARRAY, modeFlag,
3364 "enum can be used to index arrays",
3365 "To allow enum types to index arrays, use +enumindex.", 0, 0
3368 FK_TYPEEQ, FK_BOOL, modeFlag,
3371 "bool and int are equivalent",
3372 "To make bool and int types equivalent, use +boolint.",
3376 FK_TYPEEQ, FK_NONE, modeFlag,
3379 "char and int are equivalent",
3380 "To make char and int types equivalent, use +charint.",
3384 FK_TYPEEQ, FK_NONE, modeFlag,
3387 "enum and int are equivalent",
3388 "To make enum and int types equivalent, use +enumint.",
3392 FK_TYPEEQ, FK_NONE, modeFlag,
3395 "float and double are equivalent",
3396 "To make float and double types equivalent, use +floatdouble.",
3400 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3403 "ignore type qualifiers (long, short, unsigned)",
3404 "To ignore type qualifiers in type comparisons use +ignorequals.",
3408 FK_TYPEEQ, FK_SYNTAX, plainFlag,
3411 "report duplicate type qualifiers (e.g., long long)",
3412 "Duplicate type qualifiers not supported by ANSI. Some "
3413 "compilers (e.g., gcc) do support duplicate qualifiers.",
3417 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3420 "ignore signs in type comparisons (unsigned matches signed)",
3421 "To ignore signs in type comparisons use +ignoresigns",
3425 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3428 "int literals can be reals",
3429 "An int literal is used as any numeric type (including float and long long). Use +numliteral to "
3430 "allow int literals to be used as any numeric type.",
3434 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3437 "character constants (e.g., 'a') can be used as ints",
3438 "A character constant is used as an int. Use +charintliteral to "
3439 "allow character constants to be used as ints. (This is safe "
3440 "since the actual type of a char constant is int.)",
3444 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3447 "report qualifier mismatches only if dangerous",
3448 "To allow qualifier mismatches that are not dangerous, use +relaxquals.", 0, 0
3451 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3454 "allow all numeric types to match",
3455 "To allow all numeric types to match, use +relaxtypes.", 0, 0
3458 FK_TYPEEQ, FK_NONE, modeFlag,
3460 FLG_CHARUNSIGNEDCHAR,
3461 "allow char and unsigned char types to match",
3462 "To allow char and unsigned char types to match use +charunsignedchar.",
3466 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3468 FLG_MATCHANYINTEGRAL,
3469 "allow any intergral type to match an arbitrary integral type (e.g., dev_t)",
3470 "To allow arbitrary integral types to match any integral type, use +matchanyintegral.",
3474 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3475 "longunsignedintegral",
3476 FLG_LONGUNSIGNEDINTEGRAL,
3477 "allow long unsigned type to match an arbitrary integral type (e.g., dev_t)",
3478 "To allow arbitrary integral types to match long unsigned, use +longunsignedintegral.",
3482 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3485 "allow long type to match an arbitrary integral type (e.g., dev_t)",
3486 "To allow arbitrary integral types to match long unsigned, use +longintegral.",
3490 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3491 "longunsignedunsignedintegral",
3492 FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL,
3493 "allow long unsigned type to match an arbitrary unsigned integral type (e.g., size_t)",
3494 "To allow arbitrary unsigned integral types to match long unsigned, "
3495 "use +longunsignedunsignedintegral.",
3499 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3500 "longsignedintegral",
3501 FLG_LONGSIGNEDINTEGRAL,
3502 "allow long type to match an arbitrary signed integral type (e.g., ssize_t)",
3503 "To allow arbitrary signed integral types to match long unsigned, use +longsignedintegral.",
3507 FK_TYPEEQ, FK_POINTER, plainFlag,
3510 "0 is treated as a pointer",
3514 FK_TYPEEQ, FK_BOOL, modeFlag,
3517 "0 is treated as a boolean",
3521 FK_UNRECOG, FK_DISPLAY, plainFlag,
3524 "do not suppress repeated unrecognized identifier messages (instead of only reporting the first error)",
3525 "Identifier used in code has not been declared. (Message repeated for future uses in this file.)",
3529 FK_UNRECOG, FK_DISPLAY, plainFlag,
3532 "report unrecognized identifiers with system (__) prefix",
3533 "Identifier used in code has not been declared. (Message repeated for "
3534 "future uses in this file.) Use +gnuextensions to make Splint "
3535 "recognize some keywords that are gnu extensions.",
3539 FK_UNRECOG, FK_NONE, plainFlag,
3542 "unrecognized identifier",
3543 "Identifier used in code has not been declared.", 0, 0
3546 FK_USE, FK_COMPLETE, modeFlag,
3549 "declaration at top level not used",
3550 "An external declaration not used in any source file.", 0, 0
3553 FK_USE, FK_EXPORT, modeFlag,
3556 "a declaration is exported but not used outside this module",
3557 "A declaration is exported, but not used outside this module. "
3558 "Declaration can use static qualifier.",
3562 FK_USE, FK_EXPORT, modeFlag,
3565 "a declaration is exported but does not appear in a header file",
3566 "A declaration is exported, but does not appear in a header file.",
3570 FK_USE, FK_EXPORT, modeFlag,
3572 FLG_EXPORTHEADERVAR,
3573 "a variable declaration is exported but does not appear in a header file",
3574 "A variable declaration is exported, but does not appear in a header "
3575 "file. (Used with exportheader.)",
3579 FK_USE, FK_NONE, modeFlag,
3582 "field of structure type not used",
3583 "A field is present in a structure type but never used. Use /*@unused@*/ in front of field declaration to suppress message.",
3587 FK_USE, FK_NONE, modeFlag,
3590 "member of an enum type not used",
3591 "A member of an enum type is never used.",
3595 FK_USE, FK_NONE, modeFlag,
3598 "constant declared but not used",
3599 "A constant is declared but not used. Use unused in the constant declaration to suppress message.",
3603 FK_USE, FK_NONE, modeFlag,
3606 "function declared but not used",
3607 "A function is declared but not used. Use /*@unused@*/ in front of function header to suppress message.",
3611 FK_USE, FK_PARAMS, modeFlag,
3614 "function parameter not used ",
3615 "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.",
3619 FK_USE, FK_TYPE, modeFlag,
3622 "type declared but not used",
3623 "A type is declared but not used. Use /*@unused@*/ in front of typedef to suppress messages.",
3627 FK_USE, FK_NONE, modeFlag,
3630 "variable declared but not used",
3631 "A variable is declared but never used. Use /*@unused@*/ in front "
3632 "of declaration to suppress message.",
3636 FK_USE, FK_COMPLETE, modeFlag,
3639 "unused declaration in special file (corresponding to .l or .y file)",
3643 FK_DECL, FK_TYPE, modeFlag,
3644 "redundantsharequal",
3645 FLG_REDUNDANTSHAREQUAL,
3646 "declaration uses observer qualifier that is always true",
3647 "A declaration of an immutable object uses a redundant observer qualifier.",
3651 FK_DECL, FK_TYPE, modeFlag,
3652 "misplacedsharequal",
3653 FLG_MISPLACEDSHAREQUAL,
3654 "declaration of unsharable storage uses sharing annotation",
3655 "A declaration of an unsharable object uses a sharing annotation.",
3659 FK_DECL, FK_TYPE, plainFlag,
3661 FLG_ANNOTATIONERROR,
3662 "annotation is used in inconsistent location",
3663 "A declaration uses an invalid annotation.",
3667 FK_DECL, FK_TYPE, plainFlag,
3670 "inconsistent syntactic comment",
3671 "A syntactic comment is used inconsistently.",
3675 FK_DEBUG, FK_NONE, debugFlag,
3682 FK_DEBUG, FK_NONE, valueFlag,
3685 "set maximum number of bugs detected before giving up",
3690 FK_HELP, FK_NONE, plainFlag,
3693 "warn when command line file does not have a recognized extension",
3697 FK_DECL, FK_NONE, plainFlag,
3700 "warn when declaration marked with warn is used",
3701 "Declaration marked with warn clause is used (can be suppresed by more specific flags).",
3705 FK_MEMORY, FK_DEF, modeFlag,
3708 "storage has been transfered with invalid state",
3709 "Transfer violates user-defined state rules.",
3713 FK_MEMORY, FK_DEF, modeFlag,
3716 "control paths merge with storage in incompatible states",
3717 "Control path merge violates user-defined state merge rules.",
3722 ** The its4 level flags must appear in order.
3726 FK_WARNUSE, FK_SECURITY, specialFlag,
3729 "most risky security vulnerabilities (from its4 database)",
3730 "Security vulnerability classified as most risky in its4 database.",
3734 FK_WARNUSE, FK_SECURITY, specialFlag,
3737 "very risky security vulnerabilities (from its4 database)",
3738 "Security vulnerability classified as very risky in its4 database.",
3742 FK_WARNUSE, FK_SECURITY, specialFlag,
3745 "risky security vulnerabilities (from its4 database)",
3746 "Security vulnerability classified as risky in its4 database.",
3750 FK_WARNUSE, FK_SECURITY, specialFlag,
3752 FLG_ITS4MODERATERISK,
3753 "moderately risky security vulnerabilities (from its4 database)",
3754 "Security vulnerability classified as moderate risk in its4 database.",
3758 FK_WARNUSE, FK_SECURITY, specialFlag,
3761 "risky security vulnerabilities (from its4 database)",
3762 "Security vulnerability classified as risky in its4 database.",
3767 ** End of its4 level flags
3771 FK_WARNUSE, FK_SECURITY, modeFlag,
3772 "bufferoverflowhigh",
3773 FLG_BUFFEROVERFLOWHIGH,
3774 "likely buffer overflow vulnerability",
3775 "Use of function that may lead to buffer overflow.",
3779 FK_WARNUSE, FK_SECURITY, modeFlag,
3782 "possible buffer overflow vulnerability",
3783 "Use of function that may lead to buffer overflow.",
3787 FK_WARNUSE, FK_SECURITY, modeFlag,
3790 "possible time of check, time of use vulnerability",
3791 "Possible time of check, time of use vulnerability.",
3795 FK_WARNUSE, FK_SECURITY, modeFlag,
3798 "function is not reentrant",
3799 "Non-reentrant function should not be used in multithreaded code.",
3803 FK_WARNUSE, FK_SECURITY, modeFlag,
3806 "function may have undefined behavior",
3807 "Use of function that may have implementation-dependent behavior.",
3811 FK_WARNUSE, FK_SECURITY, modeFlag,
3814 "function is not required in Standard UNIX Specification",
3815 "Use of function that need not be provided by UNIX implementations",
3819 FK_WARNUSE, FK_SECURITY, modeFlag,
3822 "function is restricted to superusers",
3823 "Call to function restricted to superusers.",
3827 FK_WARNUSE, FK_SECURITY, modeFlag,
3828 "implementationoptional",
3829 FLG_IMPLEMENTATIONOPTIONAL,
3830 "declarator is implementation optional (ISO99 does not require an implementation to provide it)",
3831 "Use of a declarator that is implementation optional, not required by ISO99.",
3835 FK_WARNUSE, FK_NONE, modeFlag,
3838 "legacy declaration in Unix Standard",
3839 "Use of a declarator that is marked as a legacy entry in the Unix Standard.",