2 ** vim
: set syntax
=c filetype
=c shiftwidth
=2 softtabstop
=2 expandtab
:
6 ** This file is used to generate the flag header files.
9 /* spec idem global mode
*/
12 # define plainFlag
FALSE, FALSE, FALSE, FALSE
14 # define specialFlag
TRUE, FALSE, FALSE, FALSE
16 # define idemFlag
FALSE, TRUE, FALSE, FALSE
18 # define globalFlag
FALSE, FALSE, TRUE, FALSE
20 # define modeFlag
FALSE, FALSE, FALSE, TRUE
22 # define idemSpecialFlag
TRUE, TRUE, FALSE, FALSE
24 # define idemGlobalFlag
FALSE, TRUE, TRUE, FALSE
28 ** Note
: the flag code must be on a separate line
, since I
'm
29 ** too stupid to write an awk/sed/whatever script that can separate
33 static flaglist flags =
36 ** Null Dereferences (Manual Section 2)
40 FK_NULL, FK_MEMORY, specialFlag, ARG_NONE,
43 "misuses of null pointer",
44 "A possibly null pointer is misused (sets nullderef, nullpass, "
45 "nullref, nullassign, and nullstate).",
49 FK_NULL, FK_MEMORY, modeFlag, ARG_NONE,
52 "possible dereferencce of null pointer",
53 "A possibly null pointer is dereferenced. Value is "
54 "either the result of a function which may return null "
55 "(in which case, code should check it is not null), or a "
56 "global, parameter or structure field declared with the "
61 FK_NULL, FK_MEMORY, modeFlag, ARG_NONE,
64 "possibly null pointer passed as formal with no null annotation",
65 "A possibly null pointer is passed as a parameter corresponding to "
66 "a formal parameter with no /*@null@*/ annotation. If NULL "
67 "may be used for this parameter, add a /*@null@*/ annotation "
68 "to the function parameter declaration.",
72 FK_NULL, FK_MEMORY, modeFlag, ARG_NONE,
75 "possibly null pointer returned as result with no null annotation",
76 "Function returns a possibly null pointer, but is not declared "
77 "using /*@null@*/ annotation of result. If function may "
78 "return NULL, add /*@null@*/ annotation to the return "
83 FK_NULL, FK_MEMORY, modeFlag, ARG_NONE,
86 "possibly null pointer reachable from a reference with no null annotation",
87 "A possibly null pointer is reachable from a parameter or global "
88 "variable that is not declared using a /*@null@*/ annotation.",
92 FK_NULL, FK_MEMORY, modeFlag, ARG_NONE,
95 "inconsistent assignment or initialization involving null pointer",
96 "A reference with no null annotation is assigned or initialized "
97 "to NULL. Use /*@null@*/ to declare the reference as "
98 "a possibly null pointer.",
102 FK_NULL, FK_MEMORY, plainFlag, ARG_NONE,
105 "inconsistent initialization involving null pointer",
106 "A reference with no null annotation is initialized "
107 "to NULL. Use /*@null@*/ to declare the reference as "
108 "a possibly null pointer.",
113 ** Undefined Values (Section 3)
117 FK_DEF, FK_NONE, modeFlag, ARG_NONE,
120 "use before definition",
121 "An rvalue is used that may not be initialized to a value on some execution path.",
125 FK_MEMORY, FK_DEF, modeFlag, ARG_NONE,
128 "out storage not defined before return or scope exit",
129 "An out parameter or global is not defined before control is transferred.",
133 FK_MEMORY, FK_DEF, modeFlag, ARG_NONE,
136 "at least one field of a union must be defined",
137 "No field of a union is defined. Generally, one field of a union is "
138 "expected to be defined.",
142 FK_MEMORY, FK_DEF, modeFlag, ARG_NONE,
145 "parameter, return value or global completely defined",
146 "Storage derivable from a parameter, return value or global is "
147 "not defined. Use /*@out@*/ to denote passed or returned "
148 "storage which need not be defined.",
152 FK_DEF, FK_NONE, plainFlag, ARG_NONE,
155 "initializer sets all fields",
156 "Initializer does not set every field in the structure.",
160 FK_DEF, FK_NONE, plainFlag, ARG_NONE,
163 "initializer defines all array elements",
164 "Initializer does not define all elements of a declared array.",
168 FK_DEF, FK_NONE, plainFlag, ARG_NONE,
171 "initializer defines extra array elements",
172 "Initializer block contains more elements than the size of a declared array.",
177 FK_DEF, FK_IMPLICIT, modeFlag, ARG_NONE,
180 "pointer parameters to unspecified functions may be implicit out parameters",
189 FK_DECL, FK_TYPE, modeFlag, ARG_NONE,
192 "function, variable or constant redefined with inconsistent type",
193 "A function, variable or constant is redefined with a different type.",
197 FK_DECL, FK_TYPE, modeFlag, ARG_NONE,
200 "struct or enum type redefined with inconsistent fields or members",
201 "A struct, union or enum type is redefined with inconsistent fields or members.",
205 FK_TYPE, FK_NONE, modeFlag, ARG_NONE,
208 "dereferencce of a function type",
209 "A function type is dereferenced. The ANSI standard allows this "
210 "because of implicit conversion of function designators, however the "
211 "dereference is unnecessary.",
215 FK_OPS, FK_NONE, modeFlag, ARG_NONE,
218 "dangerous equality comparison between reals (dangerous because of inexact "
219 "floating point representations)",
220 "Two real (float, double, or long double) values are compared "
221 "directly using == or != primitive. "
222 "This may produce unexpected results since floating point "
223 "representations are inexact. Instead, compare the difference to "
224 "FLT_EPSILON or DBL_EPSILON.",
228 FK_OPS, FK_NONE, modeFlag, ARG_NONE,
230 FLG_REALRELATECOMPARE,
231 "possibly dangerous relational comparison between reals (dangerous because of inexact "
232 "floating point representations)",
233 "Two real (float, double, or long double) values are compared "
234 "directly using < or >. "
235 "This may produce unexpected results since floating point "
236 "representations are inexact. Instead, compare the difference to "
237 "FLT_EPSILON or DBL_EPSILON.",
241 FK_OPS, FK_NONE, modeFlag, ARG_NONE,
244 "comparison using <, <=, >= between an unsigned integral and zero constant",
245 "An unsigned value is used in a comparison with zero in a way that is either a bug or confusing.",
249 FK_OPS, FK_POINTER, modeFlag, ARG_NONE,
252 "arithmetic involving pointer and integer",
253 "Pointer arithmetic using pointer and integer.", 0, 0
256 FK_OPS, FK_POINTER, modeFlag, ARG_NONE,
258 FLG_NULLPOINTERARITH,
259 "arithmetic involving possibly null pointer and integer",
260 "Pointer arithmetic using a possibly null pointer and integer.", 0, 0
263 FK_OPS, FK_POINTER, modeFlag, ARG_NONE,
266 "comparison between pointer and number",
267 "A pointer is compared to a number.", 0, 0
270 FK_OPS, FK_TYPE, modeFlag, ARG_NONE,
273 "primitive operation does not type check strictly",
274 "A primitive operation does not type check strictly.", 0, 0
277 FK_OPS, FK_TYPE, modeFlag, ARG_NONE,
280 "a bitwise logical operator does not have unsigned operands",
281 "An operand to a bitwise operator is not an unsigned values. This "
282 "may have unexpected results depending on the signed "
283 "representations.", 0, 0
286 FK_OPS, FK_TYPE, modeFlag, ARG_NONE,
289 "a shift right operand may be negative",
290 "The right operand to a shift operator may be negative (behavior undefined).",
294 FK_OPS, FK_TYPE, modeFlag, ARG_NONE,
295 "shiftimplementation",
296 FLG_SHIFTIMPLEMENTATION,
297 "a shift left operand may be negative",
298 "The left operand to a shift operator may be negative (behavior is implementation-defined).",
302 FK_OPS, FK_TYPE, modeFlag, ARG_NONE,
305 "sizeof operator has a type argument",
306 "Operand of sizeof operator is a type. (Safer to use expression, "
307 "int *x = sizeof (*x); instead of sizeof (int).)",
311 FK_OPS, FK_TYPE, plainFlag, ARG_NONE,
313 FLG_SIZEOFFORMALARRAY,
314 "sizeof operator has an array formal parameter argument",
315 "Operand of a sizeof operator is a function parameter declared as "
316 "an array. The value of sizeof will be the size of a pointer to the "
317 "element type, not the number of elements in the array.",
321 FK_DECL, FK_TYPE, plainFlag, ARG_NONE,
323 FLG_FIXEDFORMALARRAY,
324 "formal parameter of type array is declared with size",
325 "A formal parameter is declared as an array with size. The size of the array "
326 "is ignored in this context, since the array formal parameter is treated "
331 FK_DECL, FK_TYPE, plainFlag, ARG_NONE,
334 "formal parameter has an incomplete type",
335 "A formal parameter is declared with an incomplete type.",
339 FK_DECL, FK_TYPE, plainFlag, ARG_NONE,
342 "formal parameter is an array",
343 "A formal parameter is declared as an array. This can be confusing, since "
344 "a formal array parameter is treated as a pointer.",
354 FK_BOOL, FK_NONE, plainFlag, ARG_STRING,
357 "set name of boolean type (default bool)",
361 FK_BOOL, FK_NONE, plainFlag, ARG_STRING,
364 "set name of boolean false (default false)",
368 FK_BOOL, FK_NONE, plainFlag, ARG_STRING,
371 "set name of boolean true (default true)",
375 FK_BOOL, FK_HELP, plainFlag, ARG_NONE,
378 "type name is probably a boolean type but does not match default "
379 "boolean type name, \"bool\", and alternate name is not set",
380 "Use the -booltype, -boolfalse and -booltrue flags to change the "
381 "name of the default boolean type.",
386 FK_BOOL, FK_OPS, modeFlag, ARG_NONE,
389 "comparison between bools (dangerous because of multiple true values)",
390 "Two bool values are compared directly using a C primitive. This "
391 "may produce unexpected results since all non-zero values are "
392 "considered true, so different true values may not be equal. "
393 "The file bool.h (included in splint/lib) provides bool_equal "
394 "for safe bool comparisons.", 0, 0
397 FK_BOOL, FK_OPS, modeFlag, ARG_NONE,
400 "primitive operation (!, && or ||) does not has a boolean argument",
401 "The operand of a boolean operator is not a boolean. Use +ptrnegate "
402 "to allow ! to be used on pointers.",
406 FK_BOOL, FK_POINTER, modeFlag, ARG_NONE,
409 "allow ! to be used on pointer operand",
410 "The operand of ! operator is a pointer.", 0, 0
413 FK_BOOL, FK_PRED,plainFlag, ARG_NONE,
416 "condition test (if, while or for) is an assignment",
417 "The condition test is an assignment expression. Probably, you mean "
418 "to use == instead of =. If an assignment is intended, add an "
419 "extra parentheses nesting (e.g., if ((a = b)) ...) to suppress "
424 FK_BOOL, FK_PRED, specialFlag, ARG_NONE,
427 "type of condition test (if, while or for) not bool (sets predboolint, "
428 "predboolptr and predboolothers)",
429 "Test expression type is not boolean.", 0, 0
432 FK_PRED, FK_BOOL, modeFlag, ARG_NONE,
435 "type of condition test (if, while or for) is an integral type",
436 "Test expression type is not boolean or int.", 0, 0
439 FK_BOOL, FK_PRED, modeFlag, ARG_NONE,
442 "type of condition test (if, while or for) is a pointer",
443 "Test expression type is not boolean.", 0, 0
446 FK_BOOL, FK_PRED, modeFlag, ARG_NONE,
449 "type of condition test (if, while or for) not bool, int or pointer",
450 "Test expression type is not boolean.", 0, 0
454 ** 4.3 Abstract types
458 FK_ABSTRACT, FK_NONE, plainFlag, ARG_NONE,
461 "data abstraction barriers",
462 "An abstraction barrier is broken. If necessary, use /*@access <type>@*/ to allow access to an abstract type.",
466 FK_ABSTRACT, FK_NONE, modeFlag, ARG_NONE,
469 "object equality comparison on abstract type operands",
470 "An object comparison (== or !=) is used on operands of abstract type.",
475 FK_ABSTRACT, FK_NONE, plainFlag, ARG_NONE,
478 "data abstraction barriers",
479 "An abstraction barrier involving a numabstract type is broken. If necessary, use /*@access <type>@*/ to allow access to a numabstract type.",
483 FK_ABSTRACT, FK_NONE, modeFlag, ARG_NONE,
486 "numeric literal cast to numabstract type",
487 "A numeric literal is cast to a numabstract type.",
491 FK_ABSTRACT, FK_NONE, modeFlag, ARG_NONE,
494 "numeric literal can used as numabstract type",
495 "To allow a numeric literal to be used as a numabstract type, use +numabstractlit.",
499 FK_ABSTRACT, FK_TYPEEQ, modeFlag, ARG_NONE,
501 FLG_NUMABSTRACTINDEX,
502 "a numabstract type can be used to index an array",
503 "To allow numabstract types to index arrays, use +numabstractindex.",
507 FK_ABSTRACT, FK_NONE, modeFlag, ARG_NONE,
509 FLG_NUMABSTRACTPRINT,
510 "a numabstract value is printed using %d format code",
511 "A numabstract value is printed usind %d format code in a printf.",
515 FK_ABSTRACT, FK_IMPLICIT, plainFlag, ARG_NONE,
518 "assume user type definitions are abstract (unless /*@concrete@*/ is used)",
526 FK_ABSTRACT, FK_NAMES, plainFlag, ARG_NONE,
529 "allow access to abstract types in definition module",
530 "The representation of an abstract type defined in <M>.<x> is "
531 "accessible anywhere in a file named <M>.<y>.",
535 FK_ABSTRACT, FK_NAMES, plainFlag, ARG_NONE,
538 "allow access to abstract types by file name convention",
539 "The representation of an abstract type named <t> is "
540 "accessible anywhere in a file named <t>.<x>.",
544 FK_ABSTRACT, FK_NAMES, plainFlag, ARG_NONE,
547 "allow access to abstract types by czech naming convention",
548 "The representation of an abstract type named <t> is accessible "
549 "in the definition of a function or constant named <t>_<name>",
553 FK_ABSTRACT, FK_NAMES, plainFlag, ARG_NONE,
556 "allow access to abstract types by slovak naming convention",
557 "The representation of an abstract type named <t> is accessible "
558 "in the definition of a function or constant named <t><Name>",
562 FK_ABSTRACT, FK_NAMES, plainFlag, ARG_NONE,
563 "accessczechoslovak",
564 FLG_ACCESSCZECHOSLOVAK,
565 "allow access to abstract types by czechoslovak naming convention",
566 "The representation of an abstract type named <t> is accessible "
567 "in the definition of a function or constant named <t>_<name> or <t><Name>",
571 FK_ABSTRACT, FK_NAMES, specialFlag, ARG_NONE,
574 "set accessmodule, accessfile and accessczech",
575 "Sets accessmodule, accessfile and accessczech",
579 /* 4.3.2 Mutability */
581 FK_ABSTRACT, FK_NONE, modeFlag, ARG_NONE,
584 "representation of mutable type has sharing semantics",
585 "LCL semantics requires that a mutable type exhibits sharing semantics. "
586 "In order for objects to be shared a indirection is necessary in the representation. "
587 "A mutable type may be represented by a pointer or an abstract mutable type. Handles "
588 "into static data are fine, too, but will generate this error message unless it is suppressed.",
594 ** Memory Management (5)
597 /* Deallocation Errors */
599 FK_MEMORY, FK_LEAK, modeFlag, ARG_NONE,
602 "freshly allocated storage not released before return or scope exit",
603 "A memory leak has been detected. Storage allocated locally "
604 "is not released before the last reference to it is lost.",
608 FK_MEMORY, FK_LEAK, modeFlag, ARG_NONE,
611 "only storage not released before return or scope exit",
612 "A memory leak has been detected. Only-qualified storage is not released before the last "
613 "reference to it is lost.",
617 FK_MEMORY, FK_LEAK, specialFlag, ARG_NONE,
620 "fresh or only storage not released before return or scope exit (sets mustfreefresh and mustfreeonly)",
621 "A memory leak has been detected.",
625 FK_MEMORY, FK_DEAD, modeFlag, ARG_NONE,
628 "storage used after release",
629 "Memory is used after it has been released (either by passing "
630 "as an only param or assigning to an only global).",
634 FK_MEMORY, FK_DEAD, modeFlag, ARG_NONE,
636 FLG_STRICTUSERELEASED,
637 "element used after it may have been released",
638 "Memory (through fetch) is used after it may have been released "
639 "(either by passing as an only param or assigning to an only global).",
643 FK_MEMORY, FK_LEAK, modeFlag, ARG_NONE,
646 "all only references derivable from void pointer out only parameter are released",
647 "A storage leak due to incomplete deallocation of a structure or deep "
648 "pointer is suspected. Unshared storage that is reachable from "
649 "a reference that is being deallocated has not yet been deallocated. "
650 "Splint assumes when an object is passed "
651 "as an out only void pointer that the outer object will be "
652 "deallocated, but the inner objects will not.",
656 FK_MEMORY, FK_LEAK, modeFlag, ARG_NONE,
659 "report complete destruction errors for array elements that "
660 "may have been released",
665 FK_MEMORY, FK_ARRAY, modeFlag, ARG_NONE,
668 "array elements are dependent storage",
669 "When an element is fetched from an array, Splint analysis is "
670 "not able to determine if the same element is reused. "
671 "If +deparrays, Splint will mark local storage assigned from "
672 "array fetches as dependent.",
676 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
679 "storage has inconsistent states of alternate paths through a branch",
680 "The state of a variable is different depending on which branch "
681 "is taken. This means no annotation can sensibly be applied "
686 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
688 FLG_STRICTBRANCHSTATE,
689 "storage through array fetch has inconsistent states of alternate "
690 "paths through a branch",
691 "The state of a variable through an array fetch is different depending "
692 "on which branch is taken. This means no annotation can sensibly be applied "
697 FK_MEMORY, FK_NONE, specialFlag, ARG_NONE,
700 "sets all dynamic memory checking flags (memimplicit, mustfree, mustdefine, "
701 "mustnotalias, null, memtrans)",
705 FK_MEMORY, FK_DEF, modeFlag, ARG_NONE,
708 "actual parameter matches alias kind of formal parameter completely ",
709 "Storage derivable from a parameter does not match the alias kind "
710 "expected for the formal parameter.",
714 FK_MEMORY, FK_DEAD, modeFlag, ARG_NONE,
717 "external reference to stack-allocated storage is created",
718 "A stack reference is pointed to by an external reference when the "
719 "function returns. The stack-allocated storage is destroyed "
720 "after the call, leaving a dangling reference.",
725 FK_MEMORY, FK_NONE, specialFlag, ARG_NONE,
728 "memory transfer errors (sets all *trans flags)",
729 "Memory is transferred in a way that violates annotations.",
733 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
736 "dependent transfer errors",
737 "Dependent storage is transferred to a non-dependent reference.",
741 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
744 "new reference transfer to reference counted reference",
745 "A new reference is transferred to a reference counted reference.",
749 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
752 "only storage transferred to non-only reference (memory leak)",
753 "The only reference to this storage is transferred to another "
754 "reference (e.g., by returning it) that does not have the "
755 "only annotation. This may lead to a memory leak, since the "
756 "new reference is not necessarily released.",
760 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
761 "onlyunqglobaltrans",
762 FLG_ONLYUNQGLOBALTRANS,
763 "only storage transferred to an unqualified global or "
764 "static reference (memory leak)",
765 "The only reference to this storage is transferred to another "
766 "reference that does not have an aliasing annotation. "
767 "This may lead to a memory leak, since the "
768 "new reference is not necessarily released.",
772 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
775 "owned storage transferred to non-owned reference (memory leak)",
776 "The owned reference to this storage is transferred to another "
777 "reference (e.g., by returning it) that does not have the "
778 "owned annotation. This may lead to a memory leak, since the "
779 "new reference is not necessarily released.",
783 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
786 "fresh storage transferred to non-only reference (memory leak)",
787 "Fresh storage (newly allocated in this function) is transferred "
788 "in a way that the obligation to release storage is not "
789 "propagated. Use the /*@only@*/ annotation to indicate "
790 "the a return value is the only reference to the returned "
795 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
798 "shared storage transferred to non-shared reference",
799 "Shared storage is transferred to a non-shared reference. The other "
800 "reference may release storage needed by this reference.",
804 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
807 "temp storage transferred to non-temporary reference",
808 "Temp storage (associated with a formal parameter) is transferred "
809 "to a non-temporary reference. The storage may be released "
810 "or new aliases created.",
814 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
817 "kept storage transferred to non-temporary reference",
818 "storage is transferred "
819 "to a non-temporary reference after being passed as keep parameter. The storage may be released "
820 "or new aliases created.",
824 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
827 "keep storage transferred inconsistently",
828 "Keep storage is transferred inconsistently --- either in a way "
829 "that may add a new alias to it, or release it.",
833 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
836 "an immediate address (result of &) is transferred inconsistently",
837 "An immediate address (result of & operator) is transferred "
842 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
845 "reference counted storage is transferred in an inconsistent way",
846 "Reference counted storage is transferred in a way that may not "
847 "be consistent with the reference count.",
851 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
854 "static storage is transferred in an inconsistent way",
855 "Static storage is transferred in an inconsistent way.",
859 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
862 "unqualified storage is transferred in an inconsistent way",
863 "Unqualified storage is transferred in an inconsistent way.",
867 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
870 "static storage is used as an initial value in an inconsistent way",
871 "Static storage is used as an initial value in an inconsistent way.",
875 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
876 "unqualifiedinittrans",
877 FLG_UNKNOWNINITTRANS,
878 "unqualified storage is used as an initial value in an inconsistent way",
879 "Unqualified storage is used as an initial value in an inconsistent way.",
883 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
886 "report memory transfer errors for initializations to read-only string literals",
887 "A read-only string literal is assigned to a non-observer reference.",
891 FK_MEMORY, FK_PARAMS, modeFlag, ARG_NONE,
894 "passing a value as an un-annotated parameter clears its annotation",
898 /* 5.3 Implicit Memory Annotations */
901 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
904 "string literals are read-only (error if one is modified or released)",
905 "String literals are read-only. An error is reported "
906 "if a string literal may be modified or released.",
910 FK_MEMORY, FK_IMPLICIT, modeFlag, ARG_NONE,
913 "memory errors for unqualified storage",
917 FK_MEMORY, FK_IMPLICIT, plainFlag, ARG_NONE,
920 "assume unannotated parameter is temp",
924 FK_MEMORY, FK_IMPLICIT, specialFlag, ARG_NONE,
927 "sets globimponly, retimponly, structimponly, specglobimponly, "
928 "specretimponly and specstructimponly",
932 FK_MEMORY, FK_IMPLICIT, specialFlag, ARG_NONE,
935 "sets globimponly, retimponly and structimponly",
939 FK_MEMORY, FK_IMPLICIT, specialFlag, ARG_NONE,
942 "sets specglobimponly, specretimponly and specstructimponly",
946 FK_MEMORY, FK_IMPLICIT, plainFlag, ARG_NONE,
949 "assume unannotated global storage is only",
953 FK_MEMORY, FK_IMPLICIT, plainFlag, ARG_NONE,
956 "assume unannotated returned storage is only",
960 FK_MEMORY, FK_IMPLICIT, plainFlag, ARG_NONE,
963 "assume unannotated structure field is only",
967 FK_MEMORY, FK_IMPLICIT, plainFlag, ARG_NONE,
970 "assume unannotated global storage is only",
974 FK_MEMORY, FK_IMPLICIT, plainFlag, ARG_NONE,
977 "assume unannotated returned storage is only",
981 FK_MEMORY, FK_IMPLICIT, plainFlag, ARG_NONE,
983 FLG_SPECSTRUCTIMPONLY,
984 "assume unannotated structure field is only",
988 /* Reference Counting */
996 /* 6.1 Aliasing warnings */
999 FK_ALIAS, FK_MEMORY, modeFlag, ARG_NONE,
1002 "unique parameter is aliased",
1003 "A unique or only parameter is aliased by some other parameter or visible global.",
1007 FK_ALIAS, FK_MEMORY, modeFlag, ARG_NONE,
1010 "unique parameter may be aliased",
1011 "A unique or only parameter may be aliased by some other parameter or visible global.",
1015 FK_ALIAS, FK_MEMORY, modeFlag, ARG_NONE,
1018 "temp storage aliased at return point or scope exit",
1019 "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.",
1023 FK_ALIAS, FK_NONE, modeFlag, ARG_NONE,
1026 "function returns alias to parameter or global",
1027 "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
1030 /* Global aliasing */
1032 FK_ALIAS, FK_GLOBALS, specialFlag, ARG_NONE,
1035 "function returns with global aliasing external state (sets "
1036 "checkstrictglobalias, checkedglobalias, checkmodglobalias and "
1037 "uncheckedglobalias)",
1038 "A global variable aliases externally-visible state when the function returns.",
1042 FK_ALIAS, FK_GLOBALS, modeFlag, ARG_NONE,
1043 "checkstrictglobalias",
1044 FLG_CHECKSTRICTGLOBALIAS,
1045 "function returns with a checkstrict global aliasing external state",
1046 "A global variable aliases externally-visible state when the function returns.",
1050 FK_ALIAS, FK_GLOBALS, modeFlag, ARG_NONE,
1052 FLG_CHECKEDGLOBALIAS,
1053 "function returns with a checked global aliasing external state",
1054 "A global variable aliases externally-visible state when the function returns.",
1058 FK_ALIAS, FK_GLOBALS, modeFlag, ARG_NONE,
1059 "checkmodglobalias",
1060 FLG_CHECKMODGLOBALIAS,
1061 "function returns with a checkmod global aliasing external state",
1062 "A global variable aliases externally-visible state when the function returns.",
1066 FK_ALIAS, FK_GLOBALS, modeFlag, ARG_NONE,
1067 "uncheckedglobalias",
1068 FLG_UNCHECKEDGLOBALIAS,
1069 "function returns with an unchecked global aliasing external state",
1070 "A global variable aliases externally-visible state when the function returns.",
1077 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
1080 "exposure transfer errors",
1081 "Exposed storage is transferred to a non-exposed, non-observer reference.",
1085 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
1088 "observer transfer errors",
1089 "Observer storage is transferred to a non-observer reference.",
1093 FK_EXPOSURE, FK_ABSTRACT, specialFlag, ARG_NONE,
1096 "abstract representation is exposed (sets assignexpose, retexpose, and castexpose)",
1097 "The internal representation of an abstract type is visible to the "
1098 "caller. This means clients may have access to a pointer "
1099 "into the abstract representation.",
1103 FK_EXPOSURE, FK_ABSTRACT, modeFlag, ARG_NONE,
1106 "abstract representation is exposed (return values only)",
1107 "The return value shares storage with an instance of an abstract "
1108 "type. This means clients may have access to a pointer into "
1109 "the abstract representation. Use the observer qualifier to "
1110 "return exposed storage that may not be modified by the "
1111 "client. Use the exposed qualifier to return modifiable "
1112 "(but not deallocatable) exposed storage (dangerous).",
1116 FK_EXPOSURE, FK_ABSTRACT, modeFlag, ARG_NONE,
1119 "abstract representation is exposed (assignments only)",
1120 "Storage internal to the representation of an abstract type is "
1121 "assigned to an external pointer. This means clients may "
1122 "have access to a pointer into the abstract representation. "
1123 "If the external pointer is a parameter, the exposed qualifier "
1124 "can be used to allow the assignment, however, this is "
1125 "considered dangerous programming practice.",
1129 FK_EXPOSURE, FK_ABSTRACT, modeFlag, ARG_NONE,
1132 "abstract representation is exposed through a cast",
1133 "Storage internal to the representation of an abstract type is exposed "
1134 "through a type cast. This means clients may have access to a "
1135 "pointer into the abstract representation.",
1139 FK_DECL, FK_TYPE, modeFlag, ARG_NONE,
1140 "redundantsharequal",
1141 FLG_REDUNDANTSHAREQUAL,
1142 "declaration uses observer qualifier that is always true",
1143 "A declaration of an immutable object uses a redundant observer qualifier.",
1147 FK_DECL, FK_TYPE, modeFlag, ARG_NONE,
1148 "misplacedsharequal",
1149 FLG_MISPLACEDSHAREQUAL,
1150 "declaration of unsharable storage uses sharing annotation",
1151 "A declaration of an unsharable object uses a sharing annotation.",
1156 ** 7. Function Interfaces
1159 /* 7.1 Modifications */
1162 FK_MODIFIES, FK_SPEC, plainFlag, ARG_NONE,
1165 "unspecified modification of caller-visible state",
1166 "An externally-visible object is modified by a function, but not "
1167 "listed in its modifies clause.",
1171 FK_MODIFIES, FK_SPEC, modeFlag, ARG_NONE,
1174 "specified modification is not detected",
1175 "An object listed in the modifies clause is not modified by the "
1176 "implementation of the function. The modification may not "
1177 "be detected if it is done through a call to an unspecified "
1182 FK_MODIFIES, FK_MEMORY, plainFlag, ARG_NONE,
1185 "possible modification of observer storage",
1186 "Storage declared with observer is possibly modified. Observer "
1187 "storage may not be modified.",
1191 FK_MODIFIES, FK_MEMORY, modeFlag, ARG_NONE,
1193 FLG_MODOBSERVERUNCON,
1194 "possible modification of observer storage through unconstrained call",
1195 "Storage declared with observer may be modified through a call to an "
1196 "unconstrained function.",
1200 FK_MODIFIES, FK_MEMORY, modeFlag, ARG_NONE,
1201 "modinternalstrict",
1202 FLG_MODINTERNALSTRICT,
1203 "possible modification of internal storage through function call",
1204 "A function that modifies internalState is called from a function that "
1205 "does not list internalState in its modifies clause",
1209 FK_MODIFIES, FK_UNSPEC, modeFlag, ARG_NONE,
1212 "report undocumented file system modifications (applies to unspecified "
1213 "functions if modnomods is set)",
1217 FK_MODIFIES, FK_UNSPEC, specialFlag, ARG_NONE,
1220 "modification in unspecified functions (sets modnomods, "
1221 "modglobunspec and modstrictglobsunspec)",
1225 FK_MODIFIES, FK_UNSPEC, modeFlag, ARG_NONE,
1228 "modification in a function with no modifies clause",
1229 "An externally-visible object is modified by a function with no "
1230 "/*@modifies@*/ comment. The /*@modifies ... @*/ control "
1231 "comment can be used to give a modifies list for an "
1232 "unspecified function.",
1236 FK_MODIFIES, FK_UNSPEC, modeFlag, ARG_NONE,
1239 "possible modification through a call to an unconstrained function",
1240 "An unconstrained function is called in a function body where "
1241 "modifications are checked. Since the unconstrained function "
1242 "may modify anything, there may be undetected modifications in "
1243 "the checked function.",
1247 FK_MODIFIES, FK_UNSPEC, modeFlag, ARG_NONE,
1250 "possible modification through a call to an unconstrained function in "
1251 "a function with no modifies clause",
1252 "An unconstrained function is called in a function body where "
1253 "modifications are checked. Since the unconstrained function "
1254 "may modify anything, there may be undetected modifications in "
1255 "the checked function.",
1259 FK_MODIFIES, FK_GLOBALS, modeFlag, ARG_NONE,
1260 "globsimpmodsnothing",
1261 FLG_GLOBALSIMPMODIFIESNOTHING,
1262 "functions declared with a globals list but no modifies clause are "
1263 "assumed to modify nothing",
1264 "An implicit modifies nothing clause is assumed for a function "
1265 "declared with a globals list but not modifies clause.",
1269 FK_MODIFIES, FK_GLOBALS, modeFlag, ARG_NONE,
1271 FLG_MODIFIESIMPNOGLOBALS,
1272 "functions declared with a modifies clause but no globals list "
1273 "are assumed to use no globals",
1274 "An implicit empty globals list is assumed for a function "
1275 "declared with a modifies clause but no globals list.",
1284 FK_GLOBALS, FK_NONE, modeFlag, ARG_NONE,
1287 "returns with global in inconsistent state (null or undefined)",
1288 "A global variable does not satisfy its annotations when control is transferred.",
1293 FK_GLOBALS, FK_SPEC, plainFlag, ARG_NONE,
1296 "undocumented use of a checked global variable",
1297 "A checked global variable is used in the function, but not listed in "
1298 "its globals clause. By default, only globals specified in .lcl "
1299 "files are checked. To check all globals, use +allglobals. To "
1300 "check globals selectively use /*@checked@*/ in the global "
1305 FK_GLOBALS, FK_SPEC, modeFlag, ARG_NONE,
1308 "global listed for a function not used",
1309 "A global variable listed in the function's globals list is not used
"
1310 "in the body of the function.
",
1314 FK_GLOBALS, FK_NONE, modeFlag, ARG_NONE,
1317 "use of internalState
",
1318 "A called function uses internal state
, but the globals list for the
"
1319 "function being checked does not include internalState
",
1323 FK_GLOBALS, FK_NONE, modeFlag, ARG_NONE,
1324 "internalglobsnoglobs
",
1325 FLG_INTERNALGLOBSNOGLOBS,
1326 "use of
internalState (in function with no globals list
)",
1327 "A called function uses internal state
, but the function being checked
"
1328 "has no globals list
",
1332 FK_GLOBALS, FK_MODIFIES, modeFlag, ARG_NONE,
1334 FLG_WARNMISSINGGLOBALS,
1335 "global variable used in modifies clause is not listed in globals list
",
1336 "A global variable is used in the modifies clause
, but it is not listed in
"
1337 "the globals list. The variable will be added to the globals list.
",
1342 FK_GLOBALS, FK_MODIFIES, modeFlag, ARG_NONE,
1343 "warnmissingglobsnoglobs
",
1344 FLG_WARNMISSINGGLOBALSNOGLOBS,
1345 "global variable used in modifies clause in a function with no globals list
",
1346 "A global variable is used in the modifies clause
, but the function
"
1347 "has no globals list. The variable will be added to the globals list.
",
1351 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1354 "use of checked global in a function with no globals list or specification
",
1355 "A specified global variable is used in the function
, but not listed
"
1356 "in its globals list. Without
+globnoglobs
, only globals
"
1357 "declared with
/*@checkedstrict@
*/ will produce use
"
1358 "errors in functions without globals
"
1359 "lists. The
/*@globals ... @
*/ control comment can be used to give
"
1360 "a globals list for an unspecified function.
",
1364 FK_GLOBALS, FK_IMPLICIT, modeFlag, ARG_NONE,
1367 "report use and modification errors for globals not annotated with unchecked
",
1371 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1373 FLG_CHECKSTRICTGLOBALS,
1374 "report use and modification errors for checkedstrict globals
",
1378 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1379 "impcheckedspecglobs
",
1380 FLG_IMPCHECKEDSPECGLOBALS,
1381 "assume checked qualifier for unqualified global declarations in .lcl files
",
1385 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1386 "impcheckmodspecglobs
",
1387 FLG_IMPCHECKMODSPECGLOBALS,
1388 "assume checkmod qualifier for unqualified global declarations in .lcl files
",
1392 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1393 "impcheckedstrictspecglobs
",
1394 FLG_IMPCHECKEDSTRICTSPECGLOBALS,
1395 "assume checkmod qualifier for unqualified global declarations in .lcl files
",
1399 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1401 FLG_IMPCHECKEDGLOBALS,
1402 "assume checked qualifier for unqualified global declarations
",
1406 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1408 FLG_IMPCHECKMODGLOBALS,
1409 "assume checkmod qualifier for unqualified global declarations
",
1413 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1414 "impcheckedstrictglobs
",
1415 FLG_IMPCHECKEDSTRICTGLOBALS,
1416 "assume checkedstrict qualifier for unqualified global declarations
",
1420 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1421 "impcheckedstatics
",
1422 FLG_IMPCHECKEDSTATICS,
1423 "assume checked qualifier for unqualified file static declarations
",
1427 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1428 "impcheckmodstatics
",
1429 FLG_IMPCHECKMODSTATICS,
1430 "assume checkmod qualifier for unqualified file static declarations
",
1434 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1435 "impcheckmodinternals
",
1436 FLG_IMPCHECKMODINTERNALS,
1437 "assume checkmod qualifier for unqualified local
"
1438 "static
declarations (for internal state modifications
)",
1442 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1443 "impcheckedstrictstatics
",
1444 FLG_IMPCHECKEDSTRICTSTATICS,
1445 "assume checkedstrict qualifier for unqualified file static declarations
",
1449 FK_GLOBALS, FK_MODIFIES, modeFlag, ARG_NONE,
1452 "undocumented modification of a checked global variable
",
1453 "A checked global variable is modified by the function
, but not listed in
"
1454 "its modifies clause.
",
1458 FK_GLOBALS, FK_MODIFIES, modeFlag, ARG_NONE,
1461 "undocumented modification of a checked global variable in a function
"
1462 "declared with no modifies clause
",
1463 "A checked global variable is modified by the function
, but not listed in
"
1464 "its modifies clause.
",
1468 FK_GLOBALS, FK_MODIFIES, modeFlag, ARG_NONE,
1469 "modstrictglobsnomods
",
1470 FLG_MODSTRICTGLOBSUNSPEC,
1471 "undocumented modification of a strict checked global variable in a
"
1472 "function declared with no modifies clause
",
1473 "A checked global variable is modified by the function
, but not listed in
"
1474 "its modifies clause.
",
1478 FK_GLOBALS, FK_MODIFIES, modeFlag, ARG_NONE,
1479 "modglobsunchecked
",
1480 FLG_MODGLOBSUNCHECKED,
1481 "undocumented modification of an unchecked checked global variable
",
1482 "An unchecked global variable is modified by the function
, but not listed in
"
1483 "its modifies clause.
",
1498 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1501 "path with no return detected in non
-void function
",
1502 "There is a path through a function declared to return a value on
"
1503 "which there is no return statement. This means the execution
"
1504 "may fall through without returning a meaningful result to
"
1509 FK_CONTROL, FK_NONE, plainFlag, ARG_NONE,
1512 "empty return in function declared to return value
",
1517 FK_CONTROL, FK_NONE, plainFlag, ARG_NONE,
1520 "loop predicate always exits
",
1526 FK_CONTROL, FK_MEMORY, specialFlag, ARG_NONE,
1529 "assume all loops execute at least
once (sets forloopexec
, whileloopexec and iterloopexec
)",
1533 FK_CONTROL, FK_MEMORY, plainFlag, ARG_NONE,
1536 "assume all for loops execute at least once
",
1540 FK_CONTROL, FK_MEMORY, plainFlag, ARG_NONE,
1543 "assume all while loops execute at least once
",
1547 FK_CONTROL, FK_MEMORY, plainFlag, ARG_NONE,
1550 "assume all iterator loops execute at least once
",
1554 FK_CONTROL, FK_MEMORY, plainFlag, ARG_NONE,
1556 FLG_OBVIOUSLOOPEXEC,
1557 "assume loop that can be determined to always execute always does
",
1561 /* 8.2 Undefined Behavior */
1564 FK_BEHAVIOR, FK_ANSI, modeFlag, ARG_NONE,
1567 "code has unspecified or implementation
-dependent behavior
"
1568 "because of order of evaluation
",
1569 "Code has unspecified behavior.
"
1570 "Order of evaluation of function parameters or subexpressions
"
1571 "is not defined
, so if a value is used and modified in different
"
1572 "places not separated by a sequence point constraining
"
1573 "evaluation order
, then the result of the expression is
"
1578 FK_BEHAVIOR, FK_ANSI, modeFlag, ARG_NONE,
1581 "code involving call to unspecified function has undefined or implementation
-dependent behavior
",
1582 "Code involving a call to function with no modifies or globals clause
"
1583 "may have undefined or implementation
-dependent
behavior (Splint assumes the
"
1584 "unconstrained call may modify any reachable state or use any global
). Add a
"
1585 "specification for the function.
",
1589 /* 8.3 Problematic Control Structures */
1591 /* 8.3.1 Infinite Loops */
1594 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1597 "likely infinite loop is detected
",
1598 "This appears to be an infinite loop. Nothing in the body of the
"
1599 "loop or the loop test modifies the value of the loop test.
"
1600 "Perhaps the specification of a function called in the loop
"
1601 "body is missing a modification.
",
1605 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1608 "likely infinite loop is
detected (may result from unconstrained function
)",
1609 "This appears to be an infinite loop. Nothing in the body of the
"
1610 "loop or the loop test modifies the value of the loop test.
"
1611 "There may be a modification through a call to an unconstrained
"
1612 "function
, or an unconstrained function in the loop test may use
"
1613 "a global variable modified by the loop body.
",
1617 /* 8.3.2 Switches */
1620 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1623 "non
-empty case in a switch without preceding break
",
1624 "Execution falls through from the previous
case (use
/*@fallthrough@
*/ to mark fallthrough cases
).
", 0, 0
1627 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1630 "switch on enum type missing case for some value
",
1631 "Not all values in an enumeration are present as cases in the switch.
",
1635 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1638 "first statement in switch is not a case
",
1639 "The first statement after a switch is not a case.
",
1643 FK_CONTROL, FK_NONE, plainFlag, ARG_NONE,
1646 "duplicate cases in switch
",
1647 "Duplicate cases in switch.
",
1651 /* 8.3.3 Deep Breaks */
1654 FK_CONTROL, FK_NONE, specialFlag, ARG_NONE,
1657 "break inside nested while or for or switch
",
1658 "A break statement appears inside the body of a nested while
, for or
"
1659 "switch statement. Sets looploopbreak
, loopswitchbreak
, "
1660 "switchloopbreak
, switchswitchbreak
, and looploopcontinue.
",
1664 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1667 "break inside nested while or for
",
1668 "A break statement appears inside the body of a nested while or for
"
1669 "statement. This is perfectly reasonable code
, but check that
"
1670 "the break is intended to break only the inner loop. The
"
1671 "break statement may be preceded by
/*@innerbreak@
*/ to suppress
"
1672 "the message for this break only.
",
1676 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1678 FLG_SWITCHLOOPBREAK,
1679 "break in loop inside switch
",
1680 "A break statement appears inside the body of a while or for
"
1681 "statement within a switch. This is perfectly reasonable code
, but check that
"
1682 "the break is intended to break only the inner loop. The
"
1683 "break statement may be preceded by
/*@loopbreak@
*/ to suppress
"
1684 "the message for this break only.
",
1688 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1690 FLG_LOOPSWITCHBREAK,
1691 "break in switch inside loop
",
1692 "A break statement appears inside a switch statement within a while or
"
1693 "for loop. This is perfectly reasonable code
, but check that
"
1694 "the break is intended to break only the inner loop. The
"
1695 "break statement may be preceded by
/*@switchbreak@
*/ to suppress
"
1696 "the message for this break only.
",
1700 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1701 "switchswitchbreak
",
1702 FLG_SWITCHSWITCHBREAK,
1703 "break in switch inside switch
",
1704 "A break statement appears inside a switch statement within another
"
1705 "switch statement. This is perfectly reasonable code
, but check that
"
1706 "the break is intended to break only the inner switch. The
"
1707 "break statement may be preceded by
/*@innerbreak@
*/ to suppress
"
1708 "the message for this break only.
",
1712 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1714 FLG_LOOPLOOPCONTINUE,
1715 "continue inside nested loop
",
1716 "A continue statement appears inside a loop within a loop.
"
1717 "This is perfectly reasonable code
, but check that
"
1718 "the continue is intended to continue only the inner loop. The
"
1719 "continue statement may be preceded by
/*@innercontinue@
*/ to suppress
"
1720 "the message for this continue only.
",
1724 /* 8.3.4 Loop and If Bodies */
1727 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1730 "a while statement has no body
",
1731 "While statement has no body.
",
1735 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1738 "the body of a while statement is not a block
",
1739 "While body is a single statement
, not a compound block.
",
1743 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1746 "a for statement has no body
",
1747 "For statement has no body.
",
1751 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1754 "the body of a for statement is not a block
",
1755 "Loop body is a single statement
, not a compound block.
",
1759 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1762 "an if statement has no body
",
1763 "If statement has no body.
",
1767 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1770 "the body of an if statement is not a block
",
1771 "If body is a single statement
, not a compound block.
",
1775 FK_CONTROL, FK_NONE, specialFlag, ARG_NONE,
1778 "an if
, while or for statement has no
body (sets ifempty
, "
1779 "whileempty and forempty
",
1784 FK_CONTROL, FK_NONE, specialFlag, ARG_NONE,
1787 "the body of an if
, while or for statement is not a block
"
1788 "(sets ifblock
, whileblock and forblock
)",
1789 "Body is a single statement
, not a compound block.
",
1793 /* 8.3.5 Complete Logic */
1796 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1799 "if ... else if chains must have final else
",
1800 "There is no final else following an else if construct.
",
1804 /* 8.4 Suspicious Statements */
1807 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1810 "unreachable code detected
",
1811 "This code will never be reached on any possible execution.
",
1815 /* 8.4.1 Statements with No Effects */
1818 FK_EFFECT, FK_CONTROL, modeFlag, ARG_NONE,
1821 "statement with no effect
",
1822 "Statement has no visible effect
--- no values are modified.
",
1826 FK_EFFECT, FK_CONTROL, modeFlag, ARG_NONE,
1829 "statement with no
effect (except possibly through call to
"
1830 "unconstrained function
)",
1831 "Statement has no visible effect
--- no values are modified. It may
"
1832 "modify something through a call to an unconstrained function.
",
1836 /* 8.4.2 Ignored Return Values */
1839 FK_IGNORERET, FK_NONE, specialFlag, ARG_NONE,
1842 "return value
ignored (sets retvalint
, retvalbool and retvalother
)",
1843 "Result returned by function call is not used. If this is intended
, "
1844 "cast result
to (void
) to eliminate message.
",
1848 FK_IGNORERET, FK_BOOL, modeFlag, ARG_NONE,
1851 "return value of type other than bool or int ignored
",
1852 "Result returned by function call is not used. If this is intended
, "
1853 "can cast result
to (void
) to eliminate message.
",
1857 FK_IGNORERET, FK_BOOL, modeFlag, ARG_NONE,
1860 "return value of manifest type bool ignored
",
1861 "Result returned by function call is not used. If this is intended
, "
1862 "can cast result
to (void
) to eliminate message.
",
1866 FK_IGNORERET, FK_NONE, modeFlag, ARG_NONE,
1869 "return value of type int ignored
",
1870 "Result returned by function call is not used. If this is intended
, "
1871 "can cast result
to (void
) to eliminate message.
",
1880 FK_BOUNDS, FK_MEMORY, modeFlag, ARG_NONE,
1883 "misuse of nullterminated allocation
",
1884 "A possibly non
-nullterminated string
/memory is used
/referenced as a nullterminated one.
",
1888 FK_BOUNDS, FK_MEMORY, specialFlag, ARG_NONE,
1891 "memory bounds
checking (sets boundsread and boundswrite
)",
1892 "Memory read or write may be out of bounds of allocated storage.
", 0, 0
1895 FK_BOUNDS, FK_MEMORY, specialFlag, ARG_NONE,
1898 "memory bounds
checking (sets likelyboundsread and likelyboundswrite
)",
1899 "Memory read or write may be out of bounds of allocated storage.
", 0, 0
1902 FK_BOUNDS, FK_MEMORY, modeFlag, ARG_NONE,
1904 FLG_LIKELYBOUNDSREAD,
1905 "likely out of bounds read
",
1906 "A memory read references memory beyond the allocated storage.
",
1910 FK_BOUNDS, FK_MEMORY, modeFlag, ARG_NONE,
1911 "likelyboundswrite
",
1912 FLG_LIKELYBOUNDSWRITE,
1913 "likely buffer overflow from an out of bounds write
",
1914 "A memory write may write to an address beyond the allocated buffer.
",
1919 FK_BOUNDS, FK_MEMORY, modeFlag, ARG_NONE,
1922 "possible out of bounds read
",
1923 "A memory read references memory beyond the allocated storage.
",
1927 FK_BOUNDS, FK_MEMORY, modeFlag, ARG_NONE,
1930 "possible buffer overflow from an out of bounds write
",
1931 "A memory write may write to an address beyond the allocated buffer.
",
1936 FK_BOUNDS, FK_DISPLAY, plainFlag, ARG_NONE,
1939 "display function post conditions
",
1940 "Display function post conditions.
",
1944 FK_BOUNDS, FK_DISPLAY, plainFlag, ARG_NONE,
1945 "redundantconstraints
",
1946 FLG_REDUNDANTCONSTRAINTS,
1947 "display seemingly redundant constraints
",
1948 "Display seemingly redundant constraints
",
1951 /*drl7x added 6/18/01 */
1953 FK_BOUNDS, FK_MEMORY, modeFlag, ARG_NONE,
1956 "unable to verify predicate in ensures clause
",
1957 "The function implementation may not satisfy a post condition given in an ensures clause.
",
1962 FK_BOUNDS, FK_MEMORY, plainFlag, ARG_NONE,
1963 "impboundsconstraints
",
1964 FLG_IMPBOUNDSCONSTRAINTS,
1965 "generate implicit constraints for functions
",
1969 /*drl7x added 4/29/01 */
1971 FK_BOUNDS, FK_MEMORY, plainFlag, ARG_NONE,
1974 "use limited
OR expressions to resolve constraints
",
1979 FK_BOUNDS, FK_DISPLAY, plainFlag, ARG_NONE,
1980 "showconstraintparens
",
1981 FLG_PARENCONSTRAINT,
1982 "display parentheses around constraint terms
",
1986 /*drl added 2/4/2002*/
1988 FK_BOUNDS, FK_DISPLAY, plainFlag, ARG_NONE,
1989 "boundscompacterrormessages
",
1990 FLG_BOUNDSCOMPACTERRORMESSAGES,
1991 "Display fewer new lines in bounds checking error messages
",
1996 FK_BOUNDS, FK_DISPLAY, plainFlag, ARG_NONE,
1997 "showconstraintlocation
",
1998 FLG_CONSTRAINTLOCATION,
1999 "display location for every constraint generated
",
2002 }, /*drl added flag 4/26/01*/
2004 { /* evans added 2003-06-08 */
2005 FK_BOUNDS, FK_MEMORY, modeFlag, ARG_NONE,
2008 "type conversion involves storage of non
-divisble size
",
2013 ** 10. Extensible Checking
2017 FK_EXTENSIBLE, FK_FILES, globalFlag, ARG_FILE,
2020 "load meta state declaration and corresponding xh file
",
2024 FK_EXTENSIBLE, FK_MEMORY, modeFlag, ARG_NONE,
2027 "storage has been transfered with invalid state
",
2028 "Transfer violates user
-defined state rules.
",
2032 FK_EXTENSIBLE, FK_MEMORY, modeFlag, ARG_NONE,
2035 "control paths merge with storage in incompatible states
",
2036 "Control path merge violates user
-defined state merge rules.
",
2045 FK_MACROS, FK_NONE, modeFlag, ARG_NONE,
2049 "A macro is defined in more than one place.
", 0, 0
2052 FK_MACROS, FK_UNRECOG, modeFlag, ARG_NONE,
2055 "unrecognized identifier in macro
",
2056 "An unrecognized identifier appears in a macro. If the identifier
"
2057 "is defined before the macro is used
, then this is okay.
",
2061 /* 11.1 Constant Macros */
2064 FK_MACROS, FK_PROTOS, modeFlag, ARG_NONE,
2067 "non
-parameterized macro without prototype or specification
",
2068 "Macro constant has no declaration. Use
/*@constant ...@
*/ to
"
2069 "declare the macro.
",
2074 FK_MACROS, FK_PROTOS, plainFlag, ARG_NONE,
2075 "macroconstdistance
",
2077 "macro constant name does not match nearby name
",
2078 "Macro constant name does matches name of a previous declaration
, but they are not near each other.
",
2082 /* 11.2 Function-like Macros */
2085 FK_MACROS, FK_NONE, modeFlag, ARG_NONE,
2088 "macro definition is syntactically not equivalent to function
",
2089 "A macro is defined in a way that may cause syntactic problems.
"
2090 "If the macro returns a value
, use commas to separate expressions
; "
2091 "otherwise
, use do
{ <macro body
> } while (FALSE) construct.
",
2095 FK_MACROS, FK_NONE, modeFlag, ARG_NONE,
2098 "macro definition for is empty
",
2099 "A macro definition has no body.
",
2103 FK_MACROS, FK_PARAMS, modeFlag, ARG_NONE,
2106 "macro parameter not used exactly once
",
2107 "A macro parameter is not used exactly once in all possible
"
2108 "invocations of the macro. To behave like a function
, "
2109 "each macro parameter must be used exactly once on all
"
2110 "invocations of the macro so that parameters with
"
2111 "side
-effects are evaluated exactly once. Use
/*@sef@
*/ to
"
2112 "denote parameters that must be side
-effect free.
",
2116 FK_MACROS, FK_CONTROL, modeFlag, ARG_NONE,
2119 "return statement in macro body
",
2120 "The body of a macro declared as a function uses a return statement.
"
2121 "This exhibits behavior that
"
2122 "could not be implemented by a function.
",
2126 FK_MACROS, FK_PARAMS, modeFlag, ARG_NONE,
2129 "assignment to a macro parameter
",
2130 "A macro parameter is used as the left side of an
"
2131 "assignment expression. This exhibits behavior that
"
2132 "could not be implemented by a function.
",
2136 FK_MACROS, FK_NONE, modeFlag, ARG_NONE,
2139 "macro parameter used without
parentheses (in potentially dangerous context
)",
2140 "A macro parameter is used without parentheses. This could be
"
2141 "dangerous if the macro is invoked with a complex expression
"
2142 "and precedence rules will change the evaluation inside the macro.
",
2146 FK_MACROS, FK_PROTOS, modeFlag, ARG_NONE,
2149 "macro without prototype or
specification (sets macrofcndecl and macroconstdecl
)",
2150 "Argument checking cannot be done well for macros without prototypes
"
2151 "or specifications
, since the types of the arguments are unknown.
",
2155 FK_MACROS, FK_PROTOS, modeFlag, ARG_NONE,
2158 "parameterized macro without prototype or specification
",
2159 "Function macro has no declaration.
",
2163 /* 11.2.1 Side Effect Free Parameters */
2166 FK_MACROS, FK_PARAMS, modeFlag, ARG_NONE,
2169 "a parameter with side
-effects is passed as a sef parameter
",
2170 "An actual parameter corresponding to a sef parameter may have a side
-effect.
",
2174 FK_MACROS, FK_PARAMS, modeFlag, ARG_NONE,
2177 "a parameter with unconstrained side
-effects is passed as a sef parameter
",
2178 "An actual parameter corresponding to a sef parameter involves a call
"
2179 "to a procedure with no modifies clause that may have a side
-effect.
",
2183 /* 11.3 Controlling Macro Checking */
2186 FK_MACROS, FK_NONE, plainFlag, ARG_NONE,
2189 "check all macros without parameter lists as constants
",
2190 "Every non
-parameterized
macro (not preceded by
/*@notfunction@
*/) "
2191 "is checked as a constant.
",
2195 FK_MACROS, FK_NONE, plainFlag, ARG_NONE,
2198 "check all macros with parameter lists as functions
",
2199 "Every parameterized
macro (not preceded by
/*@notfunction@
*/) "
2200 "is checked as a function.
",
2204 FK_MACROS, FK_NONE, specialFlag, ARG_NONE,
2207 "sets fcnmacros and constmacros
",
2208 "All
macros (not preceded by
/*@notfunction@
*/) are checked as functions or
"
2209 "constants depending on whether or not they have parameter lists.
",
2213 FK_MACROS, FK_NONE, plainFlag, ARG_NONE,
2216 "check all macros with declarations in library as functions
",
2217 "Every macro declared in the load library is checked.
",
2221 FK_MACROS, FK_NONE, plainFlag, ARG_NONE,
2224 "check all macros corresponding to specified functions or constants
",
2225 "Every macro declared a specification file is checked.
",
2229 FK_MACROS, FK_NONE, modeFlag, ARG_NONE,
2232 "macro definition does not match iter or constant declaration
",
2233 "A iter or constant macro is defined using a different name from the
"
2234 "one used in the previous syntactic comment
",
2238 FK_MACROS, FK_NONE, plainFlag, ARG_NONE,
2241 "the line after a constant or iter declaration must be a macro definition
",
2242 "A constant or iter declaration is not immediately followed by a macro definition.
",
2246 /* 11.4 Iterators */
2249 FK_ITER, FK_NONE, plainFlag, ARG_NONE,
2252 "iter is not balanced with end_
<iter
>",
2257 FK_ITER, FK_NONE, plainFlag, ARG_NONE,
2260 "iter yield parameter is inappropriate
",
2265 FK_ITER, FK_NONE, plainFlag, ARG_NONE,
2268 "iter declaration has no yield parameters
",
2269 "An iterator has been declared with no parameters annotated with
"
2270 "yield. This may be what you want
, if the iterator is meant
"
2271 "to do something a fixed number of times
, but returns no
"
2272 "information to the calling context. Probably
, a parameter
"
2273 "is missing the yield annotation to indicate that it is
"
2274 "assigned a value in the calling context.
",
2279 ** 12. Naming Conventions
2283 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2286 "controls name checking without changing other settings
",
2290 /* 12.1.1 Czech Names */
2293 FK_NAMES, FK_ABSTRACT, specialFlag, ARG_NONE,
2296 "czech naming
convention (sets accessczech
, czechfunctions
, czechvars
, "
2297 "czechconstants
, czechenums
, and czechmacros
)",
2298 "Name is not consistent with Czech naming convention.
", 0, 0
2301 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2304 "czech naming convention violated in a function or iterator declaration
",
2305 "Function or iterator name is not consistent with Czech naming convention.
", 0, 0
2308 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2311 "czech naming convention violated in a variable declaration
",
2312 "Variable name is not consistent with Czech naming convention.
", 0, 0
2315 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2318 "czech naming convention violated in an expanded macro name
",
2319 "Expanded macro name is not consistent with Czech naming convention.
", 0, 0
2322 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2325 "czech naming convention violated in a constant declaration
",
2326 "Constant name is not consistent with Czech naming convention.
", 0, 0
2329 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2332 "czech naming convention violated in a user
-defined type definition
",
2333 "Type name is not consistent with Czech naming convention. Czech type
"
2334 "names must not use the underscore character.
", 0, 0
2337 /* 12.1.2 Slovak Names */
2340 FK_NAMES, FK_ABSTRACT, specialFlag, ARG_NONE,
2343 "slovak naming convention violated
",
2344 "Name is not consistent with Slovak naming convention.
", 0, 0
2347 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2349 FLG_SLOVAKFUNCTIONS,
2350 "slovak naming convention violated in a function or iterator declaration
",
2351 "Function or iterator name is not consistent with Slovak naming convention.
", 0, 0
2354 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2357 "slovak naming convention violated in an expanded macro name
",
2358 "Expanded macro name is not consistent with Slovak naming convention.
", 0, 0
2361 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2364 "slovak naming convention violated in a variable declaration
",
2365 "Variable name is not consistent with Slovak naming convention.
", 0, 0
2368 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2370 FLG_SLOVAKCONSTANTS,
2371 "slovak naming convention violated in a constant declaration
",
2372 "Constant name is not consistent with Slovak naming convention.
", 0, 0
2375 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2378 "slovak naming convention violated in a use
-defined type definition
",
2379 "Type name is not consistent with Slovak naming convention. Slovak type
"
2380 "names may not include uppercase letters.
", 0, 0
2383 /* 12.1.3 Czechoslovak Names */
2385 FK_NAMES, FK_ABSTRACT, specialFlag, ARG_NONE,
2388 "czech or slovak naming convention violated
",
2389 "Name is not consistent with either Czech or Slovak naming convention.
", 0, 0
2392 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2394 FLG_CZECHOSLOVAKFUNCTIONS,
2395 "czechoslovak naming convention violated in a function or iterator declaration
",
2396 "Function name is not consistent with Czechoslovak naming convention.
", 0, 0
2399 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2400 "czechoslovakmacros
",
2401 FLG_CZECHOSLOVAKMACROS,
2402 "czechoslovak naming convention violated in an expanded macro name
",
2403 "Expanded macro name is not consistent with Czechoslovak naming convention.
", 0, 0
2406 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2408 FLG_CZECHOSLOVAKVARS,
2409 "czechoslovak naming convention violated in a variable declaration
",
2410 "Variable name is not consistent with Czechoslovak naming convention.
", 0, 0
2413 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2414 "czechoslovakconsts
",
2415 FLG_CZECHOSLOVAKCONSTANTS,
2416 "czechoslovak naming convention violated in a constant declaration
",
2417 "Constant name is not consistent with Czechoslovak naming convention.
", 0, 0
2420 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2421 "czechoslovaktypes
",
2422 FLG_CZECHOSLOVAKTYPES,
2423 "czechoslovak naming convention violated in a user
-defined type definition
",
2424 "Type name is not consistent with Czechoslovak naming convention. Czechoslovak
"
2425 "type names may not include uppercase letters or the underscore character.
", 0, 0
2428 /* 12.2 Namespace Prefixes */
2431 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2434 "set namespace prefix for variables declared in a macro body
",
2435 "A variable declared in a macro body does not start with the macrovarprefix.
",
2439 FK_NAMES, FK_PREFIX, plainFlag, ARG_NONE,
2440 "macrovarprefixexclude
",
2441 FLG_MACROVARPREFIXEXCLUDE,
2442 "the macrovarprefix may not be used for non
-macro variables
",
2443 "A variable declared outside a macro body starts with the macrovarprefix.
",
2447 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2450 "set namespace prefix for struct
, union and enum tags
",
2451 "A tag identifier does not start with the tagprefix.
",
2455 FK_NAMES, FK_PREFIX, plainFlag, ARG_NONE,
2457 FLG_TAGPREFIXEXCLUDE,
2458 "the tagprefix may not be used for non
-tag identifiers
",
2459 "An identifier that is not a tag starts with the tagprefix.
",
2463 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2466 "set namespace prefix for enum members
",
2467 "An enum member does not start with the enumprefix.
",
2471 FK_NAMES, FK_PREFIX, plainFlag, ARG_NONE,
2472 "enumprefixexclude
",
2473 FLG_ENUMPREFIXEXCLUDE,
2474 "the enumprefix may not be used for non
-enum member identifiers
",
2475 "An identifier that is not an enum member starts with the enumprefix.
",
2479 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2481 FLG_FILESTATICPREFIX,
2482 "set namespace prefix for file static declarations
",
2483 "A file
-static identifier does not start with the filestaticprefix.
",
2487 FK_NAMES, FK_PREFIX, plainFlag, ARG_NONE,
2488 "filestaticprefixexclude
",
2489 FLG_FILESTATICPREFIXEXCLUDE,
2490 "the filestaticprefix may not be used for identifiers that are not file static
",
2491 "An identifier that is not file static starts with the filestaticprefix.
",
2495 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2498 "set namespace prefix for global variables
",
2499 "A global variable does not start with the globalprefix
",
2503 FK_NAMES, FK_PREFIX, plainFlag, ARG_NONE,
2504 "globalprefixexclude
",
2505 FLG_GLOBPREFIXEXCLUDE,
2506 "the globalprefix may not be used for non
-global identifiers
",
2507 "An identifier that is not a global variable starts with the globalprefix.
",
2511 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2514 "set namespace prefix for user
-defined types
",
2515 "A user
-defined type does not start with the typeprefix
",
2519 FK_NAMES, FK_PREFIX, plainFlag, ARG_NONE,
2520 "typeprefixexclude
",
2521 FLG_TYPEPREFIXEXCLUDE,
2522 "the typeprefix may not be used for identifiers that are not type names
",
2523 "An identifier that is not a type name starts with the typeprefix.
",
2527 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2530 "set namespace prefix for external identifiers
",
2531 "An external identifier does not start with the externalprefix
",
2535 FK_NAMES, FK_PREFIX, plainFlag, ARG_NONE,
2536 "externalprefixexclude
",
2537 FLG_EXTERNALPREFIXEXCLUDE,
2538 "the externalprefix may not be used for non
-external identifiers
",
2539 "An identifier that is not external starts with the externalprefix.
",
2543 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2546 "set namespace prefix for local variables
",
2547 "A local variable does not start with the localprefix
",
2551 FK_NAMES, FK_PREFIX, plainFlag, ARG_NONE,
2552 "localprefixexclude
",
2553 FLG_LOCALPREFIXEXCLUDE,
2554 "the localprefix may not be used for non
-local identifiers
",
2555 "An identifier that is not a local variable starts with the localprefix.
",
2559 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2560 "uncheckedmacroprefix
",
2561 FLG_UNCHECKEDMACROPREFIX,
2562 "set namespace prefix for unchecked macros
",
2563 "An unchecked macro name does not start with the uncheckedmacroprefix
",
2567 FK_NAMES, FK_PREFIX, plainFlag, ARG_NONE,
2568 "uncheckedmacroprefixexclude
",
2569 FLG_UNCHECKEDMACROPREFIXEXCLUDE,
2570 "the uncheckmacroprefix may not be used for identifiers that are not
"
2572 "An identifier that is not the name of an unchecked macro
"
2573 "starts with the uncheckedmacroprefix.
",
2577 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2580 "set namespace prefix for constants
",
2581 "A constant does not start with the constantprefix
",
2585 FK_NAMES, FK_PREFIX, plainFlag, ARG_NONE,
2586 "constprefixexclude
",
2587 FLG_CONSTPREFIXEXCLUDE,
2588 "the constprefix may not be used for non
-constant identifiers
",
2589 "An identifier that is not a constant starts with the constantprefix.
",
2593 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2596 "set namespace prefix for iterators
",
2597 "An iter does not start with the iterator prefix
",
2601 FK_NAMES, FK_PREFIX, plainFlag, ARG_NONE,
2602 "iterprefixexclude
",
2603 FLG_ITERPREFIXEXCLUDE,
2604 "the iterprefix may not be used for non
-iter identifiers
",
2605 "An identifier that is not a iter starts with the iterprefix.
",
2609 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2611 FLG_DECLPARAMPREFIX,
2612 "set namespace prefix for parameters in function prototype declarations
",
2613 "A parameter name in a function prototype declaration does not start with the
"
2614 "declaration parameter prefix
",
2618 /* 12.3 Naming Restrictions */
2620 FK_NAMES, FK_ANSI, modeFlag, ARG_NONE,
2623 "external name conflicts with name reserved for system or standard library
",
2624 "External name is reserved for system use by ISO C99 standard.
",
2628 FK_NAMES, FK_ANSI, modeFlag, ARG_NONE,
2631 "external or internal name is a C
++ keyword or reserved word
",
2632 "External name is a C
++ keyword or reserved word.
"
2633 "This could lead to problems if the
"
2634 "code is compiled with a C
++ compiler.
",
2638 FK_NAMES, FK_ANSI, modeFlag, ARG_NONE,
2639 "isoreservedinternal
",
2640 FLG_ISORESERVEDLOCAL,
2641 "internal name conflicts with name reserved for system or standard library
",
2642 "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
).
",
2646 FK_NAMES, FK_ANSI, plainFlag, ARG_NONE,
2647 "distinctexternalnames
",
2648 FLG_DISTINCTEXTERNALNAMES,
2649 "external name is not distinguishable from another external name using
"
2650 "the number of significant characters
",
2651 "An external name is not distinguishable from another external name
"
2652 "using the number of significant characters. According to
"
2653 "ANSI
Standard (3.1), an implementation may only consider the first
6 "
2654 "characters significant
, and ignore alphabetical case
"
2655 "distinctions (ISO C99 requires
31). The
"
2656 "+externalnamelen
<n
> flag may be used to change the number
"
2657 "of significant characters
, and
-externalnamecaseinsensitive to make
"
2658 "alphabetical case significant in external names.
",
2662 FK_NAMES, FK_ANSI, specialFlag, ARG_NUMBER,
2664 FLG_EXTERNALNAMELEN,
2665 "set the number of significant characters in an external name
",
2666 "Sets the number of significant characters in an external
name (default is
6 for old
"
2667 "ANSI89 limit
, C99 requires
31).
"
2668 "Sets
+distinctexternalnames.
",
2672 FK_NAMES, FK_ANSI, specialFlag, ARG_NONE,
2673 "externalnamecaseinsensitive
",
2674 FLG_EXTERNALNAMECASEINSENSITIVE,
2675 "alphabetic comparisons for external names are case
-insensitive
",
2676 "Make alphabetic case insignificant in external names. By ANSI89
"
2677 "standard
, case need not be significant in an external name.
"
2678 "If
+distinctexternalnames is not set
, sets
"
2679 "+distinctexternalnames with unlimited external name length.
",
2683 FK_NAMES, FK_ANSI, plainFlag, ARG_NONE,
2684 "distinctinternalnames
",
2685 FLG_DISTINCTINTERNALNAMES,
2686 "internal name is not distinguishable from another internal name using
"
2687 "the number of significant characters
",
2688 "An internal name is not distinguishable from another internal name
"
2689 "using the number of significant characters. According to
"
2690 "ANSI89
Standard (3.1), an implementation may only consider the first
31 "
2691 "characters
significant (ISO C99 specified
63). The
"
2692 "+internalnamelen
<n
> flag changes the number
"
2693 "of significant characters
, -internalnamecaseinsensitive to makes
"
2694 "alphabetical case significant
, and
"
2695 "+internalnamelookalike to make similar
-looking characters
"
2700 FK_NAMES, FK_ANSI, specialFlag, ARG_NUMBER,
2702 FLG_INTERNALNAMELEN,
2703 "set the number of significant characters in an internal name
",
2704 "Sets the number of significant characters in an internal
name (ANSI89
"
2705 "default is
31.
) Sets
+distinctinternalnames.
",
2709 FK_NAMES, FK_ANSI, specialFlag, ARG_NONE,
2710 "internalnamecaseinsensitive
",
2711 FLG_INTERNALNAMECASEINSENSITIVE,
2712 "set whether case is significant an internal names
"
2713 "(-internalnamecaseinsensitive means case is significant
)" ,
2714 "Set whether case is significant an internal names
"
2715 "(-internalnamecaseinsensitive
"
2716 "means case is significant
). By ANSI89 default
, case is not
"
2717 "significant. If
+distinctinternalnames is not set
, sets
"
2718 "+distinctinternalnames with unlimited internal name length.
",
2722 FK_NAMES, FK_ANSI, specialFlag, ARG_NONE,
2723 "internalnamelookalike
",
2724 FLG_INTERNALNAMELOOKALIKE,
2725 "lookalike characters match in internal names
",
2726 "Set whether similar looking
characters (e.g.
, \"1\" and
\"l
\") "
2727 "match in internal names.
",
2731 FK_NAMES, FK_PREFIX, modeFlag, ARG_NONE,
2734 "a parameter in a function prototype has a name
",
2735 "A parameter in a function prototype has a name. This is dangerous
, "
2736 "since a macro definition could be visible here.
",
2740 FK_NAMES, FK_PREFIX, modeFlag, ARG_NONE,
2743 "the name of a parameter in a function prototype and corresponding
"
2744 "declaration must
match (after removing the protoparamprefix
",
2745 "A parameter in a function definition does not have the same name as
"
2746 "the corresponding in the declaration of the function after
"
2747 "removing the protoparamprefix
",
2751 FK_NAMES, FK_PREFIX, plainFlag, ARG_NONE,
2752 "protoparamprefixexclude
",
2753 FLG_DECLPARAMPREFIXEXCLUDE,
2754 "the protoparamprefix may not be used for non
-declaraction parameter identifiers
",
2755 "An identifier that is not a parameter name in a function prototype
"
2756 "starts with the protoparamprefix.
",
2764 /* 13.1 Unused Declarations */
2767 FK_USE, FK_COMPLETE, modeFlag, ARG_NONE,
2770 "declaration at top level not used
",
2771 "An external declaration not used in any source file.
", 0, 0
2774 FK_USE, FK_EXPORT, modeFlag, ARG_NONE,
2777 "a declaration is exported but not used outside this module
",
2778 "A declaration is exported
, but not used outside this module.
"
2779 "Declaration can use static qualifier.
",
2783 FK_USE, FK_EXPORT, modeFlag, ARG_NONE,
2786 "a declaration is exported but does not appear in a header file
",
2787 "A declaration is exported
, but does not appear in a header file.
",
2791 FK_USE, FK_EXPORT, modeFlag, ARG_NONE,
2793 FLG_EXPORTHEADERVAR,
2794 "a variable declaration is exported but does not appear in a header file
",
2795 "A variable declaration is exported
, but does not appear in a header
"
2796 "file.
(Used with exportheader.
)",
2800 FK_USE, FK_NONE, modeFlag, ARG_NONE,
2803 "field of structure type not used
",
2804 "A field is present in a structure type but never used. Use
/*@unused@
*/ in front of field declaration to suppress message.
",
2808 FK_USE, FK_NONE, modeFlag, ARG_NONE,
2811 "member of an enum type not used
",
2812 "A member of an enum type is never used.
",
2816 FK_USE, FK_NONE, modeFlag, ARG_NONE,
2819 "constant declared but not used
",
2820 "A constant is declared but not used. Use unused in the constant declaration to suppress message.
",
2824 FK_USE, FK_NONE, modeFlag, ARG_NONE,
2827 "function declared but not used
",
2828 "A function is declared but not used. Use
/*@unused@
*/ in front of function header to suppress message.
",
2832 FK_USE, FK_PARAMS, modeFlag, ARG_NONE,
2835 "function parameter not used
",
2836 "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.
",
2840 FK_USE, FK_TYPE, modeFlag, ARG_NONE,
2843 "type declared but not used
",
2844 "A type is declared but not used. Use
/*@unused@
*/ in front of typedef to suppress messages.
",
2848 FK_USE, FK_NONE, modeFlag, ARG_NONE,
2851 "variable declared but not used
",
2852 "A variable is declared but never used. Use
/*@unused@
*/ in front
"
2853 "of declaration to suppress message.
",
2857 FK_USE, FK_COMPLETE, modeFlag, ARG_NONE,
2860 "unused declaration in special
file (corresponding to .l or .y file
)",
2864 /* 13.2 Complete Programs */
2867 FK_COMPLETE, FK_NONE, modeFlag, ARG_NONE,
2870 "function or variable declared but never defined
",
2871 "A function or variable is declared
, but not defined in any source code file.
",
2875 FK_COMPLETE, FK_SPEC, modeFlag, ARG_NONE,
2878 "function or variable specified but never defined
",
2879 "A function or variable is declared in an .lcl file
, but not defined in any source code file.
",
2883 FK_COMPLETE, FK_SPEC, plainFlag, ARG_NONE,
2886 "function or variable specified but never declared in a source file
",
2887 "A function or variable is declared in an .lcl file
, but not declared
"
2888 "in any source code file.
",
2892 FK_DECL, FK_LIBS, plainFlag, ARG_NONE,
2895 "report new global declarations in source files
",
2896 "There is a new declaration that is not declared in a loaded library
"
2897 "or earlier file.
(Use this flag to check for consistency
"
2898 "against a library.
)",
2902 FK_INIT, FK_SPEC, plainFlag, ARG_NONE,
2905 "information in specifications is not also included in syntactic comments
",
2906 "There is information in the specification that is not duplicated
"
2907 "in syntactic comments. Normally
, this is not an
"
2908 "error
, but it may be useful to detect it to make
"
2909 "sure checking incomplete systems without the specifications will
"
2910 "still use this information.
",
2915 ** 14. Libraries and Header File Inclusion
2918 /* 14.1 Standard Libraries */
2921 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2924 "do not load standard library
",
2928 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2931 "use normal standard library
",
2932 "Library based on the ISO standard library specification is used.
",
2936 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2937 "standardstrictlib
",
2939 "interpret standard library strictly
",
2940 "Stricter version of the standard library is used.
(The default
"
2941 "library is standard.lcd
; strict library is standardstrict.lcd.
)",
2945 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2948 "use
UNIX (sort
-of
) standard library
",
2949 "UNIX version of the standard library is used.
",
2953 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2956 "use strict version of
UNIX (sort
-of
) library
",
2957 "strict version of the UNIX library is used.
",
2961 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2964 "use POSIX standard library
",
2965 "POSIX version of the standard library is used.
",
2969 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2972 "use strict POSIX standard library
",
2973 "POSIX version of the strict standard library is used.
",
2977 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2980 "show standard library filename
",
2984 FK_LIBS, FK_ANSI, plainFlag, ARG_NONE,
2987 "a POSIX header is included
, but the POSIX library is not used
",
2988 "Header name matches a POSIX header
, but the POSIX library is not selected.
",
2992 FK_LIBS, FK_ANSI, plainFlag, ARG_NONE,
2995 "warn when the unix library is used
",
2996 "Unix library may not be compatible with all platforms
",
3000 FK_LIBS, FK_ANSI, plainFlag, ARG_NONE,
3003 "non
-standard
<varargs.h
> included
",
3004 "Header
<varargs.h
> is not part of ANSI Standard.
"
3005 "Should use
<stdarg.h
> instead.
",
3009 FK_HEADERS, FK_FILES, plainFlag, ARG_NONE,
3010 "caseinsensitivefilenames
",
3011 FLG_CASEINSENSITIVEFILENAMES,
3012 "file names are case
insensitive (file.h and FILE.H are the same file
)",
3016 /* 14.2 Generating Libraries */
3019 FK_LIBS, FK_FILES, globalFlag, ARG_FILE,
3022 "save state for
merging (default suffix .lcd
)",
3026 FK_LIBS, FK_FILES, globalFlag, ARG_FILE,
3029 "load state from dump
file (default suffix .lcd
)",
3033 /* 14.3 Header File Inclusion */
3036 FK_HEADERS, FK_SPEED, globalFlag, ARG_NONE,
3039 "optimize header inclusion to eliminate redundant includes
",
3040 "When checking multiple files
, each header file is processed only
"
3041 "once. This may change the meaning of the code
, if the
"
3042 "same header file is included in different
contexts (e.g.
, the
"
3043 "header file includes #if directives and the values are
"
3044 "different when it is included in different places.
)",
3048 FK_HEADERS, FK_SPEED, globalFlag, ARG_NONE,
3051 "optimize header inclusion to not include any header files
",
3052 "Ignore header includes. Only works if relevant information is
"
3053 "loaded from a library.
",
3057 FK_HEADERS, FK_SPEED, globalFlag, ARG_NONE,
3060 "do not include header files in system
directories (set by
-sysdirs
)",
3061 "Do not include header files in system
directories (set by
-sysdirs
)",
3075 FK_SYNTAX, FK_ANSI, plainFlag, ARG_NONE,
3078 "support some
gnu (gcc
) language extensions
",
3079 "ANSI C does not allow some language features supported by gcc and other compilers.
"
3080 "Use
+gnuextensions to allow some of these extensions.
", 0, 0
3086 FK_PROTOS, FK_ANSI, modeFlag, ARG_NONE,
3089 "function declaration has no parameter list
",
3090 "A function declaration does not have a parameter list.
",
3094 FK_PROTOS, FK_ANSI, modeFlag, ARG_NONE,
3097 "old style function definition
",
3098 "Function definition is in old style syntax. Standard prototype
"
3099 "syntax is preferred.
",
3109 FK_SYSTEMFUNCTIONS, FK_TYPE, plainFlag, ARG_NONE,
3112 "type of main does not match expected type
",
3113 "The function main does not match the expected type.
",
3117 FK_SYSTEMFUNCTIONS, FK_BEHAVIOR, modeFlag, ARG_NONE,
3120 "argument to exit has implementation defined behavior
",
3121 "The argument to exit should be
0, EXIT_SUCCESS or EXIT_FAILURE
",
3126 FK_DECL, FK_NONE, modeFlag, ARG_NONE,
3129 "declaration reuses name visible in outer scope
",
3130 "An outer declaration is shadowed by the local declaration.
",
3134 FK_DECL, FK_LIBS, modeFlag, ARG_NONE,
3137 "function
, variable or constant defined in a library is redefined with inconsistent type
",
3138 "A function
, variable or constant previously defined in a library is
"
3139 "redefined with a different type.
",
3143 FK_DECL, FK_LIBS, modeFlag, ARG_NONE,
3146 "library function overloaded
",
3147 "A function
, variable or constant defined in the library is redefined
"
3148 "with a different type.
",
3152 FK_DECL, FK_NONE, modeFlag, ARG_NONE,
3155 "an extern declaration is inside a function scope
",
3156 "An extern declaration is used inside a function scope.
",
3160 FK_DECL, FK_NONE, modeFlag, ARG_NONE,
3163 "function or variable redeclared
",
3164 "A function or variable is declared in more than one place. This is
"
3165 "not necessarily a problem
, since the declarations are consistent.
",
3169 FK_DECL, FK_NONE, plainFlag, ARG_NONE,
3172 "function or variable redefined
",
3173 "A function or variable is redefined. One of the declarations should use extern.
",
3177 FK_DECL, FK_TYPE, modeFlag, ARG_NONE,
3180 "variable declaration has
unknown (implicitly int
) type
",
3181 "A variable declaration has no explicit type. The type is implicitly int.
",
3186 FK_DIRECT, FK_FILES, globalFlag, ARG_DIRECTORY,
3189 "set directory for writing temp files
",
3193 FK_DIRECT, FK_FILES, globalFlag, ARG_PATH,
3196 "set path for searching for library
files (overrides LARCH_PATH environment variable
)",
3200 FK_DIRECT, FK_FILES, globalFlag, ARG_DIRECTORY,
3203 "set directory to search for LCL import
files (overrides LCLIMPORTDIR
)",
3207 FK_DIRECT, FK_FILES, globalFlag, ARG_PATH,
3210 "set directories for system
files (default
/usr
/include
). Separate
"
3211 "directories with path
separator (colons in Unix
, semi
-colons in Windows
).
"
3212 "Flag settings propagate to files in a system directory. If
"
3213 "-sysdirerrors is set
, no errors are reported for files in
"
3214 "system directories.
",
3218 FK_DIRECT, FK_FILES, plainFlag, ARG_NONE,
3221 "prevent inclusion of header files in a system directory with
"
3222 "names that match
standard (ISO C99
) headers. The symbolic information
"
3223 "in the standard library is used instead. Flag in effect only
"
3224 "if a library including the standard library is loaded. The standard
"
3225 "headers are
: assert
, complex
, ctype
, errno
, fenv
, float
, inttypes
, "
3226 "iso646
, limits
, locale
, math
, setjmp
, signal
, stdarg
, stdbool
, "
3227 "stddef
, stdint
, stdio
, stdlib
, string
, strings
, tgmath
, time
, wchar
"
3232 FK_DIRECT, FK_FILES, plainFlag, ARG_NONE,
3234 FLG_SKIPPOSIXHEADERS,
3235 "prevent inclusion of header files in a system directory with
"
3236 "names that match standard POSIX headers. The symbolic information
"
3237 "in the posix library is used instead. The POSIX headers are
: "
3238 "dirent
, fcntl
, grp
, netdb
, netinet
/in
, pwd
, regex
, sys
/resource
, "
3239 "sys
/socket
, sys
/stat
, sys
/syslog
, sys
/times
, sys
/types
, sys
/utsname
, "
3240 "sys
/wait
, termios
, unistd and utime.
",
3244 FK_DIRECT, FK_SUPPRESS, modeFlag, ARG_NONE,
3246 FLG_SYSTEMDIRERRORS,
3247 "report errors in files in system
directories (set by
-sysdirs
)",
3251 FK_DIRECT, FK_MACROS, plainFlag, ARG_NONE,
3252 "sysdirexpandmacros
",
3253 FLG_SYSTEMDIREXPAND,
3254 "expand macros in system directories regardless of other settings
, "
3255 "except for macros corresponding to names defined in a load library
",
3260 FK_DIRECT, FK_HEADERS, globalFlag, ARG_SPECIAL,
3263 "add to C include path
",
3267 FK_DIRECT, FK_SPEC, globalFlag, ARG_SPECIAL,
3274 FK_EXPORT, FK_SPEC, specialFlag, ARG_NONE,
3277 "variable
, function or type exported but not specified
",
3278 "A variable
, function or type is exported
, but not specified.
",
3282 FK_EXPORT, FK_SPEC, modeFlag, ARG_NONE,
3285 "function exported but not specified
",
3286 "A function is exported
, but not specified.
", 0, 0
3289 FK_EXPORT, FK_SPEC, modeFlag, ARG_NONE,
3292 "expanded macro exported but not specified
",
3293 "A macro is exported
, but not specified.
", 0, 0
3296 FK_EXPORT, FK_SPEC, modeFlag, ARG_NONE,
3299 "type definition exported but not specified
",
3300 "A type is exported
, but not specified.
", 0, 0
3303 FK_EXPORT, FK_SPEC, modeFlag, ARG_NONE,
3306 "variable exported but not specified
",
3307 "A variable is exported
, but not specified.
", 0, 0
3310 FK_EXPORT, FK_SPEC, modeFlag, ARG_NONE,
3313 "constant exported but not specified
",
3314 "A constant is exported
, but not specified.
", 0, 0
3317 FK_EXPORT, FK_SPEC, modeFlag, ARG_NONE,
3320 "constant exported but not specified
",
3321 "A constant is exported
, but not specified.
", 0, 0
3325 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NUMBER,
3328 "set length of
messages (number of chars
)",
3332 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NUMBER,
3335 "set number of spaces to indent sub
-messages
",
3339 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NUMBER,
3341 FLG_LOCINDENTSPACES,
3342 "set number of spaces to indent sub
-messages that start with file locations
",
3346 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NONE,
3348 FLG_SHOWDEEPHISTORY,
3349 "show all available information about storage mentioned in warnings
",
3353 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NONE,
3356 "show column number where error is found
",
3360 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NONE,
3363 "show location information for load files
",
3367 FK_FORMAT, FK_DISPLAY, idemGlobalFlag, ARG_FILE,
3370 "produce comma
-separated
values (CSV
) warnings output file
",
3374 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NONE,
3377 "overwrite exisiting CVS output file
",
3381 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NONE,
3383 FLG_PARENFILEFORMAT,
3384 "show column number where error is found
",
3388 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NONE,
3391 "show file locations as links
",
3395 FK_FORMAT, FK_NONE, plainFlag, ARG_NONE,
3398 "show name of function containing error
",
3402 FK_FORMAT, FK_NONE, plainFlag, ARG_NONE,
3405 "show all possible types
",
3406 "When a library function is declared with multiple possible type
, the
"
3407 "alternate types are shown only if
+showallconjs.
",
3411 FK_LIBS, FK_NONE, plainFlag, ARG_NONE,
3414 "make all alternate types
implicit (useful for making system libraries
",
3418 FK_GLOBAL, FK_ERRORS, globalFlag, ARG_NUMBER,
3421 "expect
<int
> code errors
",
3425 FK_GLOBAL, FK_ERRORS, globalFlag, ARG_NUMBER,
3428 "expect
<int
> spec errors
",
3432 FK_GLOBAL, FK_USE, idemSpecialFlag, ARG_NONE,
3435 "check as partial
system (-specundef
, -declundef
, -exportlocal
, "
3436 "don
't check macros in headers without corresponding .c files)",
3441 ** Appendix D. Specifications
3445 FK_HEADERS, FK_SPEC, globalFlag, ARG_NONE,
3448 "generate .lh files", NULL,
3452 FK_HEADERS, FK_SPEC, globalFlag, ARG_NONE,
3455 "generate .lcs files", NULL,
3464 FK_HELP, FK_NONE, plainFlag, ARG_NONE,
3467 "warn when command line sets flag in abnormal way",
3468 "Command line sets flag in abnormal way",
3472 FK_HELP, FK_NONE, plainFlag, ARG_NONE,
3475 "warn when there are problems with reading the initialization files",
3476 "There was a problem reading an initialization file",
3480 FK_HELP, FK_NONE, plainFlag, ARG_NONE,
3483 "warn about bad command line flags",
3484 "A flag is not recognized or used in an incorrect way",
3488 FK_HELP, FK_NONE, plainFlag, ARG_NONE,
3491 "warn when command line file does not have a recognized extension",
3495 FK_HELP, FK_NONE, globalFlag, ARG_SPECIAL,
3498 "-help <flags> will describe flags",
3503 FK_INIT, FK_FILES, idemGlobalFlag, ARG_FILE,
3506 "read an options file (default ~/.splintrc not loaded)",
3507 "Read an options file (instead of loading default ~/.splintc)",
3511 FK_INIT, FK_FILES, idemGlobalFlag, ARG_FILE,
3514 "set LCL initilization file",
3518 FK_INIT, FK_FILES, globalFlag, ARG_NONE,
3521 "do not read options file",
3522 "Do not read the default options file (~/.splintrc)",
3526 FK_INIT, FK_COMMENTS, plainFlag, ARG_CHAR,
3529 "set marker character for syntactic comments (default is '@
')",
3530 "Set the marker character for syntactic comments. Comments beginning "
3531 "with /*<char> are interpreted by Splint, where <char> is the "
3532 "comment marker character.",
3541 FK_LIMITS, FK_ANSI, modeFlag, ARG_NUMBER,
3543 FLG_CONTROLNESTDEPTH,
3544 "set maximum nesting depth of compound statements, iteration control "
3545 "structures, and selection control structures (ANSI89 minimum is 15; ISO99 is 63)",
3546 "Maximum number of control levels exceeded.",
3550 FK_LIMITS, FK_ANSI, modeFlag, ARG_NUMBER,
3552 FLG_STRINGLITERALLEN,
3553 "set maximum length of string literals (ANSI89 minimum is 509; ISO99 is 4095)",
3554 "Maximum length of string literal exceeded.",
3558 FK_LIMITS, FK_ANSI, modeFlag, ARG_NUMBER,
3560 FLG_NUMSTRUCTFIELDS,
3561 "set maximum number of fields in a struct or union (ANSI89 minimum is 127; ISO99 is 1023)",
3562 "Maximum number of fields in a struct or union exceeded.",
3566 FK_LIMITS, FK_ANSI, modeFlag, ARG_NUMBER,
3569 "set maximum number of members of an enum (ANSI89 minimum is 127; ISO99 is 1023)",
3570 "Limit on maximum number of members of an enum is exceeded.",
3574 FK_LIMITS, FK_ANSI, modeFlag, ARG_NUMBER,
3577 "set maximum number of nested #include files (ANSI89 minimum is 8; ISO99 is 63)",
3578 "Maximum number of nested #include files exceeded.",
3582 FK_LIMITS, FK_ANSI, specialFlag, ARG_NONE,
3585 "check for violations of standard limits (controlnestdepth, "
3586 "stringliterallen, includenest, numstructfields, numenummembers) based on ANSI89 standard",
3591 FK_LIMITS, FK_ANSI, specialFlag, ARG_NONE,
3594 "check for violations of standard limits (controlnestdepth, "
3595 "stringliterallen, includenest, numstructfields, numenummembers) based on ISO99 standard",
3601 FK_PREPROC, FK_NONE, globalFlag, ARG_SPECIAL,
3604 "passed to pre-processor",
3608 FK_PREPROC, FK_NONE, globalFlag, ARG_SPECIAL,
3611 "passed to pre-processor",
3615 FK_PREPROC, FK_SYNTAX, plainFlag, ARG_NONE,
3617 FLG_UNRECOGDIRECTIVE,
3618 "unrecognized pre-processor directive",
3619 "Pre-processor directive is not recognized.",
3623 FK_SUPPRESS, FK_COMMENTS, globalFlag, ARG_NONE,
3626 "The number of errors detected does not match number in /*@i<n>@*/.",
3630 FK_SUPPRESS, FK_ERRORS, plainFlag, ARG_NUMBER,
3633 "limit <int> consecutive repeated errors",
3637 FK_SYNTAX, FK_NONE, plainFlag, ARG_NONE,
3640 "syntax error in parsing",
3641 "Code cannot be parsed. For help on parse errors, see splint -help parseerrors.",
3645 FK_SYNTAX, FK_NONE, plainFlag, ARG_NONE,
3648 "try to recover from parse error",
3649 "Try to recover from parse error. It really means try - this doesn't usually work.
", 0, 0
3652 FK_SYNTAX, FK_PREPROC, plainFlag, ARG_NONE,
3655 "preprocessing error
",
3656 "Preprocessing error.
",
3661 FK_TYPE, FK_NONE, plainFlag, ARG_NONE,
3665 "Types are incompatible.
",
3670 FK_TYPE, FK_NONE, plainFlag, ARG_NONE,
3671 "stringliteraltoolong
",
3672 FLG_STRINGLITTOOLONG,
3673 "string literal too long for character array
",
3674 "A string literal is assigned to a char array too small to hold it.
",
3678 FK_TYPE, FK_NONE, modeFlag, ARG_NONE,
3679 "stringliteralnoroomfinalnull
",
3680 FLG_STRINGLITNOROOMFINALNULL,
3681 "string literal leaves no room for null terminator
",
3682 "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
",
3686 FK_TYPE, FK_NONE, modeFlag, ARG_NONE,
3687 "stringliteralnoroom
",
3688 FLG_STRINGLITNOROOM,
3689 "string literal leaves no room for null terminator
",
3690 "A string literal is assigned to a char array that is not big enough to hold the null terminator.
",
3694 FK_TYPE, FK_NONE, modeFlag, ARG_NONE,
3695 "stringliteralsmaller
",
3696 FLG_STRINGLITSMALLER,
3697 "string literal is smaller than the char array it is assigned to
",
3698 "A string literal is assigned to a char array that smaller than the string literal needs.
",
3702 FK_TYPE, FK_NONE, modeFlag, ARG_NONE,
3705 "enum members must be int values
",
3706 "Type of initial values for enum members must be int.
",
3711 FK_TYPE, FK_NONE, plainFlag, ARG_NONE,
3714 "type
-mismatch in parameter corresponding to format code in a printf or scanf
-like function
",
3715 "Type of parameter is not consistent with corresponding code in format string.
",
3719 FK_TYPE, FK_NONE, modeFlag, ARG_NONE,
3722 "format parameter is not a string
constant (hence variable arguments cannot be typechecked
)",
3723 "Format parameter is not known at compile
-time. This can lead to security vulnerabilities because the arguments cannot be type checked.
",
3727 FK_TYPE, FK_NONE, plainFlag, ARG_NONE,
3730 "invalid format code in format string for printf or scanf
-like function
",
3731 "Format code in a format string is not valid.
",
3735 FK_TYPEEQ, FK_ABSTRACT, modeFlag, ARG_NONE,
3738 "forward declarations of pointers to abstract representation match abstract type
",
3742 FK_TYPEEQ, FK_ABSTRACT, modeFlag, ARG_NONE,
3745 "void
* matches pointers to abstract types
, casting
ok (dangerous
)",
3746 "A pointer to void is cast to a pointer to an abstract
type (or vice versa
).
",
3750 FK_TYPEEQ, FK_POINTER, plainFlag, ARG_NONE,
3753 "a pointer to a function is cast to a pointer to
void (or vice versa
)",
3754 "A pointer to a function is cast
to (or used as
) a pointer to
void (or vice versa
).
",
3758 FK_TYPEEQ, FK_ARRAY, modeFlag, ARG_NONE,
3761 "char can be used to index arrays
",
3762 "To allow char types to index arrays
, use
+charindex.
", 0, 0
3765 FK_TYPEEQ, FK_ARRAY, modeFlag, ARG_NONE,
3768 "enum can be used to index arrays
",
3769 "To allow enum types to index arrays
, use
+enumindex.
", 0, 0
3772 FK_TYPEEQ, FK_BOOL, modeFlag, ARG_NONE,
3775 "bool and int are equivalent
",
3776 "To make bool and int types equivalent
, use
+boolint.
",
3780 FK_TYPEEQ, FK_NONE, modeFlag, ARG_NONE,
3783 "char and int are equivalent
",
3784 "To make char and int types equivalent
, use
+charint.
",
3788 FK_TYPEEQ, FK_NONE, modeFlag, ARG_NONE,
3791 "enum and int are equivalent
",
3792 "To make enum and int types equivalent
, use
+enumint.
",
3796 FK_TYPEEQ, FK_NONE, modeFlag, ARG_NONE,
3799 "long int and int are equivalent
",
3800 "To make long int and int types equivalent
, use
+longint.
",
3804 FK_TYPEEQ, FK_NONE, modeFlag, ARG_NONE,
3807 "short int and int are equivalent
",
3808 "To make short int and int types equivalent
, use
+shortint.
",
3812 FK_TYPEEQ, FK_NONE, modeFlag, ARG_NONE,
3815 "float and double are equivalent
",
3816 "To make float and double types equivalent
, use
+floatdouble.
",
3820 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3823 "ignore type
qualifiers (long
, short
, unsigned
)",
3824 "To ignore type qualifiers in type comparisons use
+ignorequals.
",
3828 FK_TYPEEQ, FK_SYNTAX, plainFlag, ARG_NONE,
3831 "report duplicate type
qualifiers (e.g.
, unsigned unsigned
)",
3832 "Duplicate type qualifiers not supported by ISO standard.
",
3836 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3839 "ignore signs in type
comparisons (unsigned matches signed
)",
3840 "To ignore signs in type comparisons use
+ignoresigns
",
3844 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3847 "int literals can be reals
",
3848 "An int literal is used as any numeric
type (including float and long long
). Use
+numliteral to
"
3849 "allow int literals to be used as any numeric type.
",
3853 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3856 "character
constants (e.g.
, 'a') can be used as ints
",
3857 "A character constant is used as an int. Use
+charintliteral to
"
3858 "allow character constants to be used as ints.
(This is safe
"
3859 "since the actual type of a char constant is int.
)",
3863 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3866 "report qualifier mismatches only if dangerous
",
3867 "To allow qualifier mismatches that are not dangerous
, use
+relaxquals.
", 0, 0
3870 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3873 "allow all numeric types to match
",
3874 "To allow all numeric types to match
, use
+relaxtypes.
", 0, 0
3877 FK_TYPEEQ, FK_NONE, modeFlag, ARG_NONE,
3879 FLG_CHARUNSIGNEDCHAR,
3880 "allow char and unsigned char types to match
",
3881 "To allow char and unsigned char types to match use
+charunsignedchar.
",
3885 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3887 FLG_MATCHANYINTEGRAL,
3888 "allow any intergral type to match an arbitrary integral
type (e.g.
, dev_t
)",
3889 "To allow arbitrary integral types to match any integral type
, use
+matchanyintegral.
",
3893 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3894 "longunsignedintegral
",
3895 FLG_LONGUNSIGNEDINTEGRAL,
3896 "allow long unsigned type to match an arbitrary integral
type (e.g.
, dev_t
)",
3897 "To allow arbitrary integral types to match long unsigned
, use
+longunsignedintegral.
",
3901 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3904 "allow long type to match an arbitrary integral
type (e.g.
, dev_t
)",
3905 "To allow arbitrary integral types to match long unsigned
, use
+longintegral.
",
3909 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3910 "longunsignedunsignedintegral
",
3911 FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL,
3912 "allow long unsigned type to match an arbitrary unsigned integral
type (e.g.
, size_t
)",
3913 "To allow arbitrary unsigned integral types to match long unsigned
, "
3914 "use
+longunsignedunsignedintegral.
",
3918 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3919 "longsignedintegral
",
3920 FLG_LONGSIGNEDINTEGRAL,
3921 "allow long type to match an arbitrary signed integral
type (e.g.
, ssize_t
)",
3922 "To allow arbitrary signed integral types to match long unsigned
, use
+longsignedintegral.
",
3926 FK_TYPEEQ, FK_POINTER, plainFlag, ARG_NONE,
3929 "treat
0 as a pointer
",
3933 FK_TYPEEQ, FK_BOOL, modeFlag, ARG_NONE,
3936 "treat
0 as a boolean
",
3940 FK_UNRECOG, FK_DISPLAY, plainFlag, ARG_NONE,
3943 "do not suppress repeated unrecognized identifier
messages (instead of only reporting the first error
)",
3944 "Identifier used in code has not been declared.
(Message repeated for future uses in this file.
)",
3948 FK_UNRECOG, FK_DISPLAY, plainFlag, ARG_NONE,
3951 "report unrecognized identifiers with
system (__
) prefix
",
3952 "Identifier used in code has not been declared.
(Message repeated for
"
3953 "future uses in this file.
) Use
+gnuextensions to make Splint
"
3954 "recognize some keywords that are gnu extensions.
",
3958 FK_UNRECOG, FK_NONE, plainFlag, ARG_NONE,
3961 "unrecognized identifier
",
3962 "Identifier used in code has not been declared.
", 0, 0
3967 FK_DECL, FK_TYPE, plainFlag, ARG_NONE,
3969 FLG_ANNOTATIONERROR,
3970 "annotation is used in inconsistent location
",
3971 "A declaration uses an invalid annotation.
",
3975 FK_DECL, FK_TYPE, plainFlag, ARG_NONE,
3978 "inconsistent syntactic comment
",
3979 "A syntactic comment is used inconsistently.
",
3988 FK_WARNUSE, FK_NONE, plainFlag, ARG_NONE,
3991 "warn when declaration marked with warn is used
",
3992 "Declaration marked with warn clause is
used (can be suppresed by more specific flags
).
",
3996 FK_WARNUSE, FK_SECURITY, modeFlag, ARG_NONE,
3999 "possible buffer overflow vulnerability
",
4000 "Use of function that may lead to buffer overflow.
",
4004 FK_WARNUSE, FK_SECURITY, modeFlag, ARG_NONE,
4005 "bufferoverflowhigh
",
4006 FLG_BUFFEROVERFLOWHIGH,
4007 "likely buffer overflow vulnerability
",
4008 "Use of function that may lead to buffer overflow.
",
4012 FK_WARNUSE, FK_SECURITY, modeFlag, ARG_NONE,
4013 "implementationoptional
",
4014 FLG_IMPLEMENTATIONOPTIONAL,
4015 "declarator is implementation
optional (ISO99 does not require an implementation to provide it
)",
4016 "Use of a declarator that is implementation optional
, not required by ISO99.
",
4020 FK_WARNUSE, FK_NONE, modeFlag, ARG_NONE,
4023 "legacy declaration in Unix Standard
",
4024 "Use of a declarator that is marked as a legacy entry in the Unix Standard.
",
4028 FK_WARNUSE, FK_SECURITY, modeFlag, ARG_NONE,
4031 "function is not reentrant
",
4032 "Non
-reentrant function should not be used in multithreaded code.
",
4036 FK_WARNUSE, FK_SECURITY, modeFlag, ARG_NONE,
4039 "function may have undefined behavior
",
4040 "Use of function that may have implementation
-dependent behavior.
",
4044 FK_WARNUSE, FK_SECURITY, modeFlag, ARG_NONE,
4047 "function is restricted to superusers
",
4048 "Call to function restricted to superusers.
",
4052 FK_WARNUSE, FK_SECURITY, modeFlag, ARG_NONE,
4055 "possible time of check
, time of use vulnerability
",
4056 "Possible time of check
, time of use vulnerability.
",
4060 FK_WARNUSE, FK_SECURITY, modeFlag, ARG_NONE,
4063 "function is not required in Standard UNIX Specification
",
4064 "Use of function that need not be provided by UNIX implementations
",
4069 ** ITS4 Compability Flags
4071 ** These flags flags must appear in order (most severe -> weakest).
4075 FK_ITS4, FK_SECURITY, specialFlag, ARG_NONE,
4078 "most risky security
vulnerabilities (from its4 database
)",
4079 "Security vulnerability classified as most risky in its4 database.
",
4083 FK_ITS4, FK_SECURITY, specialFlag, ARG_NONE,
4086 "very risky security
vulnerabilities (from its4 database
)",
4087 "Security vulnerability classified as very risky in its4 database.
",
4091 FK_ITS4, FK_SECURITY, specialFlag, ARG_NONE,
4094 "risky security
vulnerabilities (from its4 database
)",
4095 "Security vulnerability classified as risky in its4 database.
",
4099 FK_ITS4, FK_SECURITY, specialFlag, ARG_NONE,
4101 FLG_ITS4MODERATERISK,
4102 "moderately risky security
vulnerabilities (from its4 database
)",
4103 "Security vulnerability classified as moderate risk in its4 database.
",
4107 FK_ITS4, FK_SECURITY, specialFlag, ARG_NONE,
4110 "risky security
vulnerabilities (from its4 database
)",
4111 "Security vulnerability classified as risky in its4 database.
",
4116 ** Syntactic comments
4120 FK_SYNCOMMENTS, FK_SUPPRESS, plainFlag, ARG_NONE,
4123 "ignore all stylized comments
",
4127 FK_SYNCOMMENTS, FK_ABSTRACT, plainFlag, ARG_NONE,
4130 "ignore access comments
",
4135 FK_SYNCOMMENTS, FK_SYNTAX, plainFlag, ARG_NONE,
4137 FLG_UNRECOGCOMMENTS,
4138 "stylized comment is unrecognized
",
4139 "Word after a stylized comment marker does not correspond to a
"
4140 "stylized comment.
",
4144 FK_SYNCOMMENTS, FK_SYNTAX, plainFlag, ARG_NONE,
4145 "unrecogflagcomments
",
4146 FLG_UNRECOGFLAGCOMMENTS,
4147 "stylized flag comment uses an unrecognized flag
",
4148 "Semantic comment attempts to set a flag that is not recognized.
",
4152 FK_SYNCOMMENTS, FK_SUPPRESS, modeFlag, ARG_NONE,
4155 "interpret t
comments (ignore errors in lines marked with
/*@t
<n
>@
*/",
4159 FK_SYNCOMMENTS, FK_SUPPRESS, plainFlag, ARG_NONE,
4162 "interpret traditional lint
comments (/*FALLTHROUGH
*/, /*NOTREACHED
*/)",
4166 FK_SYNCOMMENTS, FK_SUPPRESS, modeFlag, ARG_NONE,
4168 FLG_WARNLINTCOMMENTS,
4169 "warn when a traditional lint comment is used
",
4170 "A traditional lint comment is used. Some traditional lint comments
"
4171 "are interpreted by Splint to enable easier checking of legacy
"
4172 "code. It is preferable to replace these comments with the
"
4173 "suggested Splint alternative.
",
4182 FK_COMMENTS, FK_SYNTAX, plainFlag, ARG_NONE,
4184 FLG_CONTINUECOMMENT,
4185 "line continuation
marker (\\) in comment before
*/ on same line
",
4186 "A line continuation
marker (\\) appears inside a comment on the same
"
4187 "line as the comment close. Preprocessors should handle this
"
4188 "correctly
, but it causes problems for some preprocessors.
",
4192 FK_COMMENTS, FK_SYNTAX, plainFlag, ARG_NONE,
4193 "slashslashcomment
",
4194 FLG_SLASHSLASHCOMMENT,
4195 "use of
// comment
",
4196 "A
// comment is used. ISO C99 allows
// comments
, but earlier standards did not.
",
4200 FK_COMMENTS, FK_SYNTAX, plainFlag, ARG_NONE,
4203 "comment begins inside comment
",
4204 "A comment open
sequence (/*) appears within a comment. This usually
"
4205 "means an earlier comment was not closed.
",
4210 ** Flags for controlling warning message printing.
4216 FK_DISPLAY, FK_ERRORS, plainFlag, ARG_NONE,
4219 "suppress herald and error count
",
4224 ** Default is to send messages, warnings and errors to stderr
4228 FK_DISPLAY, FK_ERRORS, idemGlobalFlag, ARG_NONE,
4229 "messagestreamstdout
",
4230 FLG_MESSAGESTREAMSTDOUT,
4231 "send status messages to standard output stream
",
4235 FK_DISPLAY, FK_ERRORS, idemGlobalFlag, ARG_NONE,
4236 "messagestreamstderr
",
4237 FLG_MESSAGESTREAMSTDERR,
4238 "send status messages to standard error stream
",
4242 FK_DISPLAY, FK_ERRORS, globalFlag, ARG_FILE,
4245 "send status messages to
<file
>",
4250 FK_DISPLAY, FK_ERRORS, idemGlobalFlag, ARG_NONE,
4251 "warningstreamstdout
",
4252 FLG_WARNINGSTREAMSTDOUT,
4253 "send warnings to standard output stream
",
4257 FK_DISPLAY, FK_ERRORS, idemGlobalFlag, ARG_NONE,
4258 "warningstreamstderr
",
4259 FLG_WARNINGSTREAMSTDERR,
4260 "send warnings to standard error stream
",
4264 FK_DISPLAY, FK_ERRORS, globalFlag, ARG_FILE,
4267 "send warnings to
<file
>",
4272 FK_DISPLAY, FK_ERRORS, idemGlobalFlag, ARG_NONE,
4273 "errorstreamstdout
",
4274 FLG_ERRORSTREAMSTDOUT,
4275 "send fatal errors to standard output stream
",
4279 FK_DISPLAY, FK_ERRORS, idemGlobalFlag, ARG_NONE,
4280 "errorstreamstderr
",
4281 FLG_ERRORSTREAMSTDERR,
4282 "send fatal errors to standard error stream
",
4286 FK_DISPLAY, FK_ERRORS, globalFlag, ARG_FILE,
4289 "send fatal errors to
<file
>",
4294 FK_DISPLAY, FK_ERRORS, globalFlag, ARG_NONE,
4296 FLG_STREAMOVERWRITE,
4297 "warn and exit if a stream output file would overwrite an existing file
",
4303 FK_DISPLAY, FK_ERRORS, plainFlag, ARG_NONE,
4306 "show summary of all errors reported and suppressed
",
4310 FK_DISPLAY, FK_FILES, plainFlag, ARG_NONE,
4313 "show file names are they are processed
",
4317 FK_DISPLAY, FK_FILES, plainFlag, ARG_NONE,
4320 "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.
",
4324 FK_DISPLAY, FK_NONE, globalFlag, ARG_NONE,
4327 "display lines processed and time
",
4331 FK_DISPLAY, FK_NONE, globalFlag, ARG_NONE,
4334 "display time distribution
",
4338 FK_DISPLAY, FK_USE, globalFlag, ARG_NONE,
4341 "show sorted list of uses of all globals
",
4348 FK_HINTS, FK_FORMAT, plainFlag, ARG_NONE,
4351 "provide a hint the first time a particular warning appears
",
4352 "Provide a hint the first time a particular warning appears
",
4356 FK_HINTS, FK_FORMAT, plainFlag, ARG_NONE,
4359 "provide a hint for every warnings
",
4360 "Provide a hint for every warning
",
4365 ** Flags for debugging
4369 FK_DEBUG, FK_NONE, plainFlag, ARG_NUMBER,
4372 "set maximum number of bugs detected before giving up
",
4376 FK_DEBUG, FK_BOUNDS, plainFlag, ARG_NONE,
4377 "debugfcnconstraint
",
4378 FLG_DEBUGFUNCTIONCONSTRAINT,
4379 "debug function constraints
",
4380 "Perform buffer overflow checking even if the errors would be surpressed.
",
4384 FK_DEBUG, FK_NONE, idemSpecialFlag, ARG_NONE,
4387 "debug parsing
", NULL,
4391 FK_DEBUG, FK_NONE, idemFlag, ARG_NONE,
4394 "do not delete temporary files
", NULL,
4398 FK_DEBUG, FK_NONE, idemFlag, ARG_NONE,
4401 "do not pre
-process input files
", NULL,
4405 FK_DEBUG, FK_NONE, idemFlag, ARG_NONE,
4408 "display the source code location where a warning is produced
", NULL,