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_NUMBER
25 # define charFlag FALSE, FALSE, FALSE, FALSE, ARG_CHAR
28 # define modeValueFlag FALSE, FALSE, FALSE, TRUE, ARG_NUMBER
30 # define specialValueFlag TRUE, FALSE, FALSE, FALSE, ARG_NUMBER
32 # define debugFlag FALSE, TRUE, FALSE, FALSE, ARG_NONE
34 # define debugValueFlag FALSE, TRUE, FALSE, FALSE, ARG_NUMBER
36 # define specialDebugFlag TRUE, TRUE, FALSE, FALSE, ARG_NONE
38 # define globalFlag FALSE, FALSE, TRUE, FALSE, ARG_NONE
40 # define idemGlobalFlag FALSE, TRUE, TRUE, FALSE, ARG_NONE
42 # define globalValueFlag FALSE, FALSE, TRUE, FALSE, ARG_NUMBER
44 /* Note: type argument missing */
46 # define regStringFlag FALSE, FALSE, FALSE, FALSE
48 # define idemStringFlag FALSE, TRUE, FALSE, FALSE
50 # define globalStringFlag FALSE, FALSE, TRUE, FALSE
53 # define extraArgFlag FALSE, FALSE, FALSE, FALSE, ARG_SPECIAL
55 # define globalExtraArgFlag FALSE, FALSE, TRUE, FALSE, ARG_SPECIAL
57 # define globalFileFlag FALSE, TRUE, TRUE, FALSE, ARG_FILE
61 ** Note: the flag code must be on a separate line, since I'm
62 ** too stupid to write an awk/sed/whatever script that can separate
66 static flaglist flags =
69 ** Null Dereferences (Manual Section 2)
73 FK_NULL, FK_MEMORY, specialFlag,
76 "misuses of null pointer",
77 "A possibly null pointer is misused (sets nullderef, nullpass, "
78 "nullref, nullassign, and nullstate).",
82 FK_NULL, FK_MEMORY, modeFlag,
85 "possible dereferencce of null pointer",
86 "A possibly null pointer is dereferenced. Value is "
87 "either the result of a function which may return null "
88 "(in which case, code should check it is not null), or a "
89 "global, parameter or structure field declared with the "
94 FK_NULL, FK_MEMORY, modeFlag,
97 "possibly null pointer passed as formal with no null annotation",
98 "A possibly null pointer is passed as a parameter corresponding to "
99 "a formal parameter with no /*@null@*/ annotation. If NULL "
100 "may be used for this parameter, add a /*@null@*/ annotation "
101 "to the function parameter declaration.",
105 FK_NULL, FK_MEMORY, modeFlag,
108 "possibly null pointer returned as result with no null annotation",
109 "Function returns a possibly null pointer, but is not declared "
110 "using /*@null@*/ annotation of result. If function may "
111 "return NULL, add /*@null@*/ annotation to the return "
112 "value declaration.",
116 FK_NULL, FK_MEMORY, modeFlag,
119 "possibly null pointer reachable from a reference with no null annotation",
120 "A possibly null pointer is reachable from a parameter or global "
121 "variable that is not declared using a /*@null@*/ annotation.",
125 FK_NULL, FK_MEMORY, modeFlag,
128 "inconsistent assignment or initialization involving null pointer",
129 "A reference with no null annotation is assigned or initialized "
130 "to NULL. Use /*@null@*/ to declare the reference as "
131 "a possibly null pointer.",
135 FK_NULL, FK_MEMORY, plainFlag,
138 "inconsistent initialization involving null pointer",
139 "A reference with no null annotation is initialized "
140 "to NULL. Use /*@null@*/ to declare the reference as "
141 "a possibly null pointer.",
146 ** Undefined Values (Section 3)
150 FK_DEF, FK_NONE, modeFlag,
153 "use before definition",
154 "An rvalue is used that may not be initialized to a value on some execution path.",
158 FK_MEMORY, FK_DEF, modeFlag,
161 "out storage not defined before return or scope exit",
162 "An out parameter or global is not defined before control is transferred.",
166 FK_MEMORY, FK_DEF, modeFlag,
169 "at least one field of a union must be defined",
170 "No field of a union is defined. Generally, one field of a union is "
171 "expected to be defined.",
175 FK_MEMORY, FK_DEF, modeFlag,
178 "parameter, return value or global completely defined",
179 "Storage derivable from a parameter, return value or global is "
180 "not defined. Use /*@out@*/ to denote passed or returned "
181 "storage which need not be defined.",
185 FK_DEF, FK_NONE, plainFlag,
188 "initializer sets all fields",
189 "Initializer does not set every field in the structure.",
193 FK_DEF, FK_NONE, plainFlag,
196 "initializer defines all array elements",
197 "Initializer does not define all elements of a declared array.",
201 FK_DEF, FK_NONE, plainFlag,
204 "initializer defines extra array elements",
205 "Initializer block contains more elements than the size of a declared array.",
210 FK_DEF, FK_IMPLICIT, modeFlag,
213 "pointer parameters to unspecified functions may be implicit out parameters",
222 FK_DECL, FK_TYPE, modeFlag,
225 "function, variable or constant redefined with inconsistent type",
226 "A function, variable or constant is redefined with a different type.",
230 FK_DECL, FK_TYPE, modeFlag,
233 "struct or enum type redefined with inconsistent fields or members",
234 "A struct, union or enum type is redefined with inconsistent fields or members.",
238 FK_TYPE, FK_NONE, modeFlag,
241 "dereferencce of a function type",
242 "A function type is dereferenced. The ANSI standard allows this "
243 "because of implicit conversion of function designators, however the "
244 "dereference is unnecessary.",
248 FK_OPS, FK_NONE, modeFlag,
251 "dangerous comparison between reals (dangerous because of inexact "
252 "floating point representations)",
253 "Two real (float, double, or long double) values are compared "
254 "directly using a C primitive. "
255 "This may produce unexpected results since floating point "
256 "representations are inexact. Instead, compare the difference to "
257 "FLT_EPSILON or DBL_EPSILON.",
261 FK_OPS, FK_NONE, modeFlag,
264 "comparison using <, <=, >= between an unsigned integral and zero constant",
265 "An unsigned value is used in a comparison with zero in a way that is either a bug or confusing.",
269 FK_OPS, FK_POINTER, modeFlag,
272 "arithmetic involving pointer and integer",
273 "Pointer arithmetic using pointer and integer.", 0, 0
276 FK_OPS, FK_POINTER, modeFlag,
278 FLG_NULLPOINTERARITH,
279 "arithmetic involving possibly null pointer and integer",
280 "Pointer arithmetic using a possibly null pointer and integer.", 0, 0
283 FK_OPS, FK_POINTER, modeFlag,
286 "comparison between pointer and number",
287 "A pointer is compared to a number.", 0, 0
290 FK_OPS, FK_TYPE, modeFlag,
293 "primitive operation does not type check strictly",
294 "A primitive operation does not type check strictly.", 0, 0
297 FK_OPS, FK_TYPE, modeFlag,
300 "a bitwise logical operator does not have unsigned operands",
301 "An operand to a bitwise operator is not an unsigned values. This "
302 "may have unexpected results depending on the signed "
303 "representations.", 0, 0
306 FK_OPS, FK_TYPE, modeFlag,
309 "a shift right operand may be negative",
310 "The right operand to a shift operator may be negative (behavior undefined).",
314 FK_OPS, FK_TYPE, modeFlag,
315 "shiftimplementation",
316 FLG_SHIFTIMPLEMENTATION,
317 "a shift left operand may be negative",
318 "The left operand to a shift operator may be negative (behavior is implementation-defined).",
322 FK_OPS, FK_TYPE, modeFlag,
325 "sizeof operator has a type argument",
326 "Operand of sizeof operator is a type. (Safer to use expression, "
327 "int *x = sizeof (*x); instead of sizeof (int).)",
331 FK_OPS, FK_TYPE, plainFlag,
333 FLG_SIZEOFFORMALARRAY,
334 "sizeof operator has an array formal parameter argument",
335 "Operand of a sizeof operator is a function parameter declared as "
336 "an array. The value of sizeof will be the size of a pointer to the "
337 "element type, not the number of elements in the array.",
341 FK_DECL, FK_TYPE, plainFlag,
343 FLG_FIXEDFORMALARRAY,
344 "formal parameter of type array is declared with size",
345 "A formal parameter is declared as an array with size. The size of the array "
346 "is ignored in this context, since the array formal parameter is treated "
351 FK_DECL, FK_TYPE, plainFlag,
354 "formal parameter has an incomplete type",
355 "A formal parameter is declared with an incomplete type.",
359 FK_DECL, FK_TYPE, plainFlag,
362 "formal parameter is an array",
363 "A formal parameter is declared as an array. This can be confusing, since "
364 "a formal array parameter is treated as a pointer.",
374 FK_BOOL, FK_NONE, regStringFlag, ARG_STRING,
377 "set name of boolean type (default bool)",
381 FK_BOOL, FK_NONE, regStringFlag, ARG_STRING,
384 "set name of boolean false (default false)",
388 FK_BOOL, FK_NONE, regStringFlag, ARG_STRING,
391 "set name of boolean true (default true)",
395 FK_BOOL, FK_HELP, plainFlag,
398 "type name is probably a boolean type but does not match default "
399 "boolean type name, \"bool\", and alternate name is not set",
400 "Use the -booltype, -boolfalse and -booltrue flags to change the "
401 "name of the default boolean type.",
406 FK_BOOL, FK_OPS, modeFlag,
409 "comparison between bools (dangerous because of multiple true values)",
410 "Two bool values are compared directly using a C primitive. This "
411 "may produce unexpected results since all non-zero values are "
412 "considered true, so different true values may not be equal. "
413 "The file bool.h (included in splint/lib) provides bool_equal "
414 "for safe bool comparisons.", 0, 0
417 FK_BOOL, FK_OPS, modeFlag,
420 "primitive operation (!, && or ||) does not has a boolean argument",
421 "The operand of a boolean operator is not a boolean. Use +ptrnegate "
422 "to allow ! to be used on pointers.",
426 FK_BOOL, FK_POINTER, modeFlag,
429 "allow ! to be used on pointer operand",
430 "The operand of ! operator is a pointer.", 0, 0
433 FK_BOOL, FK_PRED,plainFlag,
436 "condition test (if, while or for) is an assignment",
437 "The condition test is an assignment expression. Probably, you mean "
438 "to use == instead of =. If an assignment is intended, add an "
439 "extra parentheses nesting (e.g., if ((a = b)) ...) to suppress "
444 FK_BOOL, FK_PRED, specialFlag,
447 "type of condition test (if, while or for) not bool (sets predboolint, "
448 "predboolptr and predboolothers)",
449 "Test expression type is not boolean.", 0, 0
452 FK_PRED, FK_BOOL, modeFlag,
455 "type of condition test (if, while or for) is an integral type",
456 "Test expression type is not boolean or int.", 0, 0
459 FK_BOOL, FK_PRED, modeFlag,
462 "type of condition test (if, while or for) is a pointer",
463 "Test expression type is not boolean.", 0, 0
466 FK_BOOL, FK_PRED, modeFlag,
469 "type of condition test (if, while or for) not bool, int or pointer",
470 "Test expression type is not boolean.", 0, 0
474 ** 4.3 Abstract types
478 FK_ABSTRACT, FK_NONE, plainFlag,
481 "data abstraction barriers",
482 "An abstraction barrier is broken. If necessary, use /*@access <type>@*/ to allow access to an abstract type.",
486 FK_ABSTRACT, FK_NONE, modeFlag,
489 "object equality comparison on abstract type operands",
490 "An object comparison (== or !=) is used on operands of abstract type.",
495 FK_ABSTRACT, FK_NONE, plainFlag,
498 "data abstraction barriers",
499 "An abstraction barrier involving a numabstract type is broken. If necessary, use /*@access <type>@*/ to allow access to a numabstract type.",
503 FK_ABSTRACT, FK_NONE, modeFlag,
506 "numeric literal cast to numabstract type",
507 "A numeric literal is cast to a numabstract type.",
511 FK_ABSTRACT, FK_NONE, modeFlag,
514 "numeric literal can used as numabstract type",
515 "To allow a numeric literal to be used as a numabstract type, use +numabstractlit.",
519 FK_ABSTRACT, FK_TYPEEQ, modeFlag,
521 FLG_NUMABSTRACTINDEX,
522 "a numabstract type can be used to index an array",
523 "To allow numabstract types to index arrays, use +numabstractindex.",
527 FK_ABSTRACT, FK_NONE, modeFlag,
529 FLG_NUMABSTRACTPRINT,
530 "a numabstract value is printed using %d format code",
531 "A numabstract value is printed usind %d format code in a printf.",
535 FK_ABSTRACT, FK_IMPLICIT, plainFlag,
538 "assume user type definitions are abstract (unless /*@concrete@*/ is used)",
546 FK_ABSTRACT, FK_NAMES, plainFlag,
549 "allow access to abstract types in definition module",
550 "The representation of an abstract type defined in <M>.<x> is "
551 "accessible anywhere in a file named <M>.<y>.",
555 FK_ABSTRACT, FK_NAMES, plainFlag,
558 "allow access to abstract types by file name convention",
559 "The representation of an abstract type named <t> is "
560 "accessible anywhere in a file named <t>.<x>.",
564 FK_ABSTRACT, FK_NAMES, plainFlag,
567 "allow access to abstract types by czech naming convention",
568 "The representation of an abstract type named <t> is accessible "
569 "in the definition of a function or constant named <t>_<name>",
573 FK_ABSTRACT, FK_NAMES, plainFlag,
576 "allow access to abstract types by slovak naming convention",
577 "The representation of an abstract type named <t> is accessible "
578 "in the definition of a function or constant named <t><Name>",
582 FK_ABSTRACT, FK_NAMES, plainFlag,
583 "accessczechoslovak",
584 FLG_ACCESSCZECHOSLOVAK,
585 "allow access to abstract types by czechoslovak naming convention",
586 "The representation of an abstract type named <t> is accessible "
587 "in the definition of a function or constant named <t>_<name> or <t><Name>",
591 FK_ABSTRACT, FK_NAMES, specialFlag,
594 "set accessmodule, accessfile and accessczech",
595 "Sets accessmodule, accessfile and accessczech",
599 /* 4.3.2 Mutability */
601 FK_ABSTRACT, FK_NONE, modeFlag,
604 "representation of mutable type has sharing semantics",
605 "LCL semantics requires that a mutable type exhibits sharing semantics. "
606 "In order for objects to be shared a indirection is necessary in the representation. "
607 "A mutable type may be represented by a pointer or an abstract mutable type. Handles "
608 "into static data are fine, too, but will generate this error message unless it is suppressed.",
614 ** Memory Management (5)
617 /* Deallocation Errors */
619 FK_MEMORY, FK_LEAK, modeFlag,
622 "freshly allocated storage not released before return or scope exit",
623 "A memory leak has been detected. Storage allocated locally "
624 "is not released before the last reference to it is lost.",
628 FK_MEMORY, FK_LEAK, modeFlag,
631 "only storage not released before return or scope exit",
632 "A memory leak has been detected. Only-qualified storage is not released before the last "
633 "reference to it is lost.",
637 FK_MEMORY, FK_LEAK, specialFlag,
640 "fresh or only storage not released before return or scope exit (sets mustfreefresh and mustfreeonly)",
641 "A memory leak has been detected.",
645 FK_MEMORY, FK_DEAD, modeFlag,
648 "storage used after release",
649 "Memory is used after it has been released (either by passing "
650 "as an only param or assigning to an only global).",
654 FK_MEMORY, FK_DEAD, modeFlag,
656 FLG_STRICTUSERELEASED,
657 "element used after it may have been released",
658 "Memory (through fetch) is used after it may have been released "
659 "(either by passing as an only param or assigning to an only global).",
663 FK_MEMORY, FK_LEAK, modeFlag,
666 "all only references derivable from void pointer out only parameter are released",
667 "A storage leak due to incomplete deallocation of a structure or deep "
668 "pointer is suspected. Unshared storage that is reachable from "
669 "a reference that is being deallocated has not yet been deallocated. "
670 "Splint assumes when an object is passed "
671 "as an out only void pointer that the outer object will be "
672 "deallocated, but the inner objects will not.",
676 FK_MEMORY, FK_LEAK, modeFlag,
679 "report complete destruction errors for array elements that "
680 "may have been released",
685 FK_MEMORY, FK_ARRAY, modeFlag,
688 "array elements are dependent storage",
689 "When an element is fetched from an array, Splint analysis is "
690 "not able to determine if the same element is reused. "
691 "If +deparrays, Splint will mark local storage assigned from "
692 "array fetches as dependent.",
696 FK_MEMORY, FK_NONE, modeFlag,
699 "storage has inconsistent states of alternate paths through a branch",
700 "The state of a variable is different depending on which branch "
701 "is taken. This means no annotation can sensibly be applied "
706 FK_MEMORY, FK_NONE, modeFlag,
708 FLG_STRICTBRANCHSTATE,
709 "storage through array fetch has inconsistent states of alternate "
710 "paths through a branch",
711 "The state of a variable through an array fetch is different depending "
712 "on which branch is taken. This means no annotation can sensibly be applied "
717 FK_MEMORY, FK_NONE, specialFlag,
720 "sets all dynamic memory checking flags (memimplicit, mustfree, mustdefine, "
721 "mustnotalias, null, memtrans)",
725 FK_MEMORY, FK_DEF, modeFlag,
728 "actual parameter matches alias kind of formal parameter completely ",
729 "Storage derivable from a parameter does not match the alias kind "
730 "expected for the formal parameter.",
734 FK_MEMORY, FK_DEAD, modeFlag,
737 "external reference to stack-allocated storage is created",
738 "A stack reference is pointed to by an external reference when the "
739 "function returns. The stack-allocated storage is destroyed "
740 "after the call, leaving a dangling reference.",
745 FK_MEMORY, FK_NONE, specialFlag,
748 "memory transfer errors (sets all *trans flags)",
749 "Memory is transferred in a way that violates annotations.",
753 FK_MEMORY, FK_NONE, modeFlag,
756 "dependent transfer errors",
757 "Dependent storage is transferred to a non-dependent reference.",
761 FK_MEMORY, FK_NONE, modeFlag,
764 "new reference transfer to reference counted reference",
765 "A new reference is transferred to a reference counted reference.",
769 FK_MEMORY, FK_NONE, modeFlag,
772 "only storage transferred to non-only reference (memory leak)",
773 "The only reference to this storage is transferred to another "
774 "reference (e.g., by returning it) that does not have the "
775 "only annotation. This may lead to a memory leak, since the "
776 "new reference is not necessarily released.",
780 FK_MEMORY, FK_NONE, modeFlag,
781 "onlyunqglobaltrans",
782 FLG_ONLYUNQGLOBALTRANS,
783 "only storage transferred to an unqualified global or "
784 "static reference (memory leak)",
785 "The only reference to this storage is transferred to another "
786 "reference that does not have an aliasing annotation. "
787 "This may lead to a memory leak, since the "
788 "new reference is not necessarily released.",
792 FK_MEMORY, FK_NONE, modeFlag,
795 "owned storage transferred to non-owned reference (memory leak)",
796 "The owned reference to this storage is transferred to another "
797 "reference (e.g., by returning it) that does not have the "
798 "owned annotation. This may lead to a memory leak, since the "
799 "new reference is not necessarily released.",
803 FK_MEMORY, FK_NONE, modeFlag,
806 "fresh storage transferred to non-only reference (memory leak)",
807 "Fresh storage (newly allocated in this function) is transferred "
808 "in a way that the obligation to release storage is not "
809 "propagated. Use the /*@only@*/ annotation to indicate "
810 "the a return value is the only reference to the returned "
815 FK_MEMORY, FK_NONE, modeFlag,
818 "shared storage transferred to non-shared reference",
819 "Shared storage is transferred to a non-shared reference. The other "
820 "reference may release storage needed by this reference.",
824 FK_MEMORY, FK_NONE, modeFlag,
827 "temp storage transferred to non-temporary reference",
828 "Temp storage (associated with a formal parameter) is transferred "
829 "to a non-temporary reference. The storage may be released "
830 "or new aliases created.",
834 FK_MEMORY, FK_NONE, modeFlag,
837 "kept storage transferred to non-temporary reference",
838 "storage is transferred "
839 "to a non-temporary reference after being passed as keep parameter. The storage may be released "
840 "or new aliases created.",
844 FK_MEMORY, FK_NONE, modeFlag,
847 "keep storage transferred inconsistently",
848 "Keep storage is transferred inconsistently --- either in a way "
849 "that may add a new alias to it, or release it.",
853 FK_MEMORY, FK_NONE, modeFlag,
856 "an immediate address (result of &) is transferred inconsistently",
857 "An immediate address (result of & operator) is transferred "
862 FK_MEMORY, FK_NONE, modeFlag,
865 "reference counted storage is transferred in an inconsistent way",
866 "Reference counted storage is transferred in a way that may not "
867 "be consistent with the reference count.",
871 FK_MEMORY, FK_NONE, modeFlag,
874 "static storage is transferred in an inconsistent way",
875 "Static storage is transferred in an inconsistent way.",
879 FK_MEMORY, FK_NONE, modeFlag,
882 "unqualified storage is transferred in an inconsistent way",
883 "Unqualified storage is transferred in an inconsistent way.",
887 FK_MEMORY, FK_NONE, modeFlag,
890 "static storage is used as an initial value in an inconsistent way",
891 "Static storage is used as an initial value in an inconsistent way.",
895 FK_MEMORY, FK_NONE, modeFlag,
896 "unqualifiedinittrans",
897 FLG_UNKNOWNINITTRANS,
898 "unqualified storage is used as an initial value in an inconsistent way",
899 "Unqualified storage is used as an initial value in an inconsistent way.",
903 FK_MEMORY, FK_NONE, modeFlag,
906 "report memory transfer errors for initializations to read-only string literals",
907 "A read-only string literal is assigned to a non-observer reference.",
911 FK_MEMORY, FK_PARAMS, modeFlag,
914 "passing a value as an un-annotated parameter clears its annotation",
918 /* 5.3 Implicit Memory Annotations */
921 FK_MEMORY, FK_NONE, modeFlag,
924 "string literals are read-only (error if one is modified or released)",
925 "String literals are read-only. An error is reported "
926 "if a string literal may be modified or released.",
930 FK_MEMORY, FK_IMPLICIT, modeFlag,
933 "memory errors for unqualified storage",
937 FK_MEMORY, FK_IMPLICIT, plainFlag,
940 "assume unannotated parameter is temp",
944 FK_MEMORY, FK_IMPLICIT, specialFlag,
947 "sets globimponly, retimponly, structimponly, specglobimponly, "
948 "specretimponly and specstructimponly",
952 FK_MEMORY, FK_IMPLICIT, specialFlag,
955 "sets globimponly, retimponly and structimponly",
959 FK_MEMORY, FK_IMPLICIT, specialFlag,
962 "sets specglobimponly, specretimponly and specstructimponly",
966 FK_MEMORY, FK_IMPLICIT, plainFlag,
969 "assume unannotated global storage is only",
973 FK_MEMORY, FK_IMPLICIT, plainFlag,
976 "assume unannotated returned storage is only",
980 FK_MEMORY, FK_IMPLICIT, plainFlag,
983 "assume unannotated structure field is only",
987 FK_MEMORY, FK_IMPLICIT, plainFlag,
990 "assume unannotated global storage is only",
994 FK_MEMORY, FK_IMPLICIT, plainFlag,
997 "assume unannotated returned storage is only",
1001 FK_MEMORY, FK_IMPLICIT, plainFlag,
1002 "specstructimponly",
1003 FLG_SPECSTRUCTIMPONLY,
1004 "assume unannotated structure field is only",
1008 /* Reference Counting */
1016 /* 6.1 Aliasing warnings */
1019 FK_ALIAS, FK_MEMORY, modeFlag,
1022 "unique parameter is aliased",
1023 "A unique or only parameter is aliased by some other parameter or visible global.",
1027 FK_ALIAS, FK_MEMORY, modeFlag,
1030 "unique parameter may be aliased",
1031 "A unique or only parameter may be aliased by some other parameter or visible global.",
1035 FK_ALIAS, FK_MEMORY, modeFlag,
1038 "temp storage aliased at return point or scope exit",
1039 "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.",
1043 FK_ALIAS, FK_NONE, modeFlag,
1046 "function returns alias to parameter or global",
1047 "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
1050 /* Global aliasing */
1052 FK_ALIAS, FK_GLOBALS, specialFlag,
1055 "function returns with global aliasing external state (sets "
1056 "checkstrictglobalias, checkedglobalias, checkmodglobalias and "
1057 "uncheckedglobalias)",
1058 "A global variable aliases externally-visible state when the function returns.",
1062 FK_ALIAS, FK_GLOBALS, modeFlag,
1063 "checkstrictglobalias",
1064 FLG_CHECKSTRICTGLOBALIAS,
1065 "function returns with a checkstrict global aliasing external state",
1066 "A global variable aliases externally-visible state when the function returns.",
1070 FK_ALIAS, FK_GLOBALS, modeFlag,
1072 FLG_CHECKEDGLOBALIAS,
1073 "function returns with a checked global aliasing external state",
1074 "A global variable aliases externally-visible state when the function returns.",
1078 FK_ALIAS, FK_GLOBALS, modeFlag,
1079 "checkmodglobalias",
1080 FLG_CHECKMODGLOBALIAS,
1081 "function returns with a checkmod global aliasing external state",
1082 "A global variable aliases externally-visible state when the function returns.",
1086 FK_ALIAS, FK_GLOBALS, modeFlag,
1087 "uncheckedglobalias",
1088 FLG_UNCHECKEDGLOBALIAS,
1089 "function returns with an unchecked global aliasing external state",
1090 "A global variable aliases externally-visible state when the function returns.",
1097 FK_MEMORY, FK_NONE, modeFlag,
1100 "exposure transfer errors",
1101 "Exposed storage is transferred to a non-exposed, non-observer reference.",
1105 FK_MEMORY, FK_NONE, modeFlag,
1108 "observer transfer errors",
1109 "Observer storage is transferred to a non-observer reference.",
1113 FK_EXPOSURE, FK_ABSTRACT, specialFlag,
1116 "abstract representation is exposed (sets assignexpose, retexpose, and castexpose)",
1117 "The internal representation of an abstract type is visible to the "
1118 "caller. This means clients may have access to a pointer "
1119 "into the abstract representation.",
1123 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
1126 "abstract representation is exposed (return values only)",
1127 "The return value shares storage with an instance of an abstract "
1128 "type. This means clients may have access to a pointer into "
1129 "the abstract representation. Use the observer qualifier to "
1130 "return exposed storage that may not be modified by the "
1131 "client. Use the exposed qualifier to return modifiable "
1132 "(but not deallocatable) exposed storage (dangerous).",
1136 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
1139 "abstract representation is exposed (assignments only)",
1140 "Storage internal to the representation of an abstract type is "
1141 "assigned to an external pointer. This means clients may "
1142 "have access to a pointer into the abstract representation. "
1143 "If the external pointer is a parameter, the exposed qualifier "
1144 "can be used to allow the assignment, however, this is "
1145 "considered dangerous programming practice.",
1149 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
1152 "abstract representation is exposed through a cast",
1153 "Storage internal to the representation of an abstract type is exposed "
1154 "through a type cast. This means clients may have access to a "
1155 "pointer into the abstract representation.",
1159 FK_DECL, FK_TYPE, modeFlag,
1160 "redundantsharequal",
1161 FLG_REDUNDANTSHAREQUAL,
1162 "declaration uses observer qualifier that is always true",
1163 "A declaration of an immutable object uses a redundant observer qualifier.",
1167 FK_DECL, FK_TYPE, modeFlag,
1168 "misplacedsharequal",
1169 FLG_MISPLACEDSHAREQUAL,
1170 "declaration of unsharable storage uses sharing annotation",
1171 "A declaration of an unsharable object uses a sharing annotation.",
1176 ** 7. Function Interfaces
1179 /* 7.1 Modifications */
1182 FK_MODIFIES, FK_SPEC, plainFlag,
1185 "unspecified modification of caller-visible state",
1186 "An externally-visible object is modified by a function, but not "
1187 "listed in its modifies clause.",
1191 FK_MODIFIES, FK_SPEC, modeFlag,
1194 "specified modification is not detected",
1195 "An object listed in the modifies clause is not modified by the "
1196 "implementation of the function. The modification may not "
1197 "be detected if it is done through a call to an unspecified "
1202 FK_MODIFIES, FK_MEMORY, plainFlag,
1205 "possible modification of observer storage",
1206 "Storage declared with observer is possibly modified. Observer "
1207 "storage may not be modified.",
1211 FK_MODIFIES, FK_MEMORY, modeFlag,
1213 FLG_MODOBSERVERUNCON,
1214 "possible modification of observer storage through unconstrained call",
1215 "Storage declared with observer may be modified through a call to an "
1216 "unconstrained function.",
1220 FK_MODIFIES, FK_MEMORY, modeFlag,
1221 "modinternalstrict",
1222 FLG_MODINTERNALSTRICT,
1223 "possible modification of internal storage through function call",
1224 "A function that modifies internalState is called from a function that "
1225 "does not list internalState in its modifies clause",
1229 FK_MODIFIES, FK_UNSPEC, modeFlag,
1232 "report undocumented file system modifications (applies to unspecified "
1233 "functions if modnomods is set)",
1237 FK_MODIFIES, FK_UNSPEC, specialFlag,
1240 "modification in unspecified functions (sets modnomods, "
1241 "modglobunspec and modstrictglobsunspec)",
1245 FK_MODIFIES, FK_UNSPEC, modeFlag,
1248 "modification in a function with no modifies clause",
1249 "An externally-visible object is modified by a function with no "
1250 "/*@modifies@*/ comment. The /*@modifies ... @*/ control "
1251 "comment can be used to give a modifies list for an "
1252 "unspecified function.",
1256 FK_MODIFIES, FK_UNSPEC, modeFlag,
1259 "possible modification through a call to an unconstrained function",
1260 "An unconstrained function is called in a function body where "
1261 "modifications are checked. Since the unconstrained function "
1262 "may modify anything, there may be undetected modifications in "
1263 "the checked function.",
1267 FK_MODIFIES, FK_UNSPEC, modeFlag,
1270 "possible modification through a call to an unconstrained function in "
1271 "a function with no modifies clause",
1272 "An unconstrained function is called in a function body where "
1273 "modifications are checked. Since the unconstrained function "
1274 "may modify anything, there may be undetected modifications in "
1275 "the checked function.",
1279 FK_MODIFIES, FK_GLOBALS, modeFlag,
1280 "globsimpmodsnothing",
1281 FLG_GLOBALSIMPMODIFIESNOTHING,
1282 "functions declared with a globals list but no modifies clause are "
1283 "assumed to modify nothing",
1284 "An implicit modifies nothing clause is assumed for a function "
1285 "declared with a globals list but not modifies clause.",
1289 FK_MODIFIES, FK_GLOBALS, modeFlag,
1291 FLG_MODIFIESIMPNOGLOBALS,
1292 "functions declared with a modifies clause but no globals list "
1293 "are assumed to use no globals",
1294 "An implicit empty globals list is assumed for a function "
1295 "declared with a modifies clause but no globals list.",
1304 FK_GLOBALS, FK_NONE, modeFlag,
1307 "returns with global in inconsistent state (null or undefined)",
1308 "A global variable does not satisfy its annotations when control is transferred.",
1313 FK_GLOBALS, FK_SPEC, plainFlag,
1316 "undocumented use of a checked global variable",
1317 "A checked global variable is used in the function, but not listed in "
1318 "its globals clause. By default, only globals specified in .lcl "
1319 "files are checked. To check all globals, use +allglobals. To "
1320 "check globals selectively use /*@checked@*/ in the global "
1325 FK_GLOBALS, FK_SPEC, modeFlag,
1328 "global listed for a function not used",
1329 "A global variable listed in the function's globals list is not used "
1330 "in the body of the function.",
1334 FK_GLOBALS, FK_NONE, modeFlag,
1337 "use of internalState",
1338 "A called function uses internal state, but the globals list for the "
1339 "function being checked does not include internalState",
1343 FK_GLOBALS, FK_NONE, modeFlag,
1344 "internalglobsnoglobs",
1345 FLG_INTERNALGLOBSNOGLOBS,
1346 "use of internalState (in function with no globals list)",
1347 "A called function uses internal state, but the function being checked "
1348 "has no globals list",
1352 FK_GLOBALS, FK_MODIFIES, modeFlag,
1354 FLG_WARNMISSINGGLOBALS,
1355 "global variable used in modifies clause is not listed in globals list",
1356 "A global variable is used in the modifies clause, but it is not listed in "
1357 "the globals list. The variable will be added to the globals list.",
1362 FK_GLOBALS, FK_MODIFIES, modeFlag,
1363 "warnmissingglobsnoglobs",
1364 FLG_WARNMISSINGGLOBALSNOGLOBS,
1365 "global variable used in modifies clause in a function with no globals list",
1366 "A global variable is used in the modifies clause, but the function "
1367 "has no globals list. The variable will be added to the globals list.",
1371 FK_GLOBALS, FK_UNSPEC, modeFlag,
1374 "use of checked global in a function with no globals list or specification",
1375 "A specified global variable is used in the function, but not listed "
1376 "in its globals list. Without +globnoglobs, only globals "
1377 "declared with /*@checkedstrict@*/ will produce use "
1378 "errors in functions without globals "
1379 "lists. The /*@globals ... @*/ control comment can be used to give "
1380 "a globals list for an unspecified function.",
1384 FK_GLOBALS, FK_IMPLICIT, modeFlag,
1387 "report use and modification errors for globals not annotated with unchecked",
1391 FK_GLOBALS, FK_UNSPEC, modeFlag,
1393 FLG_CHECKSTRICTGLOBALS,
1394 "report use and modification errors for checkedstrict globals",
1398 FK_GLOBALS, FK_UNSPEC, modeFlag,
1399 "impcheckedspecglobs",
1400 FLG_IMPCHECKEDSPECGLOBALS,
1401 "assume checked qualifier for unqualified global declarations in .lcl files",
1405 FK_GLOBALS, FK_UNSPEC, modeFlag,
1406 "impcheckmodspecglobs",
1407 FLG_IMPCHECKMODSPECGLOBALS,
1408 "assume checkmod qualifier for unqualified global declarations in .lcl files",
1412 FK_GLOBALS, FK_UNSPEC, modeFlag,
1413 "impcheckedstrictspecglobs",
1414 FLG_IMPCHECKEDSTRICTSPECGLOBALS,
1415 "assume checkmod qualifier for unqualified global declarations in .lcl files",
1419 FK_GLOBALS, FK_UNSPEC, modeFlag,
1421 FLG_IMPCHECKEDGLOBALS,
1422 "assume checked qualifier for unqualified global declarations",
1426 FK_GLOBALS, FK_UNSPEC, modeFlag,
1428 FLG_IMPCHECKMODGLOBALS,
1429 "assume checkmod qualifier for unqualified global declarations",
1433 FK_GLOBALS, FK_UNSPEC, modeFlag,
1434 "impcheckedstrictglobs",
1435 FLG_IMPCHECKEDSTRICTGLOBALS,
1436 "assume checkedstrict qualifier for unqualified global declarations",
1440 FK_GLOBALS, FK_UNSPEC, modeFlag,
1441 "impcheckedstatics",
1442 FLG_IMPCHECKEDSTATICS,
1443 "assume checked qualifier for unqualified file static declarations",
1447 FK_GLOBALS, FK_UNSPEC, modeFlag,
1448 "impcheckmodstatics",
1449 FLG_IMPCHECKMODSTATICS,
1450 "assume checkmod qualifier for unqualified file static declarations",
1454 FK_GLOBALS, FK_UNSPEC, modeFlag,
1455 "impcheckmodinternals",
1456 FLG_IMPCHECKMODINTERNALS,
1457 "assume checkmod qualifier for unqualified local "
1458 "static declarations (for internal state modifications)",
1462 FK_GLOBALS, FK_UNSPEC, modeFlag,
1463 "impcheckedstrictstatics",
1464 FLG_IMPCHECKEDSTRICTSTATICS,
1465 "assume checkedstrict qualifier for unqualified file static declarations",
1469 FK_GLOBALS, FK_MODIFIES, modeFlag,
1472 "undocumented modification of a checked global variable",
1473 "A checked global variable is modified by the function, but not listed in "
1474 "its modifies clause.",
1478 FK_GLOBALS, FK_MODIFIES, modeFlag,
1481 "undocumented modification of a checked global variable in a function "
1482 "declared with no modifies clause",
1483 "A checked global variable is modified by the function, but not listed in "
1484 "its modifies clause.",
1488 FK_GLOBALS, FK_MODIFIES, modeFlag,
1489 "modstrictglobsnomods",
1490 FLG_MODSTRICTGLOBSUNSPEC,
1491 "undocumented modification of a strict checked global variable in a "
1492 "function declared with no modifies clause",
1493 "A checked global variable is modified by the function, but not listed in "
1494 "its modifies clause.",
1498 FK_GLOBALS, FK_MODIFIES, modeFlag,
1499 "modglobsunchecked",
1500 FLG_MODGLOBSUNCHECKED,
1501 "undocumented modification of an unchecked checked global variable",
1502 "An unchecked global variable is modified by the function, but not listed in "
1503 "its modifies clause.",
1518 FK_CONTROL, FK_NONE, modeFlag,
1521 "path with no return detected in non-void function",
1522 "There is a path through a function declared to return a value on "
1523 "which there is no return statement. This means the execution "
1524 "may fall through without returning a meaningful result to "
1529 FK_CONTROL, FK_NONE, plainFlag,
1532 "empty return in function declared to return value",
1537 FK_CONTROL, FK_NONE, plainFlag,
1540 "loop predicate always exits",
1546 FK_CONTROL, FK_MEMORY, specialFlag,
1549 "assume all loops execute at least once (sets forloopexec, whileloopexec and iterloopexec)",
1553 FK_CONTROL, FK_MEMORY, plainFlag,
1556 "assume all for loops execute at least once",
1560 FK_CONTROL, FK_MEMORY, plainFlag,
1563 "assume all while loops execute at least once",
1567 FK_CONTROL, FK_MEMORY, plainFlag,
1570 "assume all iterator loops execute at least once",
1574 FK_CONTROL, FK_MEMORY, plainFlag,
1576 FLG_OBVIOUSLOOPEXEC,
1577 "assume loop that can be determined to always execute always does",
1581 /* 8.2 Undefined Behavior */
1584 FK_BEHAVIOR, FK_ANSI, modeFlag,
1587 "code has unspecified or implementation-dependent behavior "
1588 "because of order of evaluation",
1589 "Code has unspecified behavior. "
1590 "Order of evaluation of function parameters or subexpressions "
1591 "is not defined, so if a value is used and modified in different "
1592 "places not separated by a sequence point constraining "
1593 "evaluation order, then the result of the expression is "
1598 FK_BEHAVIOR, FK_ANSI, modeFlag,
1601 "code involving call to unspecified function has undefined or implementation-dependent behavior",
1602 "Code involving a call to function with no modifies or globals clause "
1603 "may have undefined or implementation-dependent behavior (Splint assumes the "
1604 "unconstrained call may modify any reachable state or use any global). Add a "
1605 "specification for the function.",
1609 /* 8.3 Problematic Control Structures */
1611 /* 8.3.1 Infinite Loops */
1614 FK_CONTROL, FK_NONE, modeFlag,
1617 "likely infinite loop is detected",
1618 "This appears to be an infinite loop. Nothing in the body of the "
1619 "loop or the loop test modifies the value of the loop test. "
1620 "Perhaps the specification of a function called in the loop "
1621 "body is missing a modification.",
1625 FK_CONTROL, FK_NONE, modeFlag,
1628 "likely infinite loop is detected (may result from unconstrained function)",
1629 "This appears to be an infinite loop. Nothing in the body of the "
1630 "loop or the loop test modifies the value of the loop test. "
1631 "There may be a modification through a call to an unconstrained "
1632 "function, or an unconstrained function in the loop test may use "
1633 "a global variable modified by the loop body.",
1637 /* 8.3.2 Switches */
1640 FK_CONTROL, FK_NONE, modeFlag,
1643 "non-empty case in a switch without preceding break",
1644 "Execution falls through from the previous case (use /*@fallthrough@*/ to mark fallthrough cases).", 0, 0
1647 FK_CONTROL, FK_NONE, modeFlag,
1650 "switch on enum type missing case for some value",
1651 "Not all values in an enumeration are present as cases in the switch.",
1655 FK_CONTROL, FK_NONE, modeFlag,
1658 "first statement in switch is not a case",
1659 "The first statement after a switch is not a case.",
1663 FK_CONTROL, FK_NONE, plainFlag,
1666 "duplicate cases in switch",
1667 "Duplicate cases in switch.",
1671 /* 8.3.3 Deep Breaks */
1674 FK_CONTROL, FK_NONE, specialFlag,
1677 "break inside nested while or for or switch",
1678 "A break statement appears inside the body of a nested while, for or "
1679 "switch statement. Sets looploopbreak, loopswitchbreak, "
1680 "switchloopbreak, switchswitchbreak, and looploopcontinue.",
1684 FK_CONTROL, FK_NONE, modeFlag,
1687 "break inside nested while or for",
1688 "A break statement appears inside the body of a nested while or for "
1689 "statement. This is perfectly reasonable code, but check that "
1690 "the break is intended to break only the inner loop. The "
1691 "break statement may be preceded by /*@innerbreak@*/ to suppress "
1692 "the message for this break only.",
1696 FK_CONTROL, FK_NONE, modeFlag,
1698 FLG_SWITCHLOOPBREAK,
1699 "break in loop inside switch",
1700 "A break statement appears inside the body of a while or for "
1701 "statement within a switch. This is perfectly reasonable code, but check that "
1702 "the break is intended to break only the inner loop. The "
1703 "break statement may be preceded by /*@loopbreak@*/ to suppress "
1704 "the message for this break only.",
1708 FK_CONTROL, FK_NONE, modeFlag,
1710 FLG_LOOPSWITCHBREAK,
1711 "break in switch inside loop",
1712 "A break statement appears inside a switch statement within a while or "
1713 "for loop. This is perfectly reasonable code, but check that "
1714 "the break is intended to break only the inner loop. The "
1715 "break statement may be preceded by /*@switchbreak@*/ to suppress "
1716 "the message for this break only.",
1720 FK_CONTROL, FK_NONE, modeFlag,
1721 "switchswitchbreak",
1722 FLG_SWITCHSWITCHBREAK,
1723 "break in switch inside switch",
1724 "A break statement appears inside a switch statement within another "
1725 "switch statement. This is perfectly reasonable code, but check that "
1726 "the break is intended to break only the inner switch. The "
1727 "break statement may be preceded by /*@innerbreak@*/ to suppress "
1728 "the message for this break only.",
1732 FK_CONTROL, FK_NONE, modeFlag,
1734 FLG_LOOPLOOPCONTINUE,
1735 "continue inside nested loop",
1736 "A continue statement appears inside a loop within a loop. "
1737 "This is perfectly reasonable code, but check that "
1738 "the continue is intended to continue only the inner loop. The "
1739 "continue statement may be preceded by /*@innercontinue@*/ to suppress "
1740 "the message for this continue only.",
1744 /* 8.3.4 Loop and If Bodies */
1747 FK_CONTROL, FK_NONE, modeFlag,
1750 "a while statement has no body",
1751 "While statement has no body.",
1755 FK_CONTROL, FK_NONE, modeFlag,
1758 "the body of a while statement is not a block",
1759 "While body is a single statement, not a compound block.",
1763 FK_CONTROL, FK_NONE, modeFlag,
1766 "a for statement has no body",
1767 "For statement has no body.",
1771 FK_CONTROL, FK_NONE, modeFlag,
1774 "the body of a for statement is not a block",
1775 "Loop body is a single statement, not a compound block.",
1779 FK_CONTROL, FK_NONE, modeFlag,
1782 "an if statement has no body",
1783 "If statement has no body.",
1787 FK_CONTROL, FK_NONE, modeFlag,
1790 "the body of an if statement is not a block",
1791 "If body is a single statement, not a compound block.",
1795 FK_CONTROL, FK_NONE, specialFlag,
1798 "an if, while or for statement has no body (sets ifempty, "
1799 "whileempty and forempty",
1804 FK_CONTROL, FK_NONE, specialFlag,
1807 "the body of an if, while or for statement is not a block "
1808 "(sets ifblock, whileblock and forblock)",
1809 "Body is a single statement, not a compound block.",
1813 /* 8.3.5 Complete Logic */
1816 FK_CONTROL, FK_NONE, modeFlag,
1819 "if ... else if chains must have final else",
1820 "There is no final else following an else if construct.",
1824 /* 8.4 Suspicious Statements */
1827 FK_CONTROL, FK_NONE, modeFlag,
1830 "unreachable code detected",
1831 "This code will never be reached on any possible execution.",
1835 /* 8.4.1 Statements with No Effects */
1838 FK_EFFECT, FK_CONTROL, modeFlag,
1841 "statement with no effect",
1842 "Statement has no visible effect --- no values are modified.",
1846 FK_EFFECT, FK_CONTROL, modeFlag,
1849 "statement with no effect (except possibly through call to "
1850 "unconstrained function)",
1851 "Statement has no visible effect --- no values are modified. It may "
1852 "modify something through a call to an unconstrained function.",
1856 /* 8.4.2 Ignored Return Values */
1859 FK_IGNORERET, FK_NONE, specialFlag,
1862 "return value ignored (sets retvalint, retvalbool and retvalother)",
1863 "Result returned by function call is not used. If this is intended, "
1864 "cast result to (void) to eliminate message.",
1868 FK_IGNORERET, FK_BOOL, modeFlag,
1871 "return value of type other than bool or int ignored",
1872 "Result returned by function call is not used. If this is intended, "
1873 "can cast result to (void) to eliminate message.",
1877 FK_IGNORERET, FK_BOOL, modeFlag,
1880 "return value of manifest type bool ignored",
1881 "Result returned by function call is not used. If this is intended, "
1882 "can cast result to (void) to eliminate message.",
1886 FK_IGNORERET, FK_NONE, modeFlag,
1889 "return value of type int ignored",
1890 "Result returned by function call is not used. If this is intended, "
1891 "can cast result to (void) to eliminate message.",
1900 FK_BOUNDS, FK_MEMORY, modeFlag,
1903 "misuse of nullterminated allocation",
1904 "A possibly non-nullterminated string/memory is used/referenced as a nullterminated one.",
1908 FK_BOUNDS, FK_MEMORY, specialFlag,
1911 "memory bounds checking (sets boundsread and boundswrite)",
1912 "Memory read or write may be out of bounds of allocated storage.", 0, 0
1915 FK_BOUNDS, FK_MEMORY, specialFlag,
1918 "memory bounds checking (sets likelyboundsread and likelyboundswrite)",
1919 "Memory read or write may be out of bounds of allocated storage.", 0, 0
1922 FK_BOUNDS, FK_MEMORY, modeFlag,
1924 FLG_LIKELYBOUNDSREAD,
1925 "likely out of bounds read",
1926 "A memory read references memory beyond the allocated storage.",
1930 FK_BOUNDS, FK_MEMORY, modeFlag,
1931 "likelyboundswrite",
1932 FLG_LIKELYBOUNDSWRITE,
1933 "likely buffer overflow from an out of bounds write",
1934 "A memory write may write to an address beyond the allocated buffer.",
1939 FK_BOUNDS, FK_MEMORY, modeFlag,
1942 "possible out of bounds read",
1943 "A memory read references memory beyond the allocated storage.",
1947 FK_BOUNDS, FK_MEMORY, modeFlag,
1950 "possible buffer overflow from an out of bounds write",
1951 "A memory write may write to an address beyond the allocated buffer.",
1956 FK_BOUNDS, FK_DISPLAY, plainFlag,
1959 "display function post conditions",
1960 "Display function post conditions.",
1964 FK_BOUNDS, FK_DISPLAY, plainFlag,
1965 "redundantconstraints",
1966 FLG_REDUNDANTCONSTRAINTS,
1967 "display seemingly redundant constraints",
1968 "Display seemingly redundant constraints",
1971 /*drl7x added 6/18/01 */
1973 FK_BOUNDS, FK_MEMORY, modeFlag,
1976 "unable to verify predicate in ensures clause",
1977 "The function implementation may not satisfy a post condition given in an ensures clause.",
1982 FK_BOUNDS, FK_MEMORY, plainFlag,
1983 "impboundsconstraints",
1984 FLG_IMPBOUNDSCONSTRAINTS,
1985 "generate implicit constraints for functions",
1989 /*drl7x added 4/29/01 */
1991 FK_BOUNDS, FK_MEMORY, plainFlag,
1994 "use limited OR expressions to resolve constraints",
1999 FK_BOUNDS, FK_DISPLAY, plainFlag,
2000 "showconstraintparens",
2001 FLG_PARENCONSTRAINT,
2002 "display parentheses around constraint terms",
2006 /*drl added 2/4/2002*/
2008 FK_BOUNDS, FK_DISPLAY, plainFlag,
2009 "boundscompacterrormessages",
2010 FLG_BOUNDSCOMPACTERRORMESSAGES,
2011 "Display fewer new lines in bounds checking error messages",
2016 FK_BOUNDS, FK_DISPLAY, plainFlag,
2017 "showconstraintlocation",
2018 FLG_CONSTRAINTLOCATION,
2019 "display location for every constraint generated",
2022 }, /*drl added flag 4/26/01*/
2024 { /* evans added 2003-06-08 */
2025 FK_BOUNDS, FK_MEMORY, modeFlag,
2028 "type conversion involves storage of non-divisble size",
2033 ** 10. Extensible Checking
2037 FK_EXTENSIBLE, FK_FILES, globalStringFlag, ARG_FILE,
2040 "load meta state declaration and corresponding xh file",
2044 FK_EXTENSIBLE, FK_MEMORY, modeFlag,
2047 "storage has been transfered with invalid state",
2048 "Transfer violates user-defined state rules.",
2052 FK_EXTENSIBLE, FK_MEMORY, modeFlag,
2055 "control paths merge with storage in incompatible states",
2056 "Control path merge violates user-defined state merge rules.",
2065 FK_MACROS, FK_NONE, modeFlag,
2069 "A macro is defined in more than one place.", 0, 0
2072 FK_MACROS, FK_UNRECOG, modeFlag,
2075 "unrecognized identifier in macro",
2076 "An unrecognized identifier appears in a macro. If the identifier "
2077 "is defined before the macro is used, then this is okay.",
2081 /* 11.1 Constant Macros */
2084 FK_MACROS, FK_PROTOS, modeFlag,
2087 "non-parameterized macro without prototype or specification",
2088 "Macro constant has no declaration. Use /*@constant ...@*/ to "
2089 "declare the macro.",
2093 /* 11.2 Function-like Macros */
2096 FK_MACROS, FK_NONE, modeFlag,
2099 "macro definition is syntactically not equivalent to function",
2100 "A macro is defined in a way that may cause syntactic problems. "
2101 "If the macro returns a value, use commas to separate expressions; "
2102 "otherwise, use do { <macro body> } while (FALSE) construct.",
2106 FK_MACROS, FK_NONE, modeFlag,
2109 "macro definition for is empty",
2110 "A macro definition has no body.",
2114 FK_MACROS, FK_PARAMS, modeFlag,
2117 "macro parameter not used exactly once",
2118 "A macro parameter is not used exactly once in all possible "
2119 "invocations of the macro. To behave like a function, "
2120 "each macro parameter must be used exactly once on all "
2121 "invocations of the macro so that parameters with "
2122 "side-effects are evaluated exactly once. Use /*@sef@*/ to "
2123 "denote parameters that must be side-effect free.",
2127 FK_MACROS, FK_CONTROL, modeFlag,
2130 "return statement in macro body",
2131 "The body of a macro declared as a function uses a return statement. "
2132 "This exhibits behavior that "
2133 "could not be implemented by a function.",
2137 FK_MACROS, FK_PARAMS, modeFlag,
2140 "assignment to a macro parameter",
2141 "A macro parameter is used as the left side of an "
2142 "assignment expression. This exhibits behavior that "
2143 "could not be implemented by a function.",
2147 FK_MACROS, FK_NONE, modeFlag,
2150 "macro parameter used without parentheses (in potentially dangerous context)",
2151 "A macro parameter is used without parentheses. This could be "
2152 "dangerous if the macro is invoked with a complex expression "
2153 "and precedence rules will change the evaluation inside the macro.",
2157 FK_MACROS, FK_PROTOS, modeFlag,
2160 "macro without prototype or specification (sets macrofcndecl and macroconstdecl)",
2161 "Argument checking cannot be done well for macros without prototypes "
2162 "or specifications, since the types of the arguments are unknown.",
2166 FK_MACROS, FK_PROTOS, modeFlag,
2169 "parameterized macro without prototype or specification",
2170 "Function macro has no declaration.",
2174 /* 11.2.1 Side Effect Free Parameters */
2177 FK_MACROS, FK_PARAMS, modeFlag,
2180 "a parameter with side-effects is passed as a sef parameter",
2181 "An actual parameter corresponding to a sef parameter may have a side-effect.",
2185 FK_MACROS, FK_PARAMS, modeFlag,
2188 "a parameter with unconstrained side-effects is passed as a sef parameter",
2189 "An actual parameter corresponding to a sef parameter involves a call "
2190 "to a procedure with no modifies clause that may have a side-effect.",
2194 /* 11.3 Controlling Macro Checking */
2197 FK_MACROS, FK_NONE, plainFlag,
2200 "check all macros without parameter lists as constants",
2201 "Every non-parameterized macro (not preceded by /*@notfunction@*/) "
2202 "is checked as a constant.",
2206 FK_MACROS, FK_NONE, plainFlag,
2209 "check all macros with parameter lists as functions",
2210 "Every parameterized macro (not preceded by /*@notfunction@*/) "
2211 "is checked as a function.",
2215 FK_MACROS, FK_NONE, plainSpecialFlag,
2218 "sets fcnmacros and constmacros",
2219 "All macros (not preceded by /*@notfunction@*/) are checked as functions or "
2220 "constants depending on whether or not they have parameter lists.",
2224 FK_MACROS, FK_NONE, plainFlag,
2227 "check all macros with declarations in library as functions",
2228 "Every macro declared in the load library is checked.",
2232 FK_MACROS, FK_NONE, plainFlag,
2235 "check all macros corresponding to specified functions or constants",
2236 "Every macro declared a specification file is checked.",
2240 FK_MACROS, FK_NONE, modeFlag,
2243 "macro definition does not match iter or constant declaration",
2244 "A iter or constant macro is defined using a different name from the "
2245 "one used in the previous syntactic comment",
2249 FK_MACROS, FK_NONE, plainFlag,
2252 "the line after a constant or iter declaration must be a macro definition",
2253 "A constant or iter declaration is not immediately followed by a macro definition.",
2257 /* 11.4 Iterators */
2260 FK_ITER, FK_NONE, plainFlag,
2263 "iter is not balanced with end_<iter>",
2268 FK_ITER, FK_NONE, plainFlag,
2271 "iter yield parameter is inappropriate",
2276 FK_ITER, FK_NONE, plainFlag,
2279 "iter declaration has no yield parameters",
2280 "An iterator has been declared with no parameters annotated with "
2281 "yield. This may be what you want, if the iterator is meant "
2282 "to do something a fixed number of times, but returns no "
2283 "information to the calling context. Probably, a parameter "
2284 "is missing the yield annotation to indicate that it is "
2285 "assigned a value in the calling context.",
2290 ** 12. Naming Conventions
2294 FK_NAMES, FK_ABSTRACT, plainFlag,
2297 "controls name checking without changing other settings",
2301 /* 12.1.1 Czech Names */
2304 FK_NAMES, FK_ABSTRACT, specialFlag,
2307 "czech naming convention (sets accessczech, czechfunctions, czechvars, "
2308 "czechconstants, czechenums, and czechmacros)",
2309 "Name is not consistent with Czech naming convention.", 0, 0
2312 FK_NAMES, FK_ABSTRACT, plainFlag,
2315 "czech naming convention violated in a function or iterator declaration",
2316 "Function or iterator name is not consistent with Czech naming convention.", 0, 0
2319 FK_NAMES, FK_ABSTRACT, plainFlag,
2322 "czech naming convention violated in a variable declaration",
2323 "Variable name is not consistent with Czech naming convention.", 0, 0
2326 FK_NAMES, FK_ABSTRACT, plainFlag,
2329 "czech naming convention violated in an expanded macro name",
2330 "Expanded macro name is not consistent with Czech naming convention.", 0, 0
2333 FK_NAMES, FK_ABSTRACT, plainFlag,
2336 "czech naming convention violated in a constant declaration",
2337 "Constant name is not consistent with Czech naming convention.", 0, 0
2340 FK_NAMES, FK_ABSTRACT, plainFlag,
2343 "czech naming convention violated in a user-defined type definition",
2344 "Type name is not consistent with Czech naming convention. Czech type "
2345 "names must not use the underscore character.", 0, 0
2348 /* 12.1.2 Slovak Names */
2351 FK_NAMES, FK_ABSTRACT, specialFlag,
2354 "slovak naming convention violated",
2355 "Name is not consistent with Slovak naming convention.", 0, 0
2358 FK_NAMES, FK_ABSTRACT, plainFlag,
2360 FLG_SLOVAKFUNCTIONS,
2361 "slovak naming convention violated in a function or iterator declaration",
2362 "Function or iterator name is not consistent with Slovak naming convention.", 0, 0
2365 FK_NAMES, FK_ABSTRACT, plainFlag,
2368 "slovak naming convention violated in an expanded macro name",
2369 "Expanded macro name is not consistent with Slovak naming convention.", 0, 0
2372 FK_NAMES, FK_ABSTRACT, plainFlag,
2375 "slovak naming convention violated in a variable declaration",
2376 "Variable name is not consistent with Slovak naming convention.", 0, 0
2379 FK_NAMES, FK_ABSTRACT, plainFlag,
2381 FLG_SLOVAKCONSTANTS,
2382 "slovak naming convention violated in a constant declaration",
2383 "Constant name is not consistent with Slovak naming convention.", 0, 0
2386 FK_NAMES, FK_ABSTRACT, plainFlag,
2389 "slovak naming convention violated in a use-defined type definition",
2390 "Type name is not consistent with Slovak naming convention. Slovak type "
2391 "names may not include uppercase letters.", 0, 0
2394 /* 12.1.3 Czechoslovak Names */
2396 FK_NAMES, FK_ABSTRACT, specialFlag,
2399 "czech or slovak naming convention violated",
2400 "Name is not consistent with either Czech or Slovak naming convention.", 0, 0
2403 FK_NAMES, FK_ABSTRACT, plainFlag,
2405 FLG_CZECHOSLOVAKFUNCTIONS,
2406 "czechoslovak naming convention violated in a function or iterator declaration",
2407 "Function name is not consistent with Czechoslovak naming convention.", 0, 0
2410 FK_NAMES, FK_ABSTRACT, plainFlag,
2411 "czechoslovakmacros",
2412 FLG_CZECHOSLOVAKMACROS,
2413 "czechoslovak naming convention violated in an expanded macro name",
2414 "Expanded macro name is not consistent with Czechoslovak naming convention.", 0, 0
2417 FK_NAMES, FK_ABSTRACT, plainFlag,
2419 FLG_CZECHOSLOVAKVARS,
2420 "czechoslovak naming convention violated in a variable declaration",
2421 "Variable name is not consistent with Czechoslovak naming convention.", 0, 0
2424 FK_NAMES, FK_ABSTRACT, plainFlag,
2425 "czechoslovakconsts",
2426 FLG_CZECHOSLOVAKCONSTANTS,
2427 "czechoslovak naming convention violated in a constant declaration",
2428 "Constant name is not consistent with Czechoslovak naming convention.", 0, 0
2431 FK_NAMES, FK_ABSTRACT, plainFlag,
2432 "czechoslovaktypes",
2433 FLG_CZECHOSLOVAKTYPES,
2434 "czechoslovak naming convention violated in a user-defined type definition",
2435 "Type name is not consistent with Czechoslovak naming convention. Czechoslovak "
2436 "type names may not include uppercase letters or the underscore character.", 0, 0
2439 /* 12.2 Namespace Prefixes */
2442 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2445 "set namespace prefix for variables declared in a macro body",
2446 "A variable declared in a macro body does not start with the macrovarprefix.",
2450 FK_NAMES, FK_PREFIX, plainFlag,
2451 "macrovarprefixexclude",
2452 FLG_MACROVARPREFIXEXCLUDE,
2453 "the macrovarprefix may not be used for non-macro variables",
2454 "A variable declared outside a macro body starts with the macrovarprefix.",
2458 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2461 "set namespace prefix for struct, union and enum tags",
2462 "A tag identifier does not start with the tagprefix.",
2466 FK_NAMES, FK_PREFIX, plainFlag,
2468 FLG_TAGPREFIXEXCLUDE,
2469 "the tagprefix may not be used for non-tag identifiers",
2470 "An identifier that is not a tag starts with the tagprefix.",
2474 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2477 "set namespace prefix for enum members",
2478 "An enum member does not start with the enumprefix.",
2482 FK_NAMES, FK_PREFIX, plainFlag,
2483 "enumprefixexclude",
2484 FLG_ENUMPREFIXEXCLUDE,
2485 "the enumprefix may not be used for non-enum member identifiers",
2486 "An identifier that is not an enum member starts with the enumprefix.",
2490 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2492 FLG_FILESTATICPREFIX,
2493 "set namespace prefix for file static declarations",
2494 "A file-static identifier does not start with the filestaticprefix.",
2498 FK_NAMES, FK_PREFIX, plainFlag,
2499 "filestaticprefixexclude",
2500 FLG_FILESTATICPREFIXEXCLUDE,
2501 "the filestaticprefix may not be used for identifiers that are not file static",
2502 "An identifier that is not file static starts with the filestaticprefix.",
2506 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2509 "set namespace prefix for global variables",
2510 "A global variable does not start with the globalprefix",
2514 FK_NAMES, FK_PREFIX, plainFlag,
2515 "globalprefixexclude",
2516 FLG_GLOBPREFIXEXCLUDE,
2517 "the globalprefix may not be used for non-global identifiers",
2518 "An identifier that is not a global variable starts with the globalprefix.",
2522 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2525 "set namespace prefix for user-defined types",
2526 "A user-defined type does not start with the typeprefix",
2530 FK_NAMES, FK_PREFIX, plainFlag,
2531 "typeprefixexclude",
2532 FLG_TYPEPREFIXEXCLUDE,
2533 "the typeprefix may not be used for identifiers that are not type names",
2534 "An identifier that is not a type name starts with the typeprefix.",
2538 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2541 "set namespace prefix for external identifiers",
2542 "An external identifier does not start with the externalprefix",
2546 FK_NAMES, FK_PREFIX, plainFlag,
2547 "externalprefixexclude",
2548 FLG_EXTERNALPREFIXEXCLUDE,
2549 "the externalprefix may not be used for non-external identifiers",
2550 "An identifier that is not external starts with the externalprefix.",
2554 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2557 "set namespace prefix for local variables",
2558 "A local variable does not start with the localprefix",
2562 FK_NAMES, FK_PREFIX, plainFlag,
2563 "localprefixexclude",
2564 FLG_LOCALPREFIXEXCLUDE,
2565 "the localprefix may not be used for non-local identifiers",
2566 "An identifier that is not a local variable starts with the localprefix.",
2570 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2571 "uncheckedmacroprefix",
2572 FLG_UNCHECKEDMACROPREFIX,
2573 "set namespace prefix for unchecked macros",
2574 "An unchecked macro name does not start with the uncheckedmacroprefix",
2578 FK_NAMES, FK_PREFIX, plainFlag,
2579 "uncheckedmacroprefixexclude",
2580 FLG_UNCHECKEDMACROPREFIXEXCLUDE,
2581 "the uncheckmacroprefix may not be used for identifiers that are not "
2583 "An identifier that is not the name of an unchecked macro "
2584 "starts with the uncheckedmacroprefix.",
2588 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2591 "set namespace prefix for constants",
2592 "A constant does not start with the constantprefix",
2596 FK_NAMES, FK_PREFIX, plainFlag,
2597 "constprefixexclude",
2598 FLG_CONSTPREFIXEXCLUDE,
2599 "the constprefix may not be used for non-constant identifiers",
2600 "An identifier that is not a constant starts with the constantprefix.",
2604 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2607 "set namespace prefix for iterators",
2608 "An iter does not start with the iterator prefix",
2612 FK_NAMES, FK_PREFIX, plainFlag,
2613 "iterprefixexclude",
2614 FLG_ITERPREFIXEXCLUDE,
2615 "the iterprefix may not be used for non-iter identifiers",
2616 "An identifier that is not a iter starts with the iterprefix.",
2620 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2622 FLG_DECLPARAMPREFIX,
2623 "set namespace prefix for parameters in function prototype declarations",
2624 "A parameter name in a function prototype declaration does not start with the "
2625 "declaration parameter prefix",
2629 /* 12.3 Naming Restrictions */
2631 FK_NAMES, FK_ANSI, modeFlag,
2634 "external name conflicts with name reserved for system or standard library",
2635 "External name is reserved for system use by ISO C99 standard.",
2639 FK_NAMES, FK_ANSI, modeFlag,
2642 "external or internal name is a C++ keyword or reserved word",
2643 "External name is a C++ keyword or reserved word. "
2644 "This could lead to problems if the "
2645 "code is compiled with a C++ compiler.",
2649 FK_NAMES, FK_ANSI, modeFlag,
2650 "isoreservedinternal",
2651 FLG_ISORESERVEDLOCAL,
2652 "internal name conflicts with name reserved for system or standard library",
2653 "Internal name is reserved for system in ISO C99 standard (this should not be necessary unless you are worried about C library implementations that violate the standard and use macros).",
2657 FK_NAMES, FK_ANSI, plainFlag,
2658 "distinctexternalnames",
2659 FLG_DISTINCTEXTERNALNAMES,
2660 "external name is not distinguishable from another external name using "
2661 "the number of significant characters",
2662 "An external name is not distinguishable from another external name "
2663 "using the number of significant characters. According to "
2664 "ANSI Standard (3.1), an implementation may only consider the first 6 "
2665 "characters significant, and ignore alphabetical case "
2666 "distinctions (ISO C99 requires 31). The "
2667 "+externalnamelen <n> flag may be used to change the number "
2668 "of significant characters, and -externalnamecaseinsensitive to make "
2669 "alphabetical case significant in external names.",
2673 FK_NAMES, FK_ANSI, specialValueFlag,
2675 FLG_EXTERNALNAMELEN,
2676 "set the number of significant characters in an external name",
2677 "Sets the number of significant characters in an external name (default is 6 for old "
2678 "ANSI89 limit, C99 requires 31). "
2679 "Sets +distinctexternalnames.",
2683 FK_NAMES, FK_ANSI, plainSpecialFlag,
2684 "externalnamecaseinsensitive",
2685 FLG_EXTERNALNAMECASEINSENSITIVE,
2686 "alphabetic comparisons for external names are case-insensitive",
2687 "Make alphabetic case insignificant in external names. By ANSI89 "
2688 "standard, case need not be significant in an external name. "
2689 "If +distinctexternalnames is not set, sets "
2690 "+distinctexternalnames with unlimited external name length.",
2694 FK_NAMES, FK_ANSI, plainFlag,
2695 "distinctinternalnames",
2696 FLG_DISTINCTINTERNALNAMES,
2697 "internal name is not distinguishable from another internal name using "
2698 "the number of significant characters",
2699 "An internal name is not distinguishable from another internal name "
2700 "using the number of significant characters. According to "
2701 "ANSI89 Standard (3.1), an implementation may only consider the first 31 "
2702 "characters significant (ISO C99 specified 63). The "
2703 "+internalnamelen <n> flag changes the number "
2704 "of significant characters, -internalnamecaseinsensitive to makes "
2705 "alphabetical case significant, and "
2706 "+internalnamelookalike to make similar-looking characters "
2711 FK_NAMES, FK_ANSI, specialValueFlag,
2713 FLG_INTERNALNAMELEN,
2714 "set the number of significant characters in an internal name",
2715 "Sets the number of significant characters in an internal name (ANSI89 "
2716 "default is 31.) Sets +distinctinternalnames.",
2720 FK_NAMES, FK_ANSI, plainSpecialFlag,
2721 "internalnamecaseinsensitive",
2722 FLG_INTERNALNAMECASEINSENSITIVE,
2723 "set whether case is significant an internal names "
2724 "(-internalnamecaseinsensitive means case is significant)" ,
2725 "Set whether case is significant an internal names "
2726 "(-internalnamecaseinsensitive "
2727 "means case is significant). By ANSI89 default, case is not "
2728 "significant. If +distinctinternalnames is not set, sets "
2729 "+distinctinternalnames with unlimited internal name length.",
2733 FK_NAMES, FK_ANSI, plainSpecialFlag,
2734 "internalnamelookalike",
2735 FLG_INTERNALNAMELOOKALIKE,
2736 "lookalike characters match in internal names",
2737 "Set whether similar looking characters (e.g., \"1\" and \"l\") "
2738 "match in internal names.",
2742 FK_NAMES, FK_PREFIX, modeFlag,
2745 "a parameter in a function prototype has a name",
2746 "A parameter in a function prototype has a name. This is dangerous, "
2747 "since a macro definition could be visible here.",
2751 FK_NAMES, FK_PREFIX, modeFlag,
2754 "the name of a parameter in a function prototype and corresponding "
2755 "declaration must match (after removing the protoparamprefix",
2756 "A parameter in a function definition does not have the same name as "
2757 "the corresponding in the declaration of the function after "
2758 "removing the protoparamprefix",
2762 FK_NAMES, FK_PREFIX, plainFlag,
2763 "protoparamprefixexclude",
2764 FLG_DECLPARAMPREFIXEXCLUDE,
2765 "the protoparamprefix may not be used for non-declaraction parameter identifiers",
2766 "An identifier that is not a parameter name in a function prototype "
2767 "starts with the protoparamprefix.",
2775 /* 13.1 Unused Declarations */
2778 FK_USE, FK_COMPLETE, modeFlag,
2781 "declaration at top level not used",
2782 "An external declaration not used in any source file.", 0, 0
2785 FK_USE, FK_EXPORT, modeFlag,
2788 "a declaration is exported but not used outside this module",
2789 "A declaration is exported, but not used outside this module. "
2790 "Declaration can use static qualifier.",
2794 FK_USE, FK_EXPORT, modeFlag,
2797 "a declaration is exported but does not appear in a header file",
2798 "A declaration is exported, but does not appear in a header file.",
2802 FK_USE, FK_EXPORT, modeFlag,
2804 FLG_EXPORTHEADERVAR,
2805 "a variable declaration is exported but does not appear in a header file",
2806 "A variable declaration is exported, but does not appear in a header "
2807 "file. (Used with exportheader.)",
2811 FK_USE, FK_NONE, modeFlag,
2814 "field of structure type not used",
2815 "A field is present in a structure type but never used. Use /*@unused@*/ in front of field declaration to suppress message.",
2819 FK_USE, FK_NONE, modeFlag,
2822 "member of an enum type not used",
2823 "A member of an enum type is never used.",
2827 FK_USE, FK_NONE, modeFlag,
2830 "constant declared but not used",
2831 "A constant is declared but not used. Use unused in the constant declaration to suppress message.",
2835 FK_USE, FK_NONE, modeFlag,
2838 "function declared but not used",
2839 "A function is declared but not used. Use /*@unused@*/ in front of function header to suppress message.",
2843 FK_USE, FK_PARAMS, modeFlag,
2846 "function parameter not used ",
2847 "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.",
2851 FK_USE, FK_TYPE, modeFlag,
2854 "type declared but not used",
2855 "A type is declared but not used. Use /*@unused@*/ in front of typedef to suppress messages.",
2859 FK_USE, FK_NONE, modeFlag,
2862 "variable declared but not used",
2863 "A variable is declared but never used. Use /*@unused@*/ in front "
2864 "of declaration to suppress message.",
2868 FK_USE, FK_COMPLETE, modeFlag,
2871 "unused declaration in special file (corresponding to .l or .y file)",
2875 /* 13.2 Complete Programs */
2878 FK_COMPLETE, FK_NONE, modeFlag,
2881 "function or variable declared but never defined",
2882 "A function or variable is declared, but not defined in any source code file.",
2886 FK_COMPLETE, FK_SPEC, modeFlag,
2889 "function or variable specified but never defined",
2890 "A function or variable is declared in an .lcl file, but not defined in any source code file.",
2894 FK_COMPLETE, FK_SPEC, plainFlag,
2897 "function or variable specified but never declared in a source file",
2898 "A function or variable is declared in an .lcl file, but not declared "
2899 "in any source code file.",
2903 FK_DECL, FK_LIBS, plainFlag,
2906 "report new global declarations in source files",
2907 "There is a new declaration that is not declared in a loaded library "
2908 "or earlier file. (Use this flag to check for consistency "
2909 "against a library.)",
2913 FK_INIT, FK_SPEC, plainFlag,
2916 "information in specifications is not also included in syntactic comments",
2917 "There is information in the specification that is not duplicated "
2918 "in syntactic comments. Normally, this is not an "
2919 "error, but it may be useful to detect it to make "
2920 "sure checking incomplete systems without the specifications will "
2921 "still use this information.",
2926 ** 14. Libraries and Header File Inclusion
2929 /* 14.1 Standard Libraries */
2932 FK_LIBS, FK_INIT, idemGlobalFlag,
2935 "do not load standard library",
2939 FK_LIBS, FK_INIT, idemGlobalFlag,
2942 "use normal standard library",
2943 "Library based on the ISO standard library specification is used.",
2947 FK_LIBS, FK_INIT, idemGlobalFlag,
2950 "interpret standard library strictly",
2951 "Stricter version of the standard library is used. (The default "
2952 "library is standard.lcd; strict library is strict.lcd.)",
2956 FK_LIBS, FK_INIT, idemGlobalFlag,
2959 "use UNIX (sort-of) standard library",
2960 "UNIX version of the standard library is used.",
2964 FK_LIBS, FK_INIT, idemGlobalFlag,
2967 "use strict version of UNIX (sort-of) library",
2968 "strict version of the UNIX library is used.",
2972 FK_LIBS, FK_INIT, idemGlobalFlag,
2975 "use POSIX standard library",
2976 "POSIX version of the standard library is used.",
2980 FK_LIBS, FK_INIT, idemGlobalFlag,
2983 "use strict POSIX standard library",
2984 "POSIX version of the strict standard library is used.",
2988 FK_LIBS, FK_INIT, idemGlobalFlag,
2991 "show standard library filename",
2995 FK_LIBS, FK_ANSI, plainFlag,
2998 "a POSIX header is included, but the POSIX library is not used",
2999 "Header name matches a POSIX header, but the POSIX library is not selected.",
3003 FK_LIBS, FK_ANSI, plainFlag,
3006 "warn when the unix library is used",
3007 "Unix library may not be compatible with all platforms",
3011 FK_LIBS, FK_ANSI, plainFlag,
3014 "non-standard <varargs.h> included",
3015 "Header <varargs.h> is not part of ANSI Standard. "
3016 "Should use <stdarg.h> instead.",
3020 FK_HEADERS, FK_FILES, plainFlag,
3021 "caseinsensitivefilenames",
3022 FLG_CASEINSENSITIVEFILENAMES,
3023 "file names are case insensitive (file.h and FILE.H are the same file)",
3027 /* 14.2 Generating Libraries */
3030 FK_LIBS, FK_FILES, globalStringFlag, ARG_FILE,
3033 "save state for merging (default suffix .lcd)",
3037 FK_LIBS, FK_FILES, globalStringFlag, ARG_FILE,
3040 "load state from dump file (default suffix .lcd)",
3044 /* 14.3 Header File Inclusion */
3047 FK_HEADERS, FK_SPEED, globalFlag,
3050 "optimize header inclusion to eliminate redundant includes",
3051 "When checking multiple files, each header file is processed only "
3052 "once. This may change the meaning of the code, if the "
3053 "same header file is included in different contexts (e.g., the "
3054 "header file includes #if directives and the values are "
3055 "different when it is included in different places.)",
3059 FK_HEADERS, FK_SPEED, globalFlag,
3062 "optimize header inclusion to not include any header files",
3063 "Ignore header includes. Only works if relevant information is "
3064 "loaded from a library.",
3068 FK_HEADERS, FK_SPEED, globalFlag,
3071 "do not include header files in system directories (set by -sysdirs)",
3072 "Do not include header files in system directories (set by -sysdirs)",
3086 FK_SYNTAX, FK_ANSI, plainFlag,
3089 "support some gnu (gcc) language extensions",
3090 "ANSI C does not allow some language features supported by gcc and other compilers. "
3091 "Use +gnuextensions to allow some of these extensions.", 0, 0
3097 FK_PROTOS, FK_ANSI, modeFlag,
3100 "function declaration has no parameter list",
3101 "A function declaration does not have a parameter list.",
3105 FK_PROTOS, FK_ANSI, modeFlag,
3108 "old style function definition",
3109 "Function definition is in old style syntax. Standard prototype "
3110 "syntax is preferred.",
3120 FK_SYSTEMFUNCTIONS, FK_TYPE, plainFlag,
3123 "type of main does not match expected type",
3124 "The function main does not match the expected type.",
3128 FK_SYSTEMFUNCTIONS, FK_BEHAVIOR, modeFlag,
3131 "argument to exit has implementation defined behavior",
3132 "The argument to exit should be 0, EXIT_SUCCESS or EXIT_FAILURE",
3137 FK_DECL, FK_NONE, modeFlag,
3140 "declaration reuses name visible in outer scope",
3141 "An outer declaration is shadowed by the local declaration.",
3145 FK_DECL, FK_LIBS, modeFlag,
3148 "function, variable or constant defined in a library is redefined with inconsistent type",
3149 "A function, variable or constant previously defined in a library is "
3150 "redefined with a different type.",
3154 FK_DECL, FK_LIBS, modeFlag,
3157 "library function overloaded",
3158 "A function, variable or constant defined in the library is redefined "
3159 "with a different type.",
3163 FK_DECL, FK_NONE, modeFlag,
3166 "an extern declaration is inside a function scope",
3167 "An extern declaration is used inside a function scope.",
3171 FK_DECL, FK_NONE, modeFlag,
3174 "function or variable redeclared",
3175 "A function or variable is declared in more than one place. This is "
3176 "not necessarily a problem, since the declarations are consistent.",
3180 FK_DECL, FK_NONE, plainFlag,
3183 "function or variable redefined",
3184 "A function or variable is redefined. One of the declarations should use extern.",
3188 FK_DECL, FK_TYPE, modeFlag,
3191 "variable declaration has unknown (implicitly int) type",
3192 "A variable declaration has no explicit type. The type is implicitly int.",
3197 FK_DIRECT, FK_FILES, globalStringFlag, ARG_DIRECTORY,
3200 "set directory for writing temp files",
3204 FK_DIRECT, FK_FILES, globalStringFlag, ARG_PATH,
3207 "set path for searching for library files (overrides LARCH_PATH environment variable)",
3211 FK_DIRECT, FK_FILES, globalStringFlag, ARG_DIRECTORY,
3214 "set directory to search for LCL import files (overrides LCLIMPORTDIR)",
3218 FK_DIRECT, FK_FILES, globalStringFlag, ARG_PATH,
3221 "set directories for system files (default /usr/include). Separate "
3222 "directories with path separator (colons in Unix, semi-colons in Windows). "
3223 "Flag settings propagate to files in a system directory. If "
3224 "-sysdirerrors is set, no errors are reported for files in "
3225 "system directories.",
3229 FK_DIRECT, FK_FILES, plainFlag,
3232 "prevent inclusion of header files in a system directory with "
3233 "names that match standard ANSI headers. The symbolic information "
3234 "in the standard library is used instead. Flag in effect only "
3235 "if a library including the ANSI library is loaded. The ANSI "
3236 "headers are: assert, ctype, errno, float, limits, locale, math, "
3237 "setjmp, signal, stdarg, stddef, stdio, stdlib, strings, string, "
3242 FK_DIRECT, FK_FILES, plainFlag,
3244 FLG_SKIPPOSIXHEADERS,
3245 "prevent inclusion of header files in a system directory with "
3246 "names that match standard POSIX headers. The symbolic information "
3247 "in the posix library is used instead. The POSIX headers are: "
3248 "dirent, fcntl, grp, pwd, termios, sys/stat, sys/times, "
3249 "sys/types, sys/utsname, sys/wait, unistd, and utime.",
3253 FK_DIRECT, FK_SUPPRESS, modeFlag,
3255 FLG_SYSTEMDIRERRORS,
3256 "report errors in files in system directories (set by -sysdirs)",
3260 FK_DIRECT, FK_MACROS, plainFlag,
3261 "sysdirexpandmacros",
3262 FLG_SYSTEMDIREXPAND,
3263 "expand macros in system directories regardless of other settings, "
3264 "except for macros corresponding to names defined in a load library",
3269 FK_DIRECT, FK_HEADERS, globalExtraArgFlag,
3272 "add to C include path",
3276 FK_DIRECT, FK_SPEC, globalExtraArgFlag,
3283 FK_EXPORT, FK_SPEC, specialFlag,
3286 "variable, function or type exported but not specified",
3287 "A variable, function or type is exported, but not specified.",
3291 FK_EXPORT, FK_SPEC, modeFlag,
3294 "function exported but not specified",
3295 "A function is exported, but not specified.", 0, 0
3298 FK_EXPORT, FK_SPEC, modeFlag,
3301 "expanded macro exported but not specified",
3302 "A macro is exported, but not specified.", 0, 0
3305 FK_EXPORT, FK_SPEC, modeFlag,
3308 "type definition exported but not specified",
3309 "A type is exported, but not specified.", 0, 0
3312 FK_EXPORT, FK_SPEC, modeFlag,
3315 "variable exported but not specified",
3316 "A variable is exported, but not specified.", 0, 0
3319 FK_EXPORT, FK_SPEC, modeFlag,
3322 "constant exported but not specified",
3323 "A constant is exported, but not specified.", 0, 0
3326 FK_EXPORT, FK_SPEC, modeFlag,
3329 "constant exported but not specified",
3330 "A constant is exported, but not specified.", 0, 0
3334 FK_FORMAT, FK_DISPLAY, valueFlag,
3337 "set length of messages (number of chars)",
3341 FK_FORMAT, FK_DISPLAY, valueFlag,
3344 "set number of spaces to indent sub-messages",
3348 FK_FORMAT, FK_DISPLAY, valueFlag,
3350 FLG_LOCINDENTSPACES,
3351 "set number of spaces to indent sub-messages that start with file locations",
3355 FK_FORMAT, FK_DISPLAY, plainFlag,
3357 FLG_SHOWDEEPHISTORY,
3358 "show all available information about storage mentioned in warnings",
3362 FK_FORMAT, FK_DISPLAY, plainFlag,
3365 "show column number where error is found",
3369 FK_FORMAT, FK_DISPLAY, plainFlag,
3372 "show location information for load files",
3376 FK_FORMAT, FK_DISPLAY, globalFileFlag,
3379 "produce comma-separated values (CSV) warnings output file",
3383 FK_FORMAT, FK_DISPLAY, plainFlag,
3386 "overwrite exisiting CVS output file",
3390 FK_FORMAT, FK_DISPLAY, plainFlag,
3392 FLG_PARENFILEFORMAT,
3393 "show column number where error is found",
3397 FK_FORMAT, FK_DISPLAY, plainFlag,
3400 "show file locations as links",
3404 FK_FORMAT, FK_NONE, plainFlag,
3407 "show name of function containing error",
3411 FK_FORMAT, FK_NONE, plainFlag,
3414 "show all possible types",
3415 "When a library function is declared with multiple possible type, the "
3416 "alternate types are shown only if +showallconjs.",
3420 FK_LIBS, FK_NONE, plainFlag,
3423 "make all alternate types implicit (useful for making system libraries",
3427 FK_GLOBAL, FK_ERRORS, globalValueFlag,
3430 "expect <int> code errors",
3434 FK_GLOBAL, FK_ERRORS, globalValueFlag,
3437 "expect <int> spec errors",
3441 FK_GLOBAL, FK_USE, idemSpecialFlag,
3444 "check as partial system (-specundef, -declundef, -exportlocal, "
3445 "don't check macros in headers without corresponding .c files)",
3450 ** Appendix D. Specifications
3454 FK_HEADERS, FK_SPEC, globalFlag,
3457 "generate .lh files", NULL,
3461 FK_HEADERS, FK_SPEC, globalFlag,
3464 "generate .lcs files", NULL,
3473 FK_HELP, FK_NONE, plainFlag,
3476 "warn when command line sets flag in abnormal way",
3477 "Command line sets flag in abnormal way",
3481 FK_HELP, FK_NONE, plainFlag,
3484 "warn when there are problems with reading the initialization files",
3485 "There was a problem reading an initialization file",
3489 FK_HELP, FK_NONE, plainFlag,
3492 "warn about bad command line flags",
3493 "A flag is not recognized or used in an incorrect way",
3497 FK_HELP, FK_NONE, plainFlag,
3500 "warn when command line file does not have a recognized extension",
3504 FK_HELP, FK_NONE, globalExtraArgFlag,
3507 "-help <flags> will describe flags",
3512 FK_INIT, FK_FILES, globalFileFlag,
3515 "read an options file (default ~/.splintrc not loaded)",
3516 "Read an options file (instead of loading default ~/.splintc)",
3520 FK_INIT, FK_FILES, globalFileFlag,
3523 "set LCL initilization file",
3527 FK_INIT, FK_FILES, globalFlag,
3530 "do not read options file",
3531 "Do not read the default options file (~/.splintrc)",
3535 FK_INIT, FK_COMMENTS, charFlag,
3538 "set marker character for syntactic comments (default is '@')",
3539 "Set the marker character for syntactic comments. Comments beginning "
3540 "with /*<char> are interpreted by Splint, where <char> is the "
3541 "comment marker character.",
3550 FK_LIMITS, FK_ANSI, modeValueFlag,
3552 FLG_CONTROLNESTDEPTH,
3553 "set maximum nesting depth of compound statements, iteration control "
3554 "structures, and selection control structures (ANSI89 minimum is 15; ISO99 is 63)",
3555 "Maximum number of control levels exceeded.",
3559 FK_LIMITS, FK_ANSI, modeValueFlag,
3561 FLG_STRINGLITERALLEN,
3562 "set maximum length of string literals (ANSI89 minimum is 509; ISO99 is 4095)",
3563 "Maximum length of string literal exceeded.",
3567 FK_LIMITS, FK_ANSI, modeValueFlag,
3569 FLG_NUMSTRUCTFIELDS,
3570 "set maximum number of fields in a struct or union (ANSI89 minimum is 127; ISO99 is 1023)",
3571 "Maximum number of fields in a struct or union exceeded.",
3575 FK_LIMITS, FK_ANSI, modeValueFlag,
3578 "set maximum number of members of an enum (ANSI89 minimum is 127; ISO99 is 1023)",
3579 "Limit on maximum number of members of an enum is exceeded.",
3583 FK_LIMITS, FK_ANSI, modeValueFlag,
3586 "set maximum number of nested #include files (ANSI89 minimum is 8; ISO99 is 63)",
3587 "Maximum number of nested #include files exceeded.",
3591 FK_LIMITS, FK_ANSI, specialFlag,
3594 "check for violations of standard limits (controlnestdepth, "
3595 "stringliterallen, includenest, numstructfields, numenummembers) based on ANSI89 standard",
3600 FK_LIMITS, FK_ANSI, specialFlag,
3603 "check for violations of standard limits (controlnestdepth, "
3604 "stringliterallen, includenest, numstructfields, numenummembers) based on ISO99 standard",
3610 FK_PREPROC, FK_NONE, globalExtraArgFlag,
3613 "passed to pre-processor",
3617 FK_PREPROC, FK_NONE, globalExtraArgFlag,
3620 "passed to pre-processor",
3624 FK_PREPROC, FK_SYNTAX, plainFlag,
3626 FLG_UNRECOGDIRECTIVE,
3627 "unrecognized pre-processor directive",
3628 "Pre-processor directive is not recognized.",
3632 FK_SUPPRESS, FK_COMMENTS, globalFlag,
3635 "The number of errors detected does not match number in /*@i<n>@*/.",
3639 FK_SUPPRESS, FK_ERRORS, valueFlag,
3642 "limit <int> consecutive repeated errors",
3646 FK_SYNTAX, FK_NONE, plainFlag,
3649 "syntax error in parsing",
3650 "Code cannot be parsed. For help on parse errors, see splint -help parseerrors.",
3654 FK_SYNTAX, FK_NONE, plainFlag,
3657 "try to recover from parse error",
3658 "Try to recover from parse error. It really means try - this doesn't usually work.", 0, 0
3661 FK_SYNTAX, FK_PREPROC, plainFlag,
3664 "preprocessing error",
3665 "Preprocessing error.",
3670 FK_TYPE, FK_NONE, plainFlag,
3674 "Types are incompatible.",
3679 FK_TYPE, FK_NONE, plainFlag,
3680 "stringliteraltoolong",
3681 FLG_STRINGLITTOOLONG,
3682 "string literal too long for character array",
3683 "A string literal is assigned to a char array too small to hold it.",
3687 FK_TYPE, FK_NONE, modeFlag,
3688 "stringliteralnoroomfinalnull",
3689 FLG_STRINGLITNOROOMFINALNULL,
3690 "string literal leaves no room for null terminator",
3691 "A string literal is assigned to a char array that is not big enough to hold the final null terminator. This may not be a problem because a null character has been explictedly included in the string literal using an escape sequence",
3695 FK_TYPE, FK_NONE, modeFlag,
3696 "stringliteralnoroom",
3697 FLG_STRINGLITNOROOM,
3698 "string literal leaves no room for null terminator",
3699 "A string literal is assigned to a char array that is not big enough to hold the null terminator.",
3703 FK_TYPE, FK_NONE, modeFlag,
3704 "stringliteralsmaller",
3705 FLG_STRINGLITSMALLER,
3706 "string literal is smaller than the char array it is assigned to",
3707 "A string literal is assigned to a char array that smaller than the string literal needs.",
3711 FK_TYPE, FK_NONE, modeFlag,
3714 "enum members must be int values",
3715 "Type of initial values for enum members must be int.",
3720 FK_TYPE, FK_NONE, plainFlag,
3723 "type-mismatch in parameter corresponding to format code in a printf or scanf-like function",
3724 "Type of parameter is not consistent with corresponding code in format string.",
3728 FK_TYPE, FK_NONE, modeFlag,
3731 "format parameter is not a string constant (hence variable arguments cannot be typechecked)",
3732 "Format parameter is not known at compile-time. This can lead to security vulnerabilities because the arguments cannot be type checked.",
3736 FK_TYPE, FK_NONE, plainFlag,
3739 "invalid format code in format string for printf or scanf-like function",
3740 "Format code in a format string is not valid.",
3744 FK_TYPEEQ, FK_ABSTRACT, modeFlag,
3747 "forward declarations of pointers to abstract representation match abstract type",
3751 FK_TYPEEQ, FK_ABSTRACT, modeFlag,
3754 "void * matches pointers to abstract types, casting ok (dangerous)",
3755 "A pointer to void is cast to a pointer to an abstract type (or vice versa).",
3759 FK_TYPEEQ, FK_POINTER, plainFlag,
3762 "a pointer to a function is cast to a pointer to void (or vice versa)",
3763 "A pointer to a function is cast to (or used as) a pointer to void (or vice versa).",
3767 FK_TYPEEQ, FK_ARRAY, modeFlag,
3770 "char can be used to index arrays",
3771 "To allow char types to index arrays, use +charindex.", 0, 0
3774 FK_TYPEEQ, FK_ARRAY, modeFlag,
3777 "enum can be used to index arrays",
3778 "To allow enum types to index arrays, use +enumindex.", 0, 0
3781 FK_TYPEEQ, FK_BOOL, modeFlag,
3784 "bool and int are equivalent",
3785 "To make bool and int types equivalent, use +boolint.",
3789 FK_TYPEEQ, FK_NONE, modeFlag,
3792 "char and int are equivalent",
3793 "To make char and int types equivalent, use +charint.",
3797 FK_TYPEEQ, FK_NONE, modeFlag,
3800 "enum and int are equivalent",
3801 "To make enum and int types equivalent, use +enumint.",
3805 FK_TYPEEQ, FK_NONE, modeFlag,
3808 "long int and int are equivalent",
3809 "To make long int and int types equivalent, use +longint.",
3813 FK_TYPEEQ, FK_NONE, modeFlag,
3816 "short int and int are equivalent",
3817 "To make short int and int types equivalent, use +shortint.",
3821 FK_TYPEEQ, FK_NONE, modeFlag,
3824 "float and double are equivalent",
3825 "To make float and double types equivalent, use +floatdouble.",
3829 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3832 "ignore type qualifiers (long, short, unsigned)",
3833 "To ignore type qualifiers in type comparisons use +ignorequals.",
3837 FK_TYPEEQ, FK_SYNTAX, plainFlag,
3840 "report duplicate type qualifiers (e.g., unsigned unsigned)",
3841 "Duplicate type qualifiers not supported by ISO standard.",
3845 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3848 "ignore signs in type comparisons (unsigned matches signed)",
3849 "To ignore signs in type comparisons use +ignoresigns",
3853 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3856 "int literals can be reals",
3857 "An int literal is used as any numeric type (including float and long long). Use +numliteral to "
3858 "allow int literals to be used as any numeric type.",
3862 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3865 "character constants (e.g., 'a') can be used as ints",
3866 "A character constant is used as an int. Use +charintliteral to "
3867 "allow character constants to be used as ints. (This is safe "
3868 "since the actual type of a char constant is int.)",
3872 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3875 "report qualifier mismatches only if dangerous",
3876 "To allow qualifier mismatches that are not dangerous, use +relaxquals.", 0, 0
3879 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3882 "allow all numeric types to match",
3883 "To allow all numeric types to match, use +relaxtypes.", 0, 0
3886 FK_TYPEEQ, FK_NONE, modeFlag,
3888 FLG_CHARUNSIGNEDCHAR,
3889 "allow char and unsigned char types to match",
3890 "To allow char and unsigned char types to match use +charunsignedchar.",
3894 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3896 FLG_MATCHANYINTEGRAL,
3897 "allow any intergral type to match an arbitrary integral type (e.g., dev_t)",
3898 "To allow arbitrary integral types to match any integral type, use +matchanyintegral.",
3902 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3903 "longunsignedintegral",
3904 FLG_LONGUNSIGNEDINTEGRAL,
3905 "allow long unsigned type to match an arbitrary integral type (e.g., dev_t)",
3906 "To allow arbitrary integral types to match long unsigned, use +longunsignedintegral.",
3910 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3913 "allow long type to match an arbitrary integral type (e.g., dev_t)",
3914 "To allow arbitrary integral types to match long unsigned, use +longintegral.",
3918 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3919 "longunsignedunsignedintegral",
3920 FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL,
3921 "allow long unsigned type to match an arbitrary unsigned integral type (e.g., size_t)",
3922 "To allow arbitrary unsigned integral types to match long unsigned, "
3923 "use +longunsignedunsignedintegral.",
3927 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3928 "longsignedintegral",
3929 FLG_LONGSIGNEDINTEGRAL,
3930 "allow long type to match an arbitrary signed integral type (e.g., ssize_t)",
3931 "To allow arbitrary signed integral types to match long unsigned, use +longsignedintegral.",
3935 FK_TYPEEQ, FK_POINTER, plainFlag,
3938 "treat 0 as a pointer",
3942 FK_TYPEEQ, FK_BOOL, modeFlag,
3945 "treat 0 as a boolean",
3949 FK_UNRECOG, FK_DISPLAY, plainFlag,
3952 "do not suppress repeated unrecognized identifier messages (instead of only reporting the first error)",
3953 "Identifier used in code has not been declared. (Message repeated for future uses in this file.)",
3957 FK_UNRECOG, FK_DISPLAY, plainFlag,
3960 "report unrecognized identifiers with system (__) prefix",
3961 "Identifier used in code has not been declared. (Message repeated for "
3962 "future uses in this file.) Use +gnuextensions to make Splint "
3963 "recognize some keywords that are gnu extensions.",
3967 FK_UNRECOG, FK_NONE, plainFlag,
3970 "unrecognized identifier",
3971 "Identifier used in code has not been declared.", 0, 0
3976 FK_DECL, FK_TYPE, plainFlag,
3978 FLG_ANNOTATIONERROR,
3979 "annotation is used in inconsistent location",
3980 "A declaration uses an invalid annotation.",
3984 FK_DECL, FK_TYPE, plainFlag,
3987 "inconsistent syntactic comment",
3988 "A syntactic comment is used inconsistently.",
3997 FK_WARNUSE, FK_NONE, plainFlag,
4000 "warn when declaration marked with warn is used",
4001 "Declaration marked with warn clause is used (can be suppresed by more specific flags).",
4005 FK_WARNUSE, FK_SECURITY, modeFlag,
4008 "possible buffer overflow vulnerability",
4009 "Use of function that may lead to buffer overflow.",
4013 FK_WARNUSE, FK_SECURITY, modeFlag,
4014 "bufferoverflowhigh",
4015 FLG_BUFFEROVERFLOWHIGH,
4016 "likely buffer overflow vulnerability",
4017 "Use of function that may lead to buffer overflow.",
4021 FK_WARNUSE, FK_SECURITY, modeFlag,
4022 "implementationoptional",
4023 FLG_IMPLEMENTATIONOPTIONAL,
4024 "declarator is implementation optional (ISO99 does not require an implementation to provide it)",
4025 "Use of a declarator that is implementation optional, not required by ISO99.",
4029 FK_WARNUSE, FK_NONE, modeFlag,
4032 "legacy declaration in Unix Standard",
4033 "Use of a declarator that is marked as a legacy entry in the Unix Standard.",
4037 FK_WARNUSE, FK_SECURITY, modeFlag,
4040 "function is not reentrant",
4041 "Non-reentrant function should not be used in multithreaded code.",
4045 FK_WARNUSE, FK_SECURITY, modeFlag,
4048 "function may have undefined behavior",
4049 "Use of function that may have implementation-dependent behavior.",
4053 FK_WARNUSE, FK_SECURITY, modeFlag,
4056 "function is restricted to superusers",
4057 "Call to function restricted to superusers.",
4061 FK_WARNUSE, FK_SECURITY, modeFlag,
4064 "possible time of check, time of use vulnerability",
4065 "Possible time of check, time of use vulnerability.",
4069 FK_WARNUSE, FK_SECURITY, modeFlag,
4072 "function is not required in Standard UNIX Specification",
4073 "Use of function that need not be provided by UNIX implementations",
4078 ** ITS4 Compability Flags
4080 ** These flags flags must appear in order (most severe -> weakest).
4084 FK_ITS4, FK_SECURITY, specialFlag,
4087 "most risky security vulnerabilities (from its4 database)",
4088 "Security vulnerability classified as most risky in its4 database.",
4092 FK_ITS4, FK_SECURITY, specialFlag,
4095 "very risky security vulnerabilities (from its4 database)",
4096 "Security vulnerability classified as very risky in its4 database.",
4100 FK_ITS4, FK_SECURITY, specialFlag,
4103 "risky security vulnerabilities (from its4 database)",
4104 "Security vulnerability classified as risky in its4 database.",
4108 FK_ITS4, FK_SECURITY, specialFlag,
4110 FLG_ITS4MODERATERISK,
4111 "moderately risky security vulnerabilities (from its4 database)",
4112 "Security vulnerability classified as moderate risk in its4 database.",
4116 FK_ITS4, FK_SECURITY, specialFlag,
4119 "risky security vulnerabilities (from its4 database)",
4120 "Security vulnerability classified as risky in its4 database.",
4125 ** Syntactic comments
4129 FK_SYNCOMMENTS, FK_SUPPRESS, plainFlag,
4132 "ignore all stylized comments",
4136 FK_SYNCOMMENTS, FK_ABSTRACT, plainFlag,
4139 "ignore access comments",
4144 FK_SYNCOMMENTS, FK_SYNTAX, plainFlag,
4146 FLG_UNRECOGCOMMENTS,
4147 "stylized comment is unrecognized",
4148 "Word after a stylized comment marker does not correspond to a "
4149 "stylized comment.",
4153 FK_SYNCOMMENTS, FK_SYNTAX, plainFlag,
4154 "unrecogflagcomments",
4155 FLG_UNRECOGFLAGCOMMENTS,
4156 "stylized flag comment uses an unrecognized flag",
4157 "Semantic comment attempts to set a flag that is not recognized.",
4161 FK_SYNCOMMENTS, FK_SUPPRESS, modeFlag,
4164 "interpret t comments (ignore errors in lines marked with /*@t<n>@*/",
4168 FK_SYNCOMMENTS, FK_SUPPRESS, plainFlag,
4171 "interpret traditional lint comments (/*FALLTHROUGH*/, /*NOTREACHED*/)",
4175 FK_SYNCOMMENTS, FK_SUPPRESS, modeFlag,
4177 FLG_WARNLINTCOMMENTS,
4178 "warn when a traditional lint comment is used",
4179 "A traditional lint comment is used. Some traditional lint comments "
4180 "are interpreted by Splint to enable easier checking of legacy "
4181 "code. It is preferable to replace these comments with the "
4182 "suggested Splint alternative.",
4191 FK_COMMENTS, FK_SYNTAX, plainFlag,
4193 FLG_CONTINUECOMMENT,
4194 "line continuation marker (\\) in comment before */ on same line",
4195 "A line continuation marker (\\) appears inside a comment on the same "
4196 "line as the comment close. Preprocessors should handle this "
4197 "correctly, but it causes problems for some preprocessors.",
4201 FK_COMMENTS, FK_SYNTAX, plainFlag,
4202 "slashslashcomment",
4203 FLG_SLASHSLASHCOMMENT,
4204 "use of // comment",
4205 "A // comment is used. ISO C99 allows // comments, but earlier standards did not.",
4209 FK_COMMENTS, FK_SYNTAX, plainFlag,
4212 "comment begins inside comment",
4213 "A comment open sequence (/*) appears within a comment. This usually "
4214 "means an earlier comment was not closed.",
4219 ** Flags for controlling warning message printing.
4225 FK_DISPLAY, FK_ERRORS, plainFlag,
4228 "suppress herald and error count",
4233 ** Default is to send messages, warnings and errors to stderr
4237 FK_DISPLAY, FK_ERRORS, idemGlobalFlag,
4238 "messagestreamstdout",
4239 FLG_MESSAGESTREAMSTDOUT,
4240 "send status messages to standard output stream",
4244 FK_DISPLAY, FK_ERRORS, idemGlobalFlag,
4245 "messagestreamstderr",
4246 FLG_MESSAGESTREAMSTDERR,
4247 "send status messages to standard error stream",
4251 FK_DISPLAY, FK_ERRORS, globalStringFlag, ARG_FILE,
4254 "send status messages to <file>",
4259 FK_DISPLAY, FK_ERRORS, idemGlobalFlag,
4260 "warningstreamstdout",
4261 FLG_WARNINGSTREAMSTDOUT,
4262 "send warnings to standard output stream",
4266 FK_DISPLAY, FK_ERRORS, idemGlobalFlag,
4267 "warningstreamstderr",
4268 FLG_WARNINGSTREAMSTDERR,
4269 "send warnings to standard error stream",
4273 FK_DISPLAY, FK_ERRORS, globalStringFlag, ARG_FILE,
4276 "send warnings to <file>",
4281 FK_DISPLAY, FK_ERRORS, idemGlobalFlag,
4282 "errorstreamstdout",
4283 FLG_ERRORSTREAMSTDOUT,
4284 "send fatal errors to standard output stream",
4288 FK_DISPLAY, FK_ERRORS, idemGlobalFlag,
4289 "errorstreamstderr",
4290 FLG_ERRORSTREAMSTDERR,
4291 "send fatal errors to standard error stream",
4295 FK_DISPLAY, FK_ERRORS, globalStringFlag, ARG_FILE,
4298 "send fatal errors to <file>",
4303 FK_DISPLAY, FK_ERRORS, globalFlag,
4305 FLG_STREAMOVERWRITE,
4306 "warn and exit if a stream output file would overwrite an existing file",
4312 FK_DISPLAY, FK_ERRORS, plainFlag,
4315 "show summary of all errors reported and suppressed",
4319 FK_DISPLAY, FK_FILES, plainFlag,
4322 "show file names are they are processed",
4326 FK_DISPLAY, FK_FILES, plainFlag,
4329 "Splint has been run on a system file, by default no errors are reported for system files. Use +systemdirerrors if you want splint to report errors in system files. A file is considered a system file if it is in a system directory or a subdirectory of a system directory. The sysdirs flag can be used to control the directories treated as system directories.",
4333 FK_DISPLAY, FK_NONE, globalFlag,
4336 "display lines processed and time",
4340 FK_DISPLAY, FK_NONE, globalFlag,
4343 "display time distribution",
4347 FK_DISPLAY, FK_USE, globalFlag,
4350 "show sorted list of uses of all globals",
4357 FK_HINTS, FK_FORMAT, plainFlag,
4360 "provide a hint the first time a particular warning appears",
4361 "Provide a hint the first time a particular warning appears",
4365 FK_HINTS, FK_FORMAT, plainFlag,
4368 "provide a hint for every warnings",
4369 "Provide a hint for every warning",
4374 ** Flags for debugging
4378 FK_DEBUG, FK_NONE, valueFlag,
4381 "set maximum number of bugs detected before giving up",
4385 FK_DEBUG, FK_BOUNDS, plainFlag,
4386 "debugfcnconstraint",
4387 FLG_DEBUGFUNCTIONCONSTRAINT,
4388 "debug function constraints",
4389 "Perform buffer overflow checking even if the errors would be surpressed.",
4393 FK_DEBUG, FK_NONE, specialDebugFlag,
4396 "debug parsing", NULL,
4400 FK_DEBUG, FK_NONE, debugFlag,
4403 "do not delete temporary files", NULL,
4407 FK_DEBUG, FK_NONE, debugFlag,
4410 "do not pre-process input files", NULL,
4414 FK_DEBUG, FK_NONE, debugFlag,
4417 "display the source code location where a warning is produced", NULL,