Some consistency changes to library & headers flags.
[splint-patched.git] / src / flags.def
blobc03fe7548420a176a6a9a0bdebb9822ca5e91975
1 /* ;-*-C-*-;
2 ** vim: set syntax=c filetype=c shiftwidth=2 softtabstop=2 expandtab:
3 **
4 ** flags.def
5 **
6 ** This file is used to generate the flag header files.
7 **
8 */
9 /* spec idem global mode */
10 /*@-namechecks@*/
11 /*@notfunction@*/
12 # define plainFlag FALSE, FALSE, FALSE, FALSE
13 /*@notfunction@*/
14 # define specialFlag TRUE, FALSE, FALSE, FALSE
15 /*@notfunction@*/
16 # define idemFlag FALSE, TRUE, FALSE, FALSE
17 /*@notfunction@*/
18 # define globalFlag FALSE, FALSE, TRUE, FALSE
19 /*@notfunction@*/
20 # define modeFlag FALSE, FALSE, FALSE, TRUE
21 /*@notfunction@*/
22 # define idemSpecialFlag TRUE, TRUE, FALSE, FALSE
23 /*@notfunction@*/
24 # define idemGlobalFlag FALSE, TRUE, TRUE, FALSE
25 /*@=namechecks@*/
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
30 ** the lines.
33 static flaglist flags =
36 ** Null Dereferences (Manual Section 2)
40 FK_NULL, FK_MEMORY, specialFlag, ARG_NONE,
41 "null",
42 FLG_NULL,
43 "misuses of null pointer",
44 "A possibly null pointer is misused (sets nullderef, nullpass, "
45 "nullref, nullassign, and nullstate).",
46 0, 0
49 FK_NULL, FK_MEMORY, modeFlag, ARG_NONE,
50 "nullderef",
51 FLG_NULLDEREF,
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 "
57 "null qualifier.",
58 0, 0
61 FK_NULL, FK_MEMORY, modeFlag, ARG_NONE,
62 "nullpass",
63 FLG_NULLPASS,
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.",
69 0, 0
72 FK_NULL, FK_MEMORY, modeFlag, ARG_NONE,
73 "nullret",
74 FLG_NULLRET,
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 "
79 "value declaration.",
80 0, 0
83 FK_NULL, FK_MEMORY, modeFlag, ARG_NONE,
84 "nullstate",
85 FLG_NULLSTATE,
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.",
89 0, 0
92 FK_NULL, FK_MEMORY, modeFlag, ARG_NONE,
93 "nullassign",
94 FLG_NULLASSIGN,
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.",
99 0, 0
102 FK_NULL, FK_MEMORY, plainFlag, ARG_NONE,
103 "nullinit",
104 FLG_NULLINIT,
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.",
109 0, 0
113 ** Undefined Values (Section 3)
117 FK_DEF, FK_NONE, modeFlag, ARG_NONE,
118 "usedef",
119 FLG_USEDEF,
120 "use before definition",
121 "An rvalue is used that may not be initialized to a value on some execution path.",
122 0, 0
125 FK_MEMORY, FK_DEF, modeFlag, ARG_NONE,
126 "mustdefine",
127 FLG_MUSTDEFINE,
128 "out storage not defined before return or scope exit",
129 "An out parameter or global is not defined before control is transferred.",
130 0, 0
133 FK_MEMORY, FK_DEF, modeFlag, ARG_NONE,
134 "uniondef",
135 FLG_UNIONDEF,
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.",
139 0, 0
142 FK_MEMORY, FK_DEF, modeFlag, ARG_NONE,
143 "compdef",
144 FLG_COMPDEF,
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.",
149 0, 0
152 FK_DEF, FK_NONE, plainFlag, ARG_NONE,
153 "fullinitblock",
154 FLG_FULLINITBLOCK,
155 "initializer sets all fields",
156 "Initializer does not set every field in the structure.",
157 0, 0
160 FK_DEF, FK_NONE, plainFlag, ARG_NONE,
161 "initallelements",
162 FLG_INITALLELEMENTS,
163 "initializer defines all array elements",
164 "Initializer does not define all elements of a declared array.",
165 0, 0
168 FK_DEF, FK_NONE, plainFlag, ARG_NONE,
169 "initsize",
170 FLG_INITSIZE,
171 "initializer defines extra array elements",
172 "Initializer block contains more elements than the size of a declared array.",
173 0, 0
177 FK_DEF, FK_IMPLICIT, modeFlag, ARG_NONE,
178 "impouts",
179 FLG_IMPOUTS,
180 "pointer parameters to unspecified functions may be implicit out parameters",
181 NULL, 0, 0
185 ** Types (Section 4)
189 FK_DECL, FK_TYPE, modeFlag, ARG_NONE,
190 "incondefs",
191 FLG_INCONDEFS,
192 "function, variable or constant redefined with inconsistent type",
193 "A function, variable or constant is redefined with a different type.",
194 0, 0
197 FK_DECL, FK_TYPE, modeFlag, ARG_NONE,
198 "matchfields",
199 FLG_MATCHFIELDS,
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.",
202 0, 0
205 FK_TYPE, FK_NONE, modeFlag, ARG_NONE,
206 "fcnderef",
207 FLG_FCNDEREF,
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.",
212 0, 0
215 FK_OPS, FK_NONE, modeFlag, ARG_NONE,
216 "realcompare",
217 FLG_REALCOMPARE,
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.",
225 0, 0,
228 FK_OPS, FK_NONE, modeFlag, ARG_NONE,
229 "realrelatecompare",
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.",
238 0, 0,
241 FK_OPS, FK_NONE, modeFlag, ARG_NONE,
242 "unsignedcompare",
243 FLG_UNSIGNEDCOMPARE,
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.",
246 0, 0,
249 FK_OPS, FK_POINTER, modeFlag, ARG_NONE,
250 "ptrarith",
251 FLG_POINTERARITH,
252 "arithmetic involving pointer and integer",
253 "Pointer arithmetic using pointer and integer.", 0, 0
256 FK_OPS, FK_POINTER, modeFlag, ARG_NONE,
257 "nullptrarith",
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,
264 "ptrcompare",
265 FLG_PTRNUMCOMPARE,
266 "comparison between pointer and number",
267 "A pointer is compared to a number.", 0, 0
270 FK_OPS, FK_TYPE, modeFlag, ARG_NONE,
271 "strictops",
272 FLG_STRICTOPS,
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,
278 "bitwisesigned",
279 FLG_BITWISEOPS,
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,
287 "shiftnegative",
288 FLG_SHIFTNEGATIVE,
289 "a shift right operand may be negative",
290 "The right operand to a shift operator may be negative (behavior undefined).",
291 0, 0
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).",
299 0, 0
302 FK_OPS, FK_TYPE, modeFlag, ARG_NONE,
303 "sizeoftype",
304 FLG_SIZEOFTYPE,
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).)",
308 0, 0
311 FK_OPS, FK_TYPE, plainFlag, ARG_NONE,
312 "sizeofformalarray",
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.",
318 0, 0
321 FK_DECL, FK_TYPE, plainFlag, ARG_NONE,
322 "fixedformalarray",
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 "
327 "as a pointer.",
328 0, 0
331 FK_DECL, FK_TYPE, plainFlag, ARG_NONE,
332 "incompletetype",
333 FLG_INCOMPLETETYPE,
334 "formal parameter has an incomplete type",
335 "A formal parameter is declared with an incomplete type.",
336 0, 0
339 FK_DECL, FK_TYPE, plainFlag, ARG_NONE,
340 "formalarray",
341 FLG_FORMALARRAY,
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.",
345 0, 0
350 ** Booleans (4.2)
354 FK_BOOL, FK_NONE, plainFlag, ARG_STRING,
355 "booltype",
356 FLG_BOOLTYPE,
357 "set name of boolean type (default bool)",
358 NULL, 0, 0
361 FK_BOOL, FK_NONE, plainFlag, ARG_STRING,
362 "boolfalse",
363 FLG_BOOLFALSE,
364 "set name of boolean false (default false)",
365 NULL, 0, 0
368 FK_BOOL, FK_NONE, plainFlag, ARG_STRING,
369 "booltrue",
370 FLG_BOOLTRUE,
371 "set name of boolean true (default true)",
372 NULL, 0, 0
375 FK_BOOL, FK_HELP, plainFlag, ARG_NONE,
376 "likelybool",
377 FLG_LIKELYBOOL,
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.",
382 0, 0
386 FK_BOOL, FK_OPS, modeFlag, ARG_NONE,
387 "boolcompare",
388 FLG_BOOLCOMPARE,
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,
398 "boolops",
399 FLG_BOOLOPS,
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.",
403 0, 0
406 FK_BOOL, FK_POINTER, modeFlag, ARG_NONE,
407 "ptrnegate",
408 FLG_PTRNEGATE,
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,
414 "predassign",
415 FLG_PREDASSIGN,
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 "
420 "this message.",
421 0, 0
424 FK_BOOL, FK_PRED, specialFlag, ARG_NONE,
425 "predbool",
426 FLG_PREDBOOL,
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,
433 "predboolint",
434 FLG_PREDBOOLINT,
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,
440 "predboolptr",
441 FLG_PREDBOOLPTR,
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,
447 "predboolothers",
448 FLG_PREDBOOLOTHERS,
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,
459 "abstract",
460 FLG_ABSTRACT,
461 "data abstraction barriers",
462 "An abstraction barrier is broken. If necessary, use /*@access <type>@*/ to allow access to an abstract type.",
463 0, 0
466 FK_ABSTRACT, FK_NONE, modeFlag, ARG_NONE,
467 "abstractcompare",
468 FLG_ABSTRACTCOMPARE,
469 "object equality comparison on abstract type operands",
470 "An object comparison (== or !=) is used on operands of abstract type.",
471 0, 0
475 FK_ABSTRACT, FK_NONE, plainFlag, ARG_NONE,
476 "numabstract",
477 FLG_NUMABSTRACT,
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.",
480 0, 0
483 FK_ABSTRACT, FK_NONE, modeFlag, ARG_NONE,
484 "numabstractcast",
485 FLG_NUMABSTRACTCAST,
486 "numeric literal cast to numabstract type",
487 "A numeric literal is cast to a numabstract type.",
488 0, 0
491 FK_ABSTRACT, FK_NONE, modeFlag, ARG_NONE,
492 "numabstractlit",
493 FLG_NUMABSTRACTLIT,
494 "numeric literal can used as numabstract type",
495 "To allow a numeric literal to be used as a numabstract type, use +numabstractlit.",
496 0, 0
499 FK_ABSTRACT, FK_TYPEEQ, modeFlag, ARG_NONE,
500 "numabstractindex",
501 FLG_NUMABSTRACTINDEX,
502 "a numabstract type can be used to index an array",
503 "To allow numabstract types to index arrays, use +numabstractindex.",
504 0, 0
507 FK_ABSTRACT, FK_NONE, modeFlag, ARG_NONE,
508 "numabstractprint",
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.",
512 0, 0
515 FK_ABSTRACT, FK_IMPLICIT, plainFlag, ARG_NONE,
516 "impabstract",
517 FLG_IMPABSTRACT,
518 "assume user type definitions are abstract (unless /*@concrete@*/ is used)",
519 NULL,
520 0, 0
523 /* 4.3.1 Access */
526 FK_ABSTRACT, FK_NAMES, plainFlag, ARG_NONE,
527 "accessmodule",
528 FLG_ACCESSMODULE,
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>.",
532 0, 0
535 FK_ABSTRACT, FK_NAMES, plainFlag, ARG_NONE,
536 "accessfile",
537 FLG_ACCESSFILE,
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>.",
541 0, 0
544 FK_ABSTRACT, FK_NAMES, plainFlag, ARG_NONE,
545 "accessczech",
546 FLG_ACCESSCZECH,
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>",
550 0, 0
553 FK_ABSTRACT, FK_NAMES, plainFlag, ARG_NONE,
554 "accessslovak",
555 FLG_ACCESSSLOVAK,
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>",
559 0, 0
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>",
568 0, 0
571 FK_ABSTRACT, FK_NAMES, specialFlag, ARG_NONE,
572 "accessall",
573 FLG_ACCESSALL,
574 "set accessmodule, accessfile and accessczech",
575 "Sets accessmodule, accessfile and accessczech",
576 0, 0
579 /* 4.3.2 Mutability */
581 FK_ABSTRACT, FK_NONE, modeFlag, ARG_NONE,
582 "mutrep",
583 FLG_MUTREP,
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.",
589 0, 0
594 ** Memory Management (5)
597 /* Deallocation Errors */
599 FK_MEMORY, FK_LEAK, modeFlag, ARG_NONE,
600 "mustfreefresh",
601 FLG_MUSTFREEFRESH,
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.",
605 0, 0
608 FK_MEMORY, FK_LEAK, modeFlag, ARG_NONE,
609 "mustfreeonly",
610 FLG_MUSTFREEONLY,
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.",
614 0, 0
617 FK_MEMORY, FK_LEAK, specialFlag, ARG_NONE,
618 "mustfree",
619 FLG_MUSTFREE,
620 "fresh or only storage not released before return or scope exit (sets mustfreefresh and mustfreeonly)",
621 "A memory leak has been detected.",
622 0, 0
625 FK_MEMORY, FK_DEAD, modeFlag, ARG_NONE,
626 "usereleased",
627 FLG_USERELEASED,
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).",
631 0, 0
634 FK_MEMORY, FK_DEAD, modeFlag, ARG_NONE,
635 "strictusereleased",
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).",
640 0, 0
643 FK_MEMORY, FK_LEAK, modeFlag, ARG_NONE,
644 "compdestroy",
645 FLG_COMPDESTROY,
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.",
653 0, 0
656 FK_MEMORY, FK_LEAK, modeFlag, ARG_NONE,
657 "strictdestroy",
658 FLG_STRICTDESTROY,
659 "report complete destruction errors for array elements that "
660 "may have been released",
661 NULL,
662 0, 0
665 FK_MEMORY, FK_ARRAY, modeFlag, ARG_NONE,
666 "deparrays",
667 FLG_DEPARRAYS,
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.",
673 0, 0
676 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
677 "branchstate",
678 FLG_BRANCHSTATE,
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 "
682 "to the storage.",
683 0, 0
686 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
687 "strictbranchstate",
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 "
693 "to the storage.",
694 0, 0
697 FK_MEMORY, FK_NONE, specialFlag, ARG_NONE,
698 "memchecks",
699 FLG_MEMCHECKS,
700 "sets all dynamic memory checking flags (memimplicit, mustfree, mustdefine, "
701 "mustnotalias, null, memtrans)",
702 NULL, 0, 0
705 FK_MEMORY, FK_DEF, modeFlag, ARG_NONE,
706 "compmempass",
707 FLG_COMPMEMPASS,
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.",
711 0, 0
714 FK_MEMORY, FK_DEAD, modeFlag, ARG_NONE,
715 "stackref",
716 FLG_RETSTACK,
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.",
721 0, 0
725 FK_MEMORY, FK_NONE, specialFlag, ARG_NONE,
726 "memtrans",
727 FLG_MEMTRANS,
728 "memory transfer errors (sets all *trans flags)",
729 "Memory is transferred in a way that violates annotations.",
730 0, 0
733 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
734 "dependenttrans",
735 FLG_DEPENDENTTRANS,
736 "dependent transfer errors",
737 "Dependent storage is transferred to a non-dependent reference.",
738 0, 0
741 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
742 "newreftrans",
743 FLG_NEWREFTRANS,
744 "new reference transfer to reference counted reference",
745 "A new reference is transferred to a reference counted reference.",
746 0, 0
749 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
750 "onlytrans",
751 FLG_ONLYTRANS,
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.",
757 0, 0
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.",
769 0, 0
772 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
773 "ownedtrans",
774 FLG_OWNEDTRANS,
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.",
780 0, 0
783 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
784 "freshtrans",
785 FLG_FRESHTRANS,
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 "
791 "storage.",
792 0, 0
795 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
796 "sharedtrans",
797 FLG_SHAREDTRANS,
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.",
801 0, 0
804 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
805 "temptrans",
806 FLG_TEMPTRANS,
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.",
811 0, 0
814 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
815 "kepttrans",
816 FLG_KEPTTRANS,
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.",
821 0, 0
824 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
825 "keeptrans",
826 FLG_KEEPTRANS,
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.",
830 0, 0
833 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
834 "immediatetrans",
835 FLG_IMMEDIATETRANS,
836 "an immediate address (result of &) is transferred inconsistently",
837 "An immediate address (result of & operator) is transferred "
838 "inconsistently.",
839 0, 0
842 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
843 "refcounttrans",
844 FLG_REFCOUNTTRANS,
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.",
848 0, 0
851 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
852 "statictrans",
853 FLG_STATICTRANS,
854 "static storage is transferred in an inconsistent way",
855 "Static storage is transferred in an inconsistent way.",
856 0, 0
859 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
860 "unqualifiedtrans",
861 FLG_UNKNOWNTRANS,
862 "unqualified storage is transferred in an inconsistent way",
863 "Unqualified storage is transferred in an inconsistent way.",
864 0, 0
867 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
868 "staticinittrans",
869 FLG_STATICINITTRANS,
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.",
872 0, 0
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.",
880 0, 0
883 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
884 "readonlytrans",
885 FLG_READONLYTRANS,
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.",
888 0, 0
891 FK_MEMORY, FK_PARAMS, modeFlag, ARG_NONE,
892 "passunknown",
893 FLG_PASSUNKNOWN,
894 "passing a value as an un-annotated parameter clears its annotation",
895 NULL, 0, 0
898 /* 5.3 Implicit Memory Annotations */
901 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
902 "readonlystrings",
903 FLG_READONLYSTRINGS,
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.",
907 0, 0
910 FK_MEMORY, FK_IMPLICIT, modeFlag, ARG_NONE,
911 "memimp",
912 FLG_MEMIMPLICIT,
913 "memory errors for unqualified storage",
914 NULL, 0, 0
917 FK_MEMORY, FK_IMPLICIT, plainFlag, ARG_NONE,
918 "paramimptemp",
919 FLG_PARAMIMPTEMP,
920 "assume unannotated parameter is temp",
921 NULL, 0, 0
924 FK_MEMORY, FK_IMPLICIT, specialFlag, ARG_NONE,
925 "allimponly",
926 FLG_ALLIMPONLY,
927 "sets globimponly, retimponly, structimponly, specglobimponly, "
928 "specretimponly and specstructimponly",
929 NULL, 0, 0
932 FK_MEMORY, FK_IMPLICIT, specialFlag, ARG_NONE,
933 "codeimponly",
934 FLG_CODEIMPONLY,
935 "sets globimponly, retimponly and structimponly",
936 NULL, 0, 0
939 FK_MEMORY, FK_IMPLICIT, specialFlag, ARG_NONE,
940 "specimponly",
941 FLG_SPECALLIMPONLY,
942 "sets specglobimponly, specretimponly and specstructimponly",
943 NULL, 0, 0
946 FK_MEMORY, FK_IMPLICIT, plainFlag, ARG_NONE,
947 "globimponly",
948 FLG_GLOBIMPONLY,
949 "assume unannotated global storage is only",
950 NULL, 0, 0
953 FK_MEMORY, FK_IMPLICIT, plainFlag, ARG_NONE,
954 "retimponly",
955 FLG_RETIMPONLY,
956 "assume unannotated returned storage is only",
957 NULL, 0, 0
960 FK_MEMORY, FK_IMPLICIT, plainFlag, ARG_NONE,
961 "structimponly",
962 FLG_STRUCTIMPONLY,
963 "assume unannotated structure field is only",
964 NULL, 0, 0
967 FK_MEMORY, FK_IMPLICIT, plainFlag, ARG_NONE,
968 "specglobimponly",
969 FLG_SPECGLOBIMPONLY,
970 "assume unannotated global storage is only",
971 NULL, 0, 0
974 FK_MEMORY, FK_IMPLICIT, plainFlag, ARG_NONE,
975 "specretimponly",
976 FLG_SPECRETIMPONLY,
977 "assume unannotated returned storage is only",
978 NULL, 0, 0
981 FK_MEMORY, FK_IMPLICIT, plainFlag, ARG_NONE,
982 "specstructimponly",
983 FLG_SPECSTRUCTIMPONLY,
984 "assume unannotated structure field is only",
985 NULL, 0, 0
988 /* Reference Counting */
993 ** 6. Sharing
996 /* 6.1 Aliasing warnings */
999 FK_ALIAS, FK_MEMORY, modeFlag, ARG_NONE,
1000 "aliasunique",
1001 FLG_ALIASUNIQUE,
1002 "unique parameter is aliased",
1003 "A unique or only parameter is aliased by some other parameter or visible global.",
1004 0, 0
1007 FK_ALIAS, FK_MEMORY, modeFlag, ARG_NONE,
1008 "mayaliasunique",
1009 FLG_MAYALIASUNIQUE,
1010 "unique parameter may be aliased",
1011 "A unique or only parameter may be aliased by some other parameter or visible global.",
1012 0, 0
1015 FK_ALIAS, FK_MEMORY, modeFlag, ARG_NONE,
1016 "mustnotalias",
1017 FLG_MUSTNOTALIAS,
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.",
1020 0, 0
1023 FK_ALIAS, FK_NONE, modeFlag, ARG_NONE,
1024 "retalias",
1025 FLG_RETALIAS,
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,
1033 "globalias",
1034 FLG_GLOBALIAS,
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.",
1039 0, 0
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.",
1047 0, 0
1050 FK_ALIAS, FK_GLOBALS, modeFlag, ARG_NONE,
1051 "checkedglobalias",
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.",
1055 0, 0
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.",
1063 0, 0
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.",
1071 0, 0
1074 /* 6.2 Exposure */
1077 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
1078 "exposetrans",
1079 FLG_EXPOSETRANS,
1080 "exposure transfer errors",
1081 "Exposed storage is transferred to a non-exposed, non-observer reference.",
1082 0, 0
1085 FK_MEMORY, FK_NONE, modeFlag, ARG_NONE,
1086 "observertrans",
1087 FLG_OBSERVERTRANS,
1088 "observer transfer errors",
1089 "Observer storage is transferred to a non-observer reference.",
1090 0, 0
1093 FK_EXPOSURE, FK_ABSTRACT, specialFlag, ARG_NONE,
1094 "repexpose",
1095 FLG_REPEXPOSE,
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.",
1100 0, 0
1103 FK_EXPOSURE, FK_ABSTRACT, modeFlag, ARG_NONE,
1104 "retexpose",
1105 FLG_RETEXPOSE,
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).",
1113 0, 0
1116 FK_EXPOSURE, FK_ABSTRACT, modeFlag, ARG_NONE,
1117 "assignexpose",
1118 FLG_ASSIGNEXPOSE,
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.",
1126 0, 0
1129 FK_EXPOSURE, FK_ABSTRACT, modeFlag, ARG_NONE,
1130 "castexpose",
1131 FLG_CASTEXPOSE,
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.",
1136 0, 0
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.",
1144 0, 0
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.",
1152 0, 0
1156 ** 7. Function Interfaces
1159 /* 7.1 Modifications */
1162 FK_MODIFIES, FK_SPEC, plainFlag, ARG_NONE,
1163 "mods",
1164 FLG_MODIFIES,
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.",
1168 0, 0
1171 FK_MODIFIES, FK_SPEC, modeFlag, ARG_NONE,
1172 "mustmod",
1173 FLG_MUSTMOD,
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 "
1178 "function.",
1179 0, 0
1182 FK_MODIFIES, FK_MEMORY, plainFlag, ARG_NONE,
1183 "modobserver",
1184 FLG_MODOBSERVER,
1185 "possible modification of observer storage",
1186 "Storage declared with observer is possibly modified. Observer "
1187 "storage may not be modified.",
1188 0, 0
1191 FK_MODIFIES, FK_MEMORY, modeFlag, ARG_NONE,
1192 "modobserveruncon",
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.",
1197 0, 0
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",
1206 0, 0
1209 FK_MODIFIES, FK_UNSPEC, modeFlag, ARG_NONE,
1210 "modfilesys",
1211 FLG_MODFILESYSTEM,
1212 "report undocumented file system modifications (applies to unspecified "
1213 "functions if modnomods is set)",
1214 NULL, 0, 0
1217 FK_MODIFIES, FK_UNSPEC, specialFlag, ARG_NONE,
1218 "modunspec",
1219 FLG_MODUNSPEC,
1220 "modification in unspecified functions (sets modnomods, "
1221 "modglobunspec and modstrictglobsunspec)",
1222 NULL, 0, 0
1225 FK_MODIFIES, FK_UNSPEC, modeFlag, ARG_NONE,
1226 "modnomods",
1227 FLG_MODNOMODS,
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.",
1233 0, 0
1236 FK_MODIFIES, FK_UNSPEC, modeFlag, ARG_NONE,
1237 "moduncon",
1238 FLG_MODUNCON,
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.",
1244 0, 0
1247 FK_MODIFIES, FK_UNSPEC, modeFlag, ARG_NONE,
1248 "modunconnomods",
1249 FLG_MODUNCONNOMODS,
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.",
1256 0, 0
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.",
1266 0, 0
1269 FK_MODIFIES, FK_GLOBALS, modeFlag, ARG_NONE,
1270 "modsimpnoglobs",
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.",
1276 0, 0
1280 ** Globals
1284 FK_GLOBALS, FK_NONE, modeFlag, ARG_NONE,
1285 "globstate",
1286 FLG_GLOBSTATE,
1287 "returns with global in inconsistent state (null or undefined)",
1288 "A global variable does not satisfy its annotations when control is transferred.",
1289 0, 0
1293 FK_GLOBALS, FK_SPEC, plainFlag, ARG_NONE,
1294 "globs",
1295 FLG_GLOBALS,
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 "
1301 "declaration.",
1302 0, 0
1305 FK_GLOBALS, FK_SPEC, modeFlag, ARG_NONE,
1306 "globuse",
1307 FLG_USEALLGLOBS,
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.",
1311 0, 0
1314 FK_GLOBALS, FK_NONE, modeFlag, ARG_NONE,
1315 "internalglobs",
1316 FLG_INTERNALGLOBS,
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",
1320 0, 0
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",
1329 0, 0
1332 FK_GLOBALS, FK_MODIFIES, modeFlag, ARG_NONE,
1333 "warnmissingglobs",
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.",
1338 0, 0
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.",
1348 0, 0
1351 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1352 "globnoglobs",
1353 FLG_GLOBUNSPEC,
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.",
1361 0, 0
1364 FK_GLOBALS, FK_IMPLICIT, modeFlag, ARG_NONE,
1365 "allglobs",
1366 FLG_ALLGLOBALS,
1367 "report use and modification errors for globals not annotated with unchecked",
1368 NULL, 0, 0
1371 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1372 "checkstrictglobs",
1373 FLG_CHECKSTRICTGLOBALS,
1374 "report use and modification errors for checkedstrict globals",
1375 NULL, 0, 0
1378 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1379 "impcheckedspecglobs",
1380 FLG_IMPCHECKEDSPECGLOBALS,
1381 "assume checked qualifier for unqualified global declarations in .lcl files",
1382 NULL, 0, 0
1385 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1386 "impcheckmodspecglobs",
1387 FLG_IMPCHECKMODSPECGLOBALS,
1388 "assume checkmod qualifier for unqualified global declarations in .lcl files",
1389 NULL, 0, 0
1392 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1393 "impcheckedstrictspecglobs",
1394 FLG_IMPCHECKEDSTRICTSPECGLOBALS,
1395 "assume checkmod qualifier for unqualified global declarations in .lcl files",
1396 NULL, 0, 0
1399 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1400 "impcheckedglobs",
1401 FLG_IMPCHECKEDGLOBALS,
1402 "assume checked qualifier for unqualified global declarations",
1403 NULL, 0, 0
1406 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1407 "impcheckmodglobs",
1408 FLG_IMPCHECKMODGLOBALS,
1409 "assume checkmod qualifier for unqualified global declarations",
1410 NULL, 0, 0
1413 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1414 "impcheckedstrictglobs",
1415 FLG_IMPCHECKEDSTRICTGLOBALS,
1416 "assume checkedstrict qualifier for unqualified global declarations",
1417 NULL, 0, 0
1420 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1421 "impcheckedstatics",
1422 FLG_IMPCHECKEDSTATICS,
1423 "assume checked qualifier for unqualified file static declarations",
1424 NULL, 0, 0
1427 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1428 "impcheckmodstatics",
1429 FLG_IMPCHECKMODSTATICS,
1430 "assume checkmod qualifier for unqualified file static declarations",
1431 NULL, 0, 0
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)",
1439 NULL, 0, 0
1442 FK_GLOBALS, FK_UNSPEC, modeFlag, ARG_NONE,
1443 "impcheckedstrictstatics",
1444 FLG_IMPCHECKEDSTRICTSTATICS,
1445 "assume checkedstrict qualifier for unqualified file static declarations",
1446 NULL, 0, 0
1449 FK_GLOBALS, FK_MODIFIES, modeFlag, ARG_NONE,
1450 "modglobs",
1451 FLG_MODGLOBS,
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.",
1455 0, 0
1458 FK_GLOBALS, FK_MODIFIES, modeFlag, ARG_NONE,
1459 "modglobsnomods",
1460 FLG_MODGLOBSUNSPEC,
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.",
1465 0, 0
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.",
1475 0, 0
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.",
1484 0, 0
1488 ** State Clauses
1492 ** 8. Control Flow
1495 /* 8.1 Execution */
1498 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1499 "noret",
1500 FLG_NORETURN,
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 "
1505 "the caller.",
1506 0, 0
1509 FK_CONTROL, FK_NONE, plainFlag, ARG_NONE,
1510 "emptyret",
1511 FLG_EMPTYRETURN,
1512 "empty return in function declared to return value",
1513 NULL,
1514 0, 0
1517 FK_CONTROL, FK_NONE, plainFlag, ARG_NONE,
1518 "alwaysexits",
1519 FLG_ALWAYSEXITS,
1520 "loop predicate always exits",
1521 NULL,
1522 0, 0
1526 FK_CONTROL, FK_MEMORY, specialFlag, ARG_NONE,
1527 "loopexec",
1528 FLG_LOOPEXEC,
1529 "assume all loops execute at least once (sets forloopexec, whileloopexec and iterloopexec)",
1530 NULL, 0, 0
1533 FK_CONTROL, FK_MEMORY, plainFlag, ARG_NONE,
1534 "forloopexec",
1535 FLG_FORLOOPEXEC,
1536 "assume all for loops execute at least once",
1537 NULL, 0, 0
1540 FK_CONTROL, FK_MEMORY, plainFlag, ARG_NONE,
1541 "whileloopexec",
1542 FLG_WHILELOOPEXEC,
1543 "assume all while loops execute at least once",
1544 NULL, 0, 0
1547 FK_CONTROL, FK_MEMORY, plainFlag, ARG_NONE,
1548 "iterloopexec",
1549 FLG_ITERLOOPEXEC,
1550 "assume all iterator loops execute at least once",
1551 NULL, 0, 0
1554 FK_CONTROL, FK_MEMORY, plainFlag, ARG_NONE,
1555 "obviousloopexec",
1556 FLG_OBVIOUSLOOPEXEC,
1557 "assume loop that can be determined to always execute always does",
1558 NULL, 0, 0
1561 /* 8.2 Undefined Behavior */
1564 FK_BEHAVIOR, FK_ANSI, modeFlag, ARG_NONE,
1565 "evalorder",
1566 FLG_EVALORDER,
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 "
1574 "unspecified.",
1575 0, 0
1578 FK_BEHAVIOR, FK_ANSI, modeFlag, ARG_NONE,
1579 "evalorderuncon",
1580 FLG_EVALORDERUNCON,
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.",
1586 0, 0
1589 /* 8.3 Problematic Control Structures */
1591 /* 8.3.1 Infinite Loops */
1594 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1595 "infloops",
1596 FLG_INFLOOPS,
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.",
1602 0, 0
1605 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1606 "infloopsuncon",
1607 FLG_INFLOOPSUNCON,
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.",
1614 0, 0
1617 /* 8.3.2 Switches */
1620 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1621 "casebreak",
1622 FLG_CASEBREAK,
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,
1628 "misscase",
1629 FLG_MISSCASE,
1630 "switch on enum type missing case for some value",
1631 "Not all values in an enumeration are present as cases in the switch.",
1632 0, 0
1635 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1636 "firstcase",
1637 FLG_FIRSTCASE,
1638 "first statement in switch is not a case",
1639 "The first statement after a switch is not a case.",
1640 0, 0
1643 FK_CONTROL, FK_NONE, plainFlag, ARG_NONE,
1644 "duplicatecases",
1645 FLG_DUPLICATECASES,
1646 "duplicate cases in switch",
1647 "Duplicate cases in switch.",
1648 0, 0
1651 /* 8.3.3 Deep Breaks */
1654 FK_CONTROL, FK_NONE, specialFlag, ARG_NONE,
1655 "deepbreak",
1656 FLG_DEEPBREAK,
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.",
1661 0, 0
1664 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1665 "looploopbreak",
1666 FLG_LOOPLOOPBREAK,
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.",
1673 0, 0
1676 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1677 "switchloopbreak",
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.",
1685 0, 0
1688 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1689 "loopswitchbreak",
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.",
1697 0, 0
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.",
1709 0, 0
1712 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1713 "looploopcontinue",
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.",
1721 0, 0
1724 /* 8.3.4 Loop and If Bodies */
1727 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1728 "whileempty",
1729 FLG_WHILEEMPTY,
1730 "a while statement has no body",
1731 "While statement has no body.",
1732 0, 0
1735 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1736 "whileblock",
1737 FLG_WHILEBLOCK,
1738 "the body of a while statement is not a block",
1739 "While body is a single statement, not a compound block.",
1740 0, 0
1743 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1744 "forempty",
1745 FLG_FOREMPTY,
1746 "a for statement has no body",
1747 "For statement has no body.",
1748 0, 0
1751 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1752 "forblock",
1753 FLG_FORBLOCK,
1754 "the body of a for statement is not a block",
1755 "Loop body is a single statement, not a compound block.",
1756 0, 0
1759 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1760 "ifempty",
1761 FLG_IFEMPTY,
1762 "an if statement has no body",
1763 "If statement has no body.",
1764 0, 0
1767 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1768 "ifblock",
1769 FLG_IFBLOCK,
1770 "the body of an if statement is not a block",
1771 "If body is a single statement, not a compound block.",
1772 0, 0
1775 FK_CONTROL, FK_NONE, specialFlag, ARG_NONE,
1776 "allempty",
1777 FLG_ALLEMPTY,
1778 "an if, while or for statement has no body (sets ifempty, "
1779 "whileempty and forempty",
1780 NULL,
1781 0, 0
1784 FK_CONTROL, FK_NONE, specialFlag, ARG_NONE,
1785 "allblock",
1786 FLG_ALLBLOCK,
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.",
1790 0, 0
1793 /* 8.3.5 Complete Logic */
1796 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1797 "elseifcomplete",
1798 FLG_ELSEIFCOMPLETE,
1799 "if ... else if chains must have final else",
1800 "There is no final else following an else if construct.",
1801 0, 0
1804 /* 8.4 Suspicious Statements */
1807 FK_CONTROL, FK_NONE, modeFlag, ARG_NONE,
1808 "unreachable",
1809 FLG_UNREACHABLE,
1810 "unreachable code detected",
1811 "This code will never be reached on any possible execution.",
1812 0, 0
1815 /* 8.4.1 Statements with No Effects */
1818 FK_EFFECT, FK_CONTROL, modeFlag, ARG_NONE,
1819 "noeffect",
1820 FLG_NOEFFECT,
1821 "statement with no effect",
1822 "Statement has no visible effect --- no values are modified.",
1823 0, 0
1826 FK_EFFECT, FK_CONTROL, modeFlag, ARG_NONE,
1827 "noeffectuncon",
1828 FLG_NOEFFECTUNCON,
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.",
1833 0, 0
1836 /* 8.4.2 Ignored Return Values */
1839 FK_IGNORERET, FK_NONE, specialFlag, ARG_NONE,
1840 "retval",
1841 FLG_RETVAL,
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.",
1845 0, 0
1848 FK_IGNORERET, FK_BOOL, modeFlag, ARG_NONE,
1849 "retvalother",
1850 FLG_RETVALOTHER,
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.",
1854 0, 0
1857 FK_IGNORERET, FK_BOOL, modeFlag, ARG_NONE,
1858 "retvalbool",
1859 FLG_RETVALBOOL,
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.",
1863 0, 0
1866 FK_IGNORERET, FK_NONE, modeFlag, ARG_NONE,
1867 "retvalint",
1868 FLG_RETVALINT,
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.",
1872 0, 0
1876 ** 9. Buffer Sizes
1880 FK_BOUNDS, FK_MEMORY, modeFlag, ARG_NONE,
1881 "nullterminated",
1882 FLG_NULLTERMINATED,
1883 "misuse of nullterminated allocation",
1884 "A possibly non-nullterminated string/memory is used/referenced as a nullterminated one.",
1885 0, 0
1888 FK_BOUNDS, FK_MEMORY, specialFlag, ARG_NONE,
1889 "bounds",
1890 FLG_BOUNDS,
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,
1896 "likelybounds",
1897 FLG_LIKELYBOUNDS,
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,
1903 "likelyboundsread",
1904 FLG_LIKELYBOUNDSREAD,
1905 "likely out of bounds read",
1906 "A memory read references memory beyond the allocated storage.",
1907 0, 0
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.",
1915 0, 0
1919 FK_BOUNDS, FK_MEMORY, modeFlag, ARG_NONE,
1920 "boundsread",
1921 FLG_BOUNDSREAD,
1922 "possible out of bounds read",
1923 "A memory read references memory beyond the allocated storage.",
1924 0, 0
1927 FK_BOUNDS, FK_MEMORY, modeFlag, ARG_NONE,
1928 "boundswrite",
1929 FLG_BOUNDSWRITE,
1930 "possible buffer overflow from an out of bounds write",
1931 "A memory write may write to an address beyond the allocated buffer.",
1932 0, 0
1936 FK_BOUNDS, FK_DISPLAY, plainFlag, ARG_NONE,
1937 "fcnpost",
1938 FLG_FUNCTIONPOST,
1939 "display function post conditions",
1940 "Display function post conditions.",
1941 0, 0
1944 FK_BOUNDS, FK_DISPLAY, plainFlag, ARG_NONE,
1945 "redundantconstraints",
1946 FLG_REDUNDANTCONSTRAINTS,
1947 "display seemingly redundant constraints",
1948 "Display seemingly redundant constraints",
1949 0, 0
1951 /*drl7x added 6/18/01 */
1953 FK_BOUNDS, FK_MEMORY, modeFlag, ARG_NONE,
1954 "checkpost",
1955 FLG_CHECKPOST,
1956 "unable to verify predicate in ensures clause",
1957 "The function implementation may not satisfy a post condition given in an ensures clause.",
1958 0, 0
1962 FK_BOUNDS, FK_MEMORY, plainFlag, ARG_NONE,
1963 "impboundsconstraints",
1964 FLG_IMPBOUNDSCONSTRAINTS,
1965 "generate implicit constraints for functions",
1966 NULL,
1967 0, 0
1969 /*drl7x added 4/29/01 */
1971 FK_BOUNDS, FK_MEMORY, plainFlag, ARG_NONE,
1972 "orconstraint",
1973 FLG_ORCONSTRAINT,
1974 "use limited OR expressions to resolve constraints",
1975 NULL,
1976 0, 0
1979 FK_BOUNDS, FK_DISPLAY, plainFlag, ARG_NONE,
1980 "showconstraintparens",
1981 FLG_PARENCONSTRAINT,
1982 "display parentheses around constraint terms",
1983 NULL,
1984 0, 0
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",
1992 NULL,
1993 0, 0
1996 FK_BOUNDS, FK_DISPLAY, plainFlag, ARG_NONE,
1997 "showconstraintlocation",
1998 FLG_CONSTRAINTLOCATION,
1999 "display location for every constraint generated",
2000 NULL,
2001 0, 0
2002 }, /*drl added flag 4/26/01*/
2004 { /* evans added 2003-06-08 */
2005 FK_BOUNDS, FK_MEMORY, modeFlag, ARG_NONE,
2006 "allocmismatch",
2007 FLG_ALLOCMISMATCH,
2008 "type conversion involves storage of non-divisble size",
2009 NULL, 0, 0
2013 ** 10. Extensible Checking
2017 FK_EXTENSIBLE, FK_FILES, globalFlag, ARG_FILE,
2018 "mts",
2019 FLG_MTSFILE,
2020 "load meta state declaration and corresponding xh file",
2021 NULL, 0, 0
2024 FK_EXTENSIBLE, FK_MEMORY, modeFlag, ARG_NONE,
2025 "statetransfer",
2026 FLG_STATETRANSFER,
2027 "storage has been transfered with invalid state",
2028 "Transfer violates user-defined state rules.",
2029 0, 0
2032 FK_EXTENSIBLE, FK_MEMORY, modeFlag, ARG_NONE,
2033 "statemerge",
2034 FLG_STATEMERGE,
2035 "control paths merge with storage in incompatible states",
2036 "Control path merge violates user-defined state merge rules.",
2037 0, 0
2041 ** 11. Macros
2045 FK_MACROS, FK_NONE, modeFlag, ARG_NONE,
2046 "macroredef",
2047 FLG_MACROREDEF,
2048 "macro redefined",
2049 "A macro is defined in more than one place.", 0, 0
2052 FK_MACROS, FK_UNRECOG, modeFlag, ARG_NONE,
2053 "macrounrecog",
2054 FLG_MACROUNDEF,
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.",
2058 0, 0
2061 /* 11.1 Constant Macros */
2064 FK_MACROS, FK_PROTOS, modeFlag, ARG_NONE,
2065 "macroconstdecl",
2066 FLG_MACROCONSTDECL,
2067 "non-parameterized macro without prototype or specification",
2068 "Macro constant has no declaration. Use /*@constant ...@*/ to "
2069 "declare the macro.",
2070 0, 0
2074 FK_MACROS, FK_PROTOS, plainFlag, ARG_NONE,
2075 "macroconstdistance",
2076 FLG_MACROCONSTDIST,
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.",
2079 0, 0
2082 /* 11.2 Function-like Macros */
2085 FK_MACROS, FK_NONE, modeFlag, ARG_NONE,
2086 "macrostmt",
2087 FLG_MACROSTMT,
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.",
2092 0, 0
2095 FK_MACROS, FK_NONE, modeFlag, ARG_NONE,
2096 "macroempty",
2097 FLG_MACROEMPTY,
2098 "macro definition for is empty",
2099 "A macro definition has no body.",
2100 0, 0
2103 FK_MACROS, FK_PARAMS, modeFlag, ARG_NONE,
2104 "macroparams",
2105 FLG_MACROPARAMS,
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.",
2113 0, 0
2116 FK_MACROS, FK_CONTROL, modeFlag, ARG_NONE,
2117 "macroret",
2118 FLG_MACRORETURN,
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.",
2123 0, 0
2126 FK_MACROS, FK_PARAMS, modeFlag, ARG_NONE,
2127 "macroassign",
2128 FLG_MACROASSIGN,
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.",
2133 0, 0
2136 FK_MACROS, FK_NONE, modeFlag, ARG_NONE,
2137 "macroparens",
2138 FLG_MACROPARENS,
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.",
2143 0, 0
2146 FK_MACROS, FK_PROTOS, modeFlag, ARG_NONE,
2147 "macrodecl",
2148 FLG_MACRODECL,
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.",
2152 0, 0
2155 FK_MACROS, FK_PROTOS, modeFlag, ARG_NONE,
2156 "macrofcndecl",
2157 FLG_MACROFCNDECL,
2158 "parameterized macro without prototype or specification",
2159 "Function macro has no declaration.",
2160 0, 0
2163 /* 11.2.1 Side Effect Free Parameters */
2166 FK_MACROS, FK_PARAMS, modeFlag, ARG_NONE,
2167 "sefparams",
2168 FLG_SEFPARAMS,
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.",
2171 0, 0
2174 FK_MACROS, FK_PARAMS, modeFlag, ARG_NONE,
2175 "sefuncon",
2176 FLG_SEFUNSPEC,
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.",
2180 0, 0
2183 /* 11.3 Controlling Macro Checking */
2186 FK_MACROS, FK_NONE, plainFlag, ARG_NONE,
2187 "constmacros",
2188 FLG_CONSTMACROS,
2189 "check all macros without parameter lists as constants",
2190 "Every non-parameterized macro (not preceded by /*@notfunction@*/) "
2191 "is checked as a constant.",
2192 0, 0
2195 FK_MACROS, FK_NONE, plainFlag, ARG_NONE,
2196 "fcnmacros",
2197 FLG_FCNMACROS,
2198 "check all macros with parameter lists as functions",
2199 "Every parameterized macro (not preceded by /*@notfunction@*/) "
2200 "is checked as a function.",
2201 0, 0
2204 FK_MACROS, FK_NONE, specialFlag, ARG_NONE,
2205 "allmacros",
2206 FLG_ALLMACROS,
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.",
2210 0, 0
2213 FK_MACROS, FK_NONE, plainFlag, ARG_NONE,
2214 "libmacros",
2215 FLG_LIBMACROS,
2216 "check all macros with declarations in library as functions",
2217 "Every macro declared in the load library is checked.",
2218 0, 0
2221 FK_MACROS, FK_NONE, plainFlag, ARG_NONE,
2222 "specmacros",
2223 FLG_SPECMACROS,
2224 "check all macros corresponding to specified functions or constants",
2225 "Every macro declared a specification file is checked.",
2226 0, 0
2229 FK_MACROS, FK_NONE, modeFlag, ARG_NONE,
2230 "macromatchname",
2231 FLG_MACROMATCHNAME,
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",
2235 0, 0
2238 FK_MACROS, FK_NONE, plainFlag, ARG_NONE,
2239 "nextlinemacros",
2240 FLG_MACRONEXTLINE,
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.",
2243 0, 0
2246 /* 11.4 Iterators */
2249 FK_ITER, FK_NONE, plainFlag, ARG_NONE,
2250 "iterbalance",
2251 FLG_ITERBALANCE,
2252 "iter is not balanced with end_<iter>",
2253 NULL,
2254 0, 0
2257 FK_ITER, FK_NONE, plainFlag, ARG_NONE,
2258 "iteryield",
2259 FLG_ITERYIELD,
2260 "iter yield parameter is inappropriate",
2261 NULL,
2262 0, 0
2265 FK_ITER, FK_NONE, plainFlag, ARG_NONE,
2266 "hasyield",
2267 FLG_HASYIELD,
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.",
2275 0, 0
2279 ** 12. Naming Conventions
2283 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2284 "namechecks",
2285 FLG_NAMECHECKS,
2286 "controls name checking without changing other settings",
2287 NULL, 0, 0
2290 /* 12.1.1 Czech Names */
2293 FK_NAMES, FK_ABSTRACT, specialFlag, ARG_NONE,
2294 "czech",
2295 FLG_CZECH,
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,
2302 "czechfcns",
2303 FLG_CZECHFUNCTIONS,
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,
2309 "czechvars",
2310 FLG_CZECHVARS,
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,
2316 "czechmacros",
2317 FLG_CZECHMACROS,
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,
2323 "czechconsts",
2324 FLG_CZECHCONSTANTS,
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,
2330 "czechtypes",
2331 FLG_CZECHTYPES,
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,
2341 "slovak",
2342 FLG_SLOVAK,
2343 "slovak naming convention violated",
2344 "Name is not consistent with Slovak naming convention.", 0, 0
2347 FK_NAMES, FK_ABSTRACT, plainFlag, ARG_NONE,
2348 "slovakfcns",
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,
2355 "slovakmacros",
2356 FLG_SLOVAKMACROS,
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,
2362 "slovakvars",
2363 FLG_SLOVAKVARS,
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,
2369 "slovakconsts",
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,
2376 "slovaktypes",
2377 FLG_SLOVAKTYPES,
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,
2386 "czechoslovak",
2387 FLG_CZECHOSLOVAK,
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,
2393 "czechoslovakfcns",
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,
2407 "czechoslovakvars",
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,
2432 "macrovarprefix",
2433 FLG_MACROVARPREFIX,
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.",
2436 0, 0
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.",
2444 0, 0
2447 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2448 "tagprefix",
2449 FLG_TAGPREFIX,
2450 "set namespace prefix for struct, union and enum tags",
2451 "A tag identifier does not start with the tagprefix.",
2452 0, 0
2455 FK_NAMES, FK_PREFIX, plainFlag, ARG_NONE,
2456 "tagprefixexclude",
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.",
2460 0, 0
2463 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2464 "enumprefix",
2465 FLG_ENUMPREFIX,
2466 "set namespace prefix for enum members",
2467 "An enum member does not start with the enumprefix.",
2468 0, 0
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.",
2476 0, 0
2479 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2480 "filestaticprefix",
2481 FLG_FILESTATICPREFIX,
2482 "set namespace prefix for file static declarations",
2483 "A file-static identifier does not start with the filestaticprefix.",
2484 0, 0
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.",
2492 0, 0
2495 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2496 "globalprefix",
2497 FLG_GLOBPREFIX,
2498 "set namespace prefix for global variables",
2499 "A global variable does not start with the globalprefix",
2500 0, 0
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.",
2508 0, 0
2511 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2512 "typeprefix",
2513 FLG_TYPEPREFIX,
2514 "set namespace prefix for user-defined types",
2515 "A user-defined type does not start with the typeprefix",
2516 0, 0
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.",
2524 0, 0
2527 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2528 "externalprefix",
2529 FLG_EXTERNALPREFIX,
2530 "set namespace prefix for external identifiers",
2531 "An external identifier does not start with the externalprefix",
2532 0, 0
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.",
2540 0, 0
2543 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2544 "localprefix",
2545 FLG_LOCALPREFIX,
2546 "set namespace prefix for local variables",
2547 "A local variable does not start with the localprefix",
2548 0, 0
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.",
2556 0, 0
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",
2564 0, 0
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 "
2571 "unchecked macros",
2572 "An identifier that is not the name of an unchecked macro "
2573 "starts with the uncheckedmacroprefix.",
2574 0, 0
2577 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2578 "constprefix",
2579 FLG_CONSTPREFIX,
2580 "set namespace prefix for constants",
2581 "A constant does not start with the constantprefix",
2582 0, 0
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.",
2590 0, 0
2593 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2594 "iterprefix",
2595 FLG_ITERPREFIX,
2596 "set namespace prefix for iterators",
2597 "An iter does not start with the iterator prefix",
2598 0, 0
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.",
2606 0, 0
2609 FK_NAMES, FK_PREFIX, idemFlag, ARG_STRING,
2610 "protoparamprefix",
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",
2615 0, 0
2618 /* 12.3 Naming Restrictions */
2620 FK_NAMES, FK_ANSI, modeFlag, ARG_NONE,
2621 "isoreserved",
2622 FLG_ISORESERVED,
2623 "external name conflicts with name reserved for system or standard library",
2624 "External name is reserved for system use by ISO C99 standard.",
2625 0, 0
2628 FK_NAMES, FK_ANSI, modeFlag, ARG_NONE,
2629 "cppnames",
2630 FLG_CPPNAMES,
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.",
2635 0, 0
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).",
2643 0, 0
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.",
2659 0, 0
2662 FK_NAMES, FK_ANSI, specialFlag, ARG_NUMBER,
2663 "externalnamelen",
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.",
2669 0, 0
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.",
2680 0, 0
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 "
2696 "non-distinct.",
2697 0, 0
2700 FK_NAMES, FK_ANSI, specialFlag, ARG_NUMBER,
2701 "internalnamelen",
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.",
2706 0, 0
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.",
2719 0, 0
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.",
2728 0, 0
2731 FK_NAMES, FK_PREFIX, modeFlag, ARG_NONE,
2732 "protoparamname",
2733 FLG_DECLPARAMNAME,
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.",
2737 0, 0
2740 FK_NAMES, FK_PREFIX, modeFlag, ARG_NONE,
2741 "protoparammatch",
2742 FLG_DECLPARAMMATCH,
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",
2748 0, 0
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.",
2757 0, 0
2761 ** 13. Completeness
2764 /* 13.1 Unused Declarations */
2767 FK_USE, FK_COMPLETE, modeFlag, ARG_NONE,
2768 "topuse",
2769 FLG_TOPUNUSED,
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,
2775 "exportlocal",
2776 FLG_EXPORTLOCAL,
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.",
2780 0, 0
2783 FK_USE, FK_EXPORT, modeFlag, ARG_NONE,
2784 "exportheader",
2785 FLG_EXPORTHEADER,
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.",
2788 0, 0
2791 FK_USE, FK_EXPORT, modeFlag, ARG_NONE,
2792 "exportheadervar",
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.)",
2797 0, 0
2800 FK_USE, FK_NONE, modeFlag, ARG_NONE,
2801 "fielduse",
2802 FLG_FIELDUNUSED,
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.",
2805 0, 0
2808 FK_USE, FK_NONE, modeFlag, ARG_NONE,
2809 "enummemuse",
2810 FLG_ENUMMEMUNUSED,
2811 "member of an enum type not used",
2812 "A member of an enum type is never used.",
2813 0, 0
2816 FK_USE, FK_NONE, modeFlag, ARG_NONE,
2817 "constuse",
2818 FLG_CONSTUNUSED,
2819 "constant declared but not used",
2820 "A constant is declared but not used. Use unused in the constant declaration to suppress message.",
2821 0, 0
2824 FK_USE, FK_NONE, modeFlag, ARG_NONE,
2825 "fcnuse",
2826 FLG_FUNCUNUSED,
2827 "function declared but not used",
2828 "A function is declared but not used. Use /*@unused@*/ in front of function header to suppress message.",
2829 0, 0
2832 FK_USE, FK_PARAMS, modeFlag, ARG_NONE,
2833 "paramuse",
2834 FLG_PARAMUNUSED,
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.",
2837 0, 0
2840 FK_USE, FK_TYPE, modeFlag, ARG_NONE,
2841 "typeuse",
2842 FLG_TYPEUNUSED,
2843 "type declared but not used",
2844 "A type is declared but not used. Use /*@unused@*/ in front of typedef to suppress messages.",
2845 0, 0
2848 FK_USE, FK_NONE, modeFlag, ARG_NONE,
2849 "varuse",
2850 FLG_VARUNUSED,
2851 "variable declared but not used",
2852 "A variable is declared but never used. Use /*@unused@*/ in front "
2853 "of declaration to suppress message.",
2854 0, 0
2857 FK_USE, FK_COMPLETE, modeFlag, ARG_NONE,
2858 "unusedspecial",
2859 FLG_UNUSEDSPECIAL,
2860 "unused declaration in special file (corresponding to .l or .y file)",
2861 NULL, 0, 0
2864 /* 13.2 Complete Programs */
2867 FK_COMPLETE, FK_NONE, modeFlag, ARG_NONE,
2868 "declundef",
2869 FLG_DECLUNDEF,
2870 "function or variable declared but never defined",
2871 "A function or variable is declared, but not defined in any source code file.",
2872 0, 0
2875 FK_COMPLETE, FK_SPEC, modeFlag, ARG_NONE,
2876 "specundef",
2877 FLG_SPECUNDEF,
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.",
2880 0, 0
2883 FK_COMPLETE, FK_SPEC, plainFlag, ARG_NONE,
2884 "specundecl",
2885 FLG_SPECUNDECL,
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.",
2889 0, 0
2892 FK_DECL, FK_LIBS, plainFlag, ARG_NONE,
2893 "newdecl",
2894 FLG_NEWDECL,
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.)",
2899 0, 0
2902 FK_INIT, FK_SPEC, plainFlag, ARG_NONE,
2903 "needspec",
2904 FLG_NEEDSPEC,
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.",
2911 0, 0
2915 ** 14. Libraries and Header File Inclusion
2918 /* 14.1 Standard Libraries */
2921 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2922 "nolib",
2923 FLG_NOLIB,
2924 "do not load standard library",
2925 NULL, 0, 0
2928 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2929 "standardlib",
2930 FLG_STDLIB,
2931 "use normal standard library",
2932 "Library based on the ISO standard library specification is used.",
2933 0, 0
2936 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2937 "standardstrictlib",
2938 FLG_STDSTRICTLIB,
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.)",
2942 0, 0
2945 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2946 "unixlib",
2947 FLG_UNIXLIB,
2948 "use UNIX (sort-of) standard library",
2949 "UNIX version of the standard library is used.",
2950 0, 0
2953 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2954 "unixstrictlib",
2955 FLG_UNIXSTRICTLIB,
2956 "use strict version of UNIX (sort-of) library",
2957 "strict version of the UNIX library is used.",
2958 0, 0
2961 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2962 "posixlib",
2963 FLG_POSIXLIB,
2964 "use POSIX standard library",
2965 "POSIX version of the standard library is used.",
2966 0, 0
2969 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2970 "posixstrictlib",
2971 FLG_POSIXSTRICTLIB,
2972 "use strict POSIX standard library",
2973 "POSIX version of the strict standard library is used.",
2974 0, 0
2977 FK_LIBS, FK_INIT, idemGlobalFlag, ARG_NONE,
2978 "whichlib",
2979 FLG_WHICHLIB,
2980 "show standard library filename",
2981 NULL, 0, 0
2984 FK_LIBS, FK_ANSI, plainFlag, ARG_NONE,
2985 "warnposixheaders",
2986 FLG_WARNPOSIX,
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.",
2989 0, 0
2992 FK_LIBS, FK_ANSI, plainFlag, ARG_NONE,
2993 "warnunixlib",
2994 FLG_WARNUNIXLIB,
2995 "warn when the unix library is used",
2996 "Unix library may not be compatible with all platforms",
2997 0, 0
3000 FK_LIBS, FK_ANSI, plainFlag, ARG_NONE,
3001 "usevarargs",
3002 FLG_USEVARARGS,
3003 "non-standard <varargs.h> included",
3004 "Header <varargs.h> is not part of ANSI Standard. "
3005 "Should use <stdarg.h> instead.",
3006 0, 0
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)",
3013 NULL, 0, 0
3016 /* 14.2 Generating Libraries */
3019 FK_LIBS, FK_FILES, globalFlag, ARG_FILE,
3020 "dump",
3021 FLG_DUMP,
3022 "save state for merging (default suffix .lcd)",
3023 NULL, 0, 0
3026 FK_LIBS, FK_FILES, globalFlag, ARG_FILE,
3027 "load",
3028 FLG_MERGE,
3029 "load state from dump file (default suffix .lcd)",
3030 NULL, 0, 0
3033 /* 14.3 Header File Inclusion */
3036 FK_HEADERS, FK_SPEED, globalFlag, ARG_NONE,
3037 "singleinclude",
3038 FLG_SINGLEINCLUDE,
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.)",
3045 0, 0
3048 FK_HEADERS, FK_SPEED, globalFlag, ARG_NONE,
3049 "neverinclude",
3050 FLG_NEVERINCLUDE,
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.",
3054 0, 0
3057 FK_HEADERS, FK_SPEED, globalFlag, ARG_NONE,
3058 "skipsysheaders",
3059 FLG_SKIPSYSHEADERS,
3060 "do not include header files in system directories (set by -sysdirs)",
3061 "Do not include header files in system directories (set by -sysdirs)",
3062 0, 0
3066 ** A. Operation?
3071 ** Syntax
3075 FK_SYNTAX, FK_ANSI, plainFlag, ARG_NONE,
3076 "gnuextensions",
3077 FLG_GNUEXTENSIONS,
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
3083 /* Prototypes */
3086 FK_PROTOS, FK_ANSI, modeFlag, ARG_NONE,
3087 "noparams",
3088 FLG_NOPARAMS,
3089 "function declaration has no parameter list",
3090 "A function declaration does not have a parameter list.",
3091 0, 0
3094 FK_PROTOS, FK_ANSI, modeFlag, ARG_NONE,
3095 "oldstyle",
3096 FLG_OLDSTYLE,
3097 "old style function definition",
3098 "Function definition is in old style syntax. Standard prototype "
3099 "syntax is preferred.",
3100 0, 0
3105 ** System functions
3109 FK_SYSTEMFUNCTIONS, FK_TYPE, plainFlag, ARG_NONE,
3110 "maintype",
3111 FLG_MAINTYPE,
3112 "type of main does not match expected type",
3113 "The function main does not match the expected type.",
3114 0, 0
3117 FK_SYSTEMFUNCTIONS, FK_BEHAVIOR, modeFlag, ARG_NONE,
3118 "exitarg",
3119 FLG_EXITARG,
3120 "argument to exit has implementation defined behavior",
3121 "The argument to exit should be 0, EXIT_SUCCESS or EXIT_FAILURE",
3122 0, 0
3126 FK_DECL, FK_NONE, modeFlag, ARG_NONE,
3127 "shadow",
3128 FLG_SHADOW,
3129 "declaration reuses name visible in outer scope",
3130 "An outer declaration is shadowed by the local declaration.",
3131 0, 0
3134 FK_DECL, FK_LIBS, modeFlag, ARG_NONE,
3135 "incondefslib",
3136 FLG_INCONDEFSLIB,
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.",
3140 0, 0
3143 FK_DECL, FK_LIBS, modeFlag, ARG_NONE,
3144 "overload",
3145 FLG_WARNOVERLOAD,
3146 "library function overloaded",
3147 "A function, variable or constant defined in the library is redefined "
3148 "with a different type.",
3149 0, 0
3152 FK_DECL, FK_NONE, modeFlag, ARG_NONE,
3153 "nestedextern",
3154 FLG_NESTEDEXTERN,
3155 "an extern declaration is inside a function scope",
3156 "An extern declaration is used inside a function scope.",
3157 0, 0
3160 FK_DECL, FK_NONE, modeFlag, ARG_NONE,
3161 "redecl",
3162 FLG_REDECL,
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.",
3166 0, 0
3169 FK_DECL, FK_NONE, plainFlag, ARG_NONE,
3170 "redef",
3171 FLG_REDEF,
3172 "function or variable redefined",
3173 "A function or variable is redefined. One of the declarations should use extern.",
3174 0, 0
3177 FK_DECL, FK_TYPE, modeFlag, ARG_NONE,
3178 "imptype",
3179 FLG_IMPTYPE,
3180 "variable declaration has unknown (implicitly int) type",
3181 "A variable declaration has no explicit type. The type is implicitly int.",
3182 0, 0
3186 FK_DIRECT, FK_FILES, globalFlag, ARG_DIRECTORY,
3187 "tmpdir",
3188 FLG_TMPDIR,
3189 "set directory for writing temp files",
3190 NULL, 0, 0
3193 FK_DIRECT, FK_FILES, globalFlag, ARG_PATH,
3194 "larchpath",
3195 FLG_LARCHPATH,
3196 "set path for searching for library files (overrides LARCH_PATH environment variable)",
3197 NULL, 0, 0
3200 FK_DIRECT, FK_FILES, globalFlag, ARG_DIRECTORY,
3201 "lclimportdir",
3202 FLG_LCLIMPORTDIR,
3203 "set directory to search for LCL import files (overrides LCLIMPORTDIR)",
3204 NULL, 0, 0
3207 FK_DIRECT, FK_FILES, globalFlag, ARG_PATH,
3208 "sysdirs",
3209 FLG_SYSTEMDIRS,
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.",
3215 NULL, 0, 0
3218 FK_DIRECT, FK_FILES, plainFlag, ARG_NONE,
3219 "skipstdheaders",
3220 FLG_SKIPSTDHEADERS,
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 "
3228 "and wctype.",
3229 NULL, 0, 0
3232 FK_DIRECT, FK_FILES, plainFlag, ARG_NONE,
3233 "skipposixheaders",
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.",
3241 NULL, 0, 0
3244 FK_DIRECT, FK_SUPPRESS, modeFlag, ARG_NONE,
3245 "sysdirerrors",
3246 FLG_SYSTEMDIRERRORS,
3247 "report errors in files in system directories (set by -sysdirs)",
3248 NULL, 0, 0
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",
3256 NULL, 0, 0
3260 FK_DIRECT, FK_HEADERS, globalFlag, ARG_SPECIAL,
3261 "I<directory>",
3262 FLG_INCLUDEPATH,
3263 "add to C include path",
3264 NULL, 0, 0
3267 FK_DIRECT, FK_SPEC, globalFlag, ARG_SPECIAL,
3268 "S<directory>",
3269 FLG_SPECPATH,
3270 "add to spec path",
3271 NULL, 0, 0
3274 FK_EXPORT, FK_SPEC, specialFlag, ARG_NONE,
3275 "exportany",
3276 FLG_EXPORTANY,
3277 "variable, function or type exported but not specified",
3278 "A variable, function or type is exported, but not specified.",
3279 0, 0
3282 FK_EXPORT, FK_SPEC, modeFlag, ARG_NONE,
3283 "exportfcn",
3284 FLG_EXPORTFCN,
3285 "function exported but not specified",
3286 "A function is exported, but not specified.", 0, 0
3289 FK_EXPORT, FK_SPEC, modeFlag, ARG_NONE,
3290 "exportmacro",
3291 FLG_EXPORTMACRO,
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,
3297 "exporttype",
3298 FLG_EXPORTTYPE,
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,
3304 "exportvar",
3305 FLG_EXPORTVAR,
3306 "variable exported but not specified",
3307 "A variable is exported, but not specified.", 0, 0
3310 FK_EXPORT, FK_SPEC, modeFlag, ARG_NONE,
3311 "exportconst",
3312 FLG_EXPORTCONST,
3313 "constant exported but not specified",
3314 "A constant is exported, but not specified.", 0, 0
3317 FK_EXPORT, FK_SPEC, modeFlag, ARG_NONE,
3318 "exportiter",
3319 FLG_EXPORTITER,
3320 "constant exported but not specified",
3321 "A constant is exported, but not specified.", 0, 0
3325 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NUMBER,
3326 "linelen",
3327 FLG_LINELEN,
3328 "set length of messages (number of chars)",
3329 NULL, 0, 0
3332 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NUMBER,
3333 "indentspaces",
3334 FLG_INDENTSPACES,
3335 "set number of spaces to indent sub-messages",
3336 NULL, 0, 0
3339 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NUMBER,
3340 "locindentspaces",
3341 FLG_LOCINDENTSPACES,
3342 "set number of spaces to indent sub-messages that start with file locations",
3343 NULL, 0, 0
3346 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NONE,
3347 "showdeephistory",
3348 FLG_SHOWDEEPHISTORY,
3349 "show all available information about storage mentioned in warnings",
3350 NULL, 0, 0
3353 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NONE,
3354 "showcolumn",
3355 FLG_SHOWCOL,
3356 "show column number where error is found",
3357 NULL, 0, 0
3360 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NONE,
3361 "showloadloc",
3362 FLG_SHOWLOADLOC,
3363 "show location information for load files",
3364 NULL, 0, 0
3367 FK_FORMAT, FK_DISPLAY, idemGlobalFlag, ARG_FILE,
3368 "csv",
3369 FLG_CSV,
3370 "produce comma-separated values (CSV) warnings output file",
3371 NULL, 0, 0
3374 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NONE,
3375 "csvoverwrite",
3376 FLG_CSVOVERWRITE,
3377 "overwrite exisiting CVS output file",
3378 NULL, 0, 0
3381 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NONE,
3382 "parenfileformat",
3383 FLG_PARENFILEFORMAT,
3384 "show column number where error is found",
3385 NULL, 0, 0
3388 FK_FORMAT, FK_DISPLAY, plainFlag, ARG_NONE,
3389 "htmlfileformat",
3390 FLG_HTMLFILEFORMAT,
3391 "show file locations as links",
3392 NULL, 0, 0
3395 FK_FORMAT, FK_NONE, plainFlag, ARG_NONE,
3396 "showfunc",
3397 FLG_SHOWFUNC,
3398 "show name of function containing error",
3399 NULL, 0, 0
3402 FK_FORMAT, FK_NONE, plainFlag, ARG_NONE,
3403 "showallconjs",
3404 FLG_SHOWALLCONJS,
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.",
3408 0, 0
3411 FK_LIBS, FK_NONE, plainFlag, ARG_NONE,
3412 "impconj",
3413 FLG_IMPCONJ,
3414 "make all alternate types implicit (useful for making system libraries",
3415 NULL, 0, 0
3418 FK_GLOBAL, FK_ERRORS, globalFlag, ARG_NUMBER,
3419 "expect",
3420 FLG_EXPECT,
3421 "expect <int> code errors",
3422 NULL, 0, 0
3425 FK_GLOBAL, FK_ERRORS, globalFlag, ARG_NUMBER,
3426 "lclexpect",
3427 FLG_LCLEXPECT,
3428 "expect <int> spec errors",
3429 NULL, 0, 0
3432 FK_GLOBAL, FK_USE, idemSpecialFlag, ARG_NONE,
3433 "partial",
3434 FLG_PARTIAL,
3435 "check as partial system (-specundef, -declundef, -exportlocal, "
3436 "don't check macros in headers without corresponding .c files)",
3437 NULL, 0, 0
3441 ** Appendix D. Specifications
3445 FK_HEADERS, FK_SPEC, globalFlag, ARG_NONE,
3446 "lh",
3447 FLG_DOLH,
3448 "generate .lh files", NULL,
3449 0, 0
3452 FK_HEADERS, FK_SPEC, globalFlag, ARG_NONE,
3453 "lcs",
3454 FLG_DOLCS,
3455 "generate .lcs files", NULL,
3456 0, 0
3460 ** 1. Operation
3464 FK_HELP, FK_NONE, plainFlag, ARG_NONE,
3465 "warnflags",
3466 FLG_WARNFLAGS,
3467 "warn when command line sets flag in abnormal way",
3468 "Command line sets flag in abnormal way",
3469 0, 0
3472 FK_HELP, FK_NONE, plainFlag, ARG_NONE,
3473 "warnrc",
3474 FLG_WARNRC,
3475 "warn when there are problems with reading the initialization files",
3476 "There was a problem reading an initialization file",
3477 0, 0
3480 FK_HELP, FK_NONE, plainFlag, ARG_NONE,
3481 "badflag",
3482 FLG_BADFLAG,
3483 "warn about bad command line flags",
3484 "A flag is not recognized or used in an incorrect way",
3485 0, 0
3488 FK_HELP, FK_NONE, plainFlag, ARG_NONE,
3489 "fileextensions",
3490 FLG_FILEEXTENSIONS,
3491 "warn when command line file does not have a recognized extension",
3492 NULL, 0, 0
3495 FK_HELP, FK_NONE, globalFlag, ARG_SPECIAL,
3496 "help",
3497 FLG_HELP,
3498 "-help <flags> will describe flags",
3499 "Display help",
3500 0, 0
3503 FK_INIT, FK_FILES, idemGlobalFlag, ARG_FILE,
3504 "f",
3505 FLG_OPTF,
3506 "read an options file (default ~/.splintrc not loaded)",
3507 "Read an options file (instead of loading default ~/.splintc)",
3508 0, 0
3511 FK_INIT, FK_FILES, idemGlobalFlag, ARG_FILE,
3512 "i",
3513 FLG_INIT,
3514 "set LCL initilization file",
3515 NULL, 0, 0
3518 FK_INIT, FK_FILES, globalFlag, ARG_NONE,
3519 "nof",
3520 FLG_NOF,
3521 "do not read options file",
3522 "Do not read the default options file (~/.splintrc)",
3523 0, 0
3526 FK_INIT, FK_COMMENTS, plainFlag, ARG_CHAR,
3527 "commentchar",
3528 FLG_COMMENTCHAR,
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.",
3533 0, 0
3537 ** Limits
3541 FK_LIMITS, FK_ANSI, modeFlag, ARG_NUMBER,
3542 "controlnestdepth",
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.",
3547 0, 0
3550 FK_LIMITS, FK_ANSI, modeFlag, ARG_NUMBER,
3551 "stringliterallen",
3552 FLG_STRINGLITERALLEN,
3553 "set maximum length of string literals (ANSI89 minimum is 509; ISO99 is 4095)",
3554 "Maximum length of string literal exceeded.",
3555 0, 0
3558 FK_LIMITS, FK_ANSI, modeFlag, ARG_NUMBER,
3559 "numstructfields",
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.",
3563 0, 0
3566 FK_LIMITS, FK_ANSI, modeFlag, ARG_NUMBER,
3567 "numenummembers",
3568 FLG_NUMENUMMEMBERS,
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.",
3571 0, 0
3574 FK_LIMITS, FK_ANSI, modeFlag, ARG_NUMBER,
3575 "includenest",
3576 FLG_INCLUDENEST,
3577 "set maximum number of nested #include files (ANSI89 minimum is 8; ISO99 is 63)",
3578 "Maximum number of nested #include files exceeded.",
3579 0, 0
3582 FK_LIMITS, FK_ANSI, specialFlag, ARG_NONE,
3583 "ansi89limits",
3584 FLG_ANSI89LIMITS,
3585 "check for violations of standard limits (controlnestdepth, "
3586 "stringliterallen, includenest, numstructfields, numenummembers) based on ANSI89 standard",
3587 NULL,
3588 0, 0
3591 FK_LIMITS, FK_ANSI, specialFlag, ARG_NONE,
3592 "iso99limits",
3593 FLG_ISO99LIMITS,
3594 "check for violations of standard limits (controlnestdepth, "
3595 "stringliterallen, includenest, numstructfields, numenummembers) based on ISO99 standard",
3596 NULL,
3597 0, 0
3601 FK_PREPROC, FK_NONE, globalFlag, ARG_SPECIAL,
3602 "D<initializer>",
3603 FLG_DEFINE,
3604 "passed to pre-processor",
3605 NULL, 0, 0
3608 FK_PREPROC, FK_NONE, globalFlag, ARG_SPECIAL,
3609 "U<initializer>",
3610 FLG_UNDEFINE,
3611 "passed to pre-processor",
3612 NULL, 0, 0
3615 FK_PREPROC, FK_SYNTAX, plainFlag, ARG_NONE,
3616 "unrecogdirective",
3617 FLG_UNRECOGDIRECTIVE,
3618 "unrecognized pre-processor directive",
3619 "Pre-processor directive is not recognized.",
3620 0, 0
3623 FK_SUPPRESS, FK_COMMENTS, globalFlag, ARG_NONE,
3624 "supcounts",
3625 FLG_SUPCOUNTS,
3626 "The number of errors detected does not match number in /*@i<n>@*/.",
3627 NULL, 0, 0
3630 FK_SUPPRESS, FK_ERRORS, plainFlag, ARG_NUMBER,
3631 "limit",
3632 FLG_LIMIT,
3633 "limit <int> consecutive repeated errors",
3634 NULL, 0, 0
3637 FK_SYNTAX, FK_NONE, plainFlag, ARG_NONE,
3638 "syntax",
3639 FLG_SYNTAX,
3640 "syntax error in parsing",
3641 "Code cannot be parsed. For help on parse errors, see splint -help parseerrors.",
3642 0, 0
3645 FK_SYNTAX, FK_NONE, plainFlag, ARG_NONE,
3646 "trytorecover",
3647 FLG_TRYTORECOVER,
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,
3653 "preproc",
3654 FLG_PREPROC,
3655 "preprocessing error",
3656 "Preprocessing error.",
3657 0, 0
3661 FK_TYPE, FK_NONE, plainFlag, ARG_NONE,
3662 "type",
3663 FLG_TYPE,
3664 "type mismatch",
3665 "Types are incompatible.",
3666 0, 0
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.",
3675 0, 0
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",
3683 0, 0
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.",
3691 0, 0
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.",
3699 0, 0
3702 FK_TYPE, FK_NONE, modeFlag, ARG_NONE,
3703 "enummembers",
3704 FLG_ENUMMEMBERS,
3705 "enum members must be int values",
3706 "Type of initial values for enum members must be int.",
3707 0, 0
3711 FK_TYPE, FK_NONE, plainFlag, ARG_NONE,
3712 "formattype",
3713 FLG_FORMATTYPE,
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.",
3716 0, 0
3719 FK_TYPE, FK_NONE, modeFlag, ARG_NONE,
3720 "formatconst",
3721 FLG_FORMATCONST,
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.",
3724 0, 0
3727 FK_TYPE, FK_NONE, plainFlag, ARG_NONE,
3728 "formatcode",
3729 FLG_FORMATCODE,
3730 "invalid format code in format string for printf or scanf-like function",
3731 "Format code in a format string is not valid.",
3732 0, 0
3735 FK_TYPEEQ, FK_ABSTRACT, modeFlag, ARG_NONE,
3736 "forwarddecl",
3737 FLG_FORWARDDECL,
3738 "forward declarations of pointers to abstract representation match abstract type",
3739 NULL, 0, 0
3742 FK_TYPEEQ, FK_ABSTRACT, modeFlag, ARG_NONE,
3743 "voidabstract",
3744 FLG_ABSTVOIDP,
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).",
3747 0, 0
3750 FK_TYPEEQ, FK_POINTER, plainFlag, ARG_NONE,
3751 "castfcnptr",
3752 FLG_CASTFCNPTR,
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).",
3755 0, 0
3758 FK_TYPEEQ, FK_ARRAY, modeFlag, ARG_NONE,
3759 "charindex",
3760 FLG_CHARINDEX,
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,
3766 "enumindex",
3767 FLG_ENUMINDEX,
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,
3773 "boolint",
3774 FLG_BOOLINT,
3775 "bool and int are equivalent",
3776 "To make bool and int types equivalent, use +boolint.",
3777 0, 0
3780 FK_TYPEEQ, FK_NONE, modeFlag, ARG_NONE,
3781 "charint",
3782 FLG_CHARINT,
3783 "char and int are equivalent",
3784 "To make char and int types equivalent, use +charint.",
3785 0, 0
3788 FK_TYPEEQ, FK_NONE, modeFlag, ARG_NONE,
3789 "enumint",
3790 FLG_ENUMINT,
3791 "enum and int are equivalent",
3792 "To make enum and int types equivalent, use +enumint.",
3793 0, 0
3796 FK_TYPEEQ, FK_NONE, modeFlag, ARG_NONE,
3797 "longint",
3798 FLG_LONGINT,
3799 "long int and int are equivalent",
3800 "To make long int and int types equivalent, use +longint.",
3801 0, 0
3804 FK_TYPEEQ, FK_NONE, modeFlag, ARG_NONE,
3805 "shortint",
3806 FLG_SHORTINT,
3807 "short int and int are equivalent",
3808 "To make short int and int types equivalent, use +shortint.",
3809 0, 0
3812 FK_TYPEEQ, FK_NONE, modeFlag, ARG_NONE,
3813 "floatdouble",
3814 FLG_FLOATDOUBLE,
3815 "float and double are equivalent",
3816 "To make float and double types equivalent, use +floatdouble.",
3817 0, 0
3820 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3821 "ignorequals",
3822 FLG_IGNOREQUALS,
3823 "ignore type qualifiers (long, short, unsigned)",
3824 "To ignore type qualifiers in type comparisons use +ignorequals.",
3825 0, 0
3828 FK_TYPEEQ, FK_SYNTAX, plainFlag, ARG_NONE,
3829 "duplicatequals",
3830 FLG_DUPLICATEQUALS,
3831 "report duplicate type qualifiers (e.g., unsigned unsigned)",
3832 "Duplicate type qualifiers not supported by ISO standard.",
3833 0, 0
3836 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3837 "ignoresigns",
3838 FLG_IGNORESIGNS,
3839 "ignore signs in type comparisons (unsigned matches signed)",
3840 "To ignore signs in type comparisons use +ignoresigns",
3841 0, 0
3844 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3845 "numliteral",
3846 FLG_NUMLITERAL,
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.",
3850 0, 0
3853 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3854 "charintliteral",
3855 FLG_CHARINTLITERAL,
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.)",
3860 0, 0
3863 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3864 "relaxquals",
3865 FLG_RELAXQUALS,
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,
3871 "relaxtypes",
3872 FLG_RELAXTYPES,
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,
3878 "charunsignedchar",
3879 FLG_CHARUNSIGNEDCHAR,
3880 "allow char and unsigned char types to match",
3881 "To allow char and unsigned char types to match use +charunsignedchar.",
3882 0, 0
3885 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3886 "matchanyintegral",
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.",
3890 0, 0
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.",
3898 0, 0
3901 FK_TYPEEQ, FK_NUMBERS, modeFlag, ARG_NONE,
3902 "longintegral",
3903 FLG_LONGINTEGRAL,
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.",
3906 0, 0
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.",
3915 0, 0
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.",
3923 0, 0
3926 FK_TYPEEQ, FK_POINTER, plainFlag, ARG_NONE,
3927 "zeroptr",
3928 FLG_ZEROPTR,
3929 "treat 0 as a pointer",
3930 NULL, 0, 0
3933 FK_TYPEEQ, FK_BOOL, modeFlag, ARG_NONE,
3934 "zerobool",
3935 FLG_ZEROBOOL,
3936 "treat 0 as a boolean",
3937 NULL, 0, 0
3940 FK_UNRECOG, FK_DISPLAY, plainFlag, ARG_NONE,
3941 "repeatunrecog",
3942 FLG_REPEATUNRECOG,
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.)",
3945 0, 0
3948 FK_UNRECOG, FK_DISPLAY, plainFlag, ARG_NONE,
3949 "sysunrecog",
3950 FLG_SYSTEMUNRECOG,
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.",
3955 0, 0
3958 FK_UNRECOG, FK_NONE, plainFlag, ARG_NONE,
3959 "unrecog",
3960 FLG_UNRECOG,
3961 "unrecognized identifier",
3962 "Identifier used in code has not been declared.", 0, 0
3967 FK_DECL, FK_TYPE, plainFlag, ARG_NONE,
3968 "annotationerror",
3969 FLG_ANNOTATIONERROR,
3970 "annotation is used in inconsistent location",
3971 "A declaration uses an invalid annotation.",
3972 0, 0
3975 FK_DECL, FK_TYPE, plainFlag, ARG_NONE,
3976 "commenterror",
3977 FLG_COMMENTERROR,
3978 "inconsistent syntactic comment",
3979 "A syntactic comment is used inconsistently.",
3980 0, 0
3984 ** Use Warnings
3988 FK_WARNUSE, FK_NONE, plainFlag, ARG_NONE,
3989 "warnuse",
3990 FLG_WARNUSE,
3991 "warn when declaration marked with warn is used",
3992 "Declaration marked with warn clause is used (can be suppresed by more specific flags).",
3993 0, 0
3996 FK_WARNUSE, FK_SECURITY, modeFlag, ARG_NONE,
3997 "bufferoverflow",
3998 FLG_BUFFEROVERFLOW,
3999 "possible buffer overflow vulnerability",
4000 "Use of function that may lead to buffer overflow.",
4001 0, 0
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.",
4009 0, 0
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.",
4017 0, 0
4020 FK_WARNUSE, FK_NONE, modeFlag, ARG_NONE,
4021 "legacy",
4022 FLG_LEGACY,
4023 "legacy declaration in Unix Standard",
4024 "Use of a declarator that is marked as a legacy entry in the Unix Standard.",
4025 0, 0
4028 FK_WARNUSE, FK_SECURITY, modeFlag, ARG_NONE,
4029 "multithreaded",
4030 FLG_MULTITHREADED,
4031 "function is not reentrant",
4032 "Non-reentrant function should not be used in multithreaded code.",
4033 0, 0
4036 FK_WARNUSE, FK_SECURITY, modeFlag, ARG_NONE,
4037 "portability",
4038 FLG_PORTABILITY,
4039 "function may have undefined behavior",
4040 "Use of function that may have implementation-dependent behavior.",
4041 0, 0
4044 FK_WARNUSE, FK_SECURITY, modeFlag, ARG_NONE,
4045 "superuser",
4046 FLG_SUPERUSER,
4047 "function is restricted to superusers",
4048 "Call to function restricted to superusers.",
4049 0, 0
4052 FK_WARNUSE, FK_SECURITY, modeFlag, ARG_NONE,
4053 "toctou",
4054 FLG_TOCTOU,
4055 "possible time of check, time of use vulnerability",
4056 "Possible time of check, time of use vulnerability.",
4057 0, 0
4060 FK_WARNUSE, FK_SECURITY, modeFlag, ARG_NONE,
4061 "unixstandard",
4062 FLG_UNIXSTANDARD,
4063 "function is not required in Standard UNIX Specification",
4064 "Use of function that need not be provided by UNIX implementations",
4065 0, 0
4069 ** ITS4 Compability Flags
4071 ** These flags flags must appear in order (most severe -> weakest).
4075 FK_ITS4, FK_SECURITY, specialFlag, ARG_NONE,
4076 "its4mostrisky",
4077 FLG_ITS4MOSTRISKY,
4078 "most risky security vulnerabilities (from its4 database)",
4079 "Security vulnerability classified as most risky in its4 database.",
4080 0, 0
4083 FK_ITS4, FK_SECURITY, specialFlag, ARG_NONE,
4084 "its4veryrisky",
4085 FLG_ITS4VERYRISKY,
4086 "very risky security vulnerabilities (from its4 database)",
4087 "Security vulnerability classified as very risky in its4 database.",
4088 0, 0
4091 FK_ITS4, FK_SECURITY, specialFlag, ARG_NONE,
4092 "its4risky",
4093 FLG_ITS4RISKY,
4094 "risky security vulnerabilities (from its4 database)",
4095 "Security vulnerability classified as risky in its4 database.",
4096 0, 0
4099 FK_ITS4, FK_SECURITY, specialFlag, ARG_NONE,
4100 "its4moderate",
4101 FLG_ITS4MODERATERISK,
4102 "moderately risky security vulnerabilities (from its4 database)",
4103 "Security vulnerability classified as moderate risk in its4 database.",
4104 0, 0
4107 FK_ITS4, FK_SECURITY, specialFlag, ARG_NONE,
4108 "its4low",
4109 FLG_ITS4LOWRISK,
4110 "risky security vulnerabilities (from its4 database)",
4111 "Security vulnerability classified as risky in its4 database.",
4112 0, 0
4116 ** Syntactic comments
4120 FK_SYNCOMMENTS, FK_SUPPRESS, plainFlag, ARG_NONE,
4121 "nocomments",
4122 FLG_NOCOMMENTS,
4123 "ignore all stylized comments",
4124 NULL, 0, 0
4127 FK_SYNCOMMENTS, FK_ABSTRACT, plainFlag, ARG_NONE,
4128 "noaccess",
4129 FLG_NOACCESS,
4130 "ignore access comments",
4131 NULL, 0, 0
4135 FK_SYNCOMMENTS, FK_SYNTAX, plainFlag, ARG_NONE,
4136 "unrecogcomments",
4137 FLG_UNRECOGCOMMENTS,
4138 "stylized comment is unrecognized",
4139 "Word after a stylized comment marker does not correspond to a "
4140 "stylized comment.",
4141 0, 0
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.",
4149 0, 0
4152 FK_SYNCOMMENTS, FK_SUPPRESS, modeFlag, ARG_NONE,
4153 "tmpcomments",
4154 FLG_TMPCOMMENTS,
4155 "interpret t comments (ignore errors in lines marked with /*@t<n>@*/",
4156 NULL, 0, 0
4159 FK_SYNCOMMENTS, FK_SUPPRESS, plainFlag, ARG_NONE,
4160 "lintcomments",
4161 FLG_LINTCOMMENTS,
4162 "interpret traditional lint comments (/*FALLTHROUGH*/, /*NOTREACHED*/)",
4163 NULL, 0, 0
4166 FK_SYNCOMMENTS, FK_SUPPRESS, modeFlag, ARG_NONE,
4167 "warnlintcomments",
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.",
4174 0, 0
4178 ** Comments
4182 FK_COMMENTS, FK_SYNTAX, plainFlag, ARG_NONE,
4183 "continuecomment",
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.",
4189 0, 0
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.",
4197 0, 0
4200 FK_COMMENTS, FK_SYNTAX, plainFlag, ARG_NONE,
4201 "nestcomment",
4202 FLG_NESTCOMMENT,
4203 "comment begins inside comment",
4204 "A comment open sequence (/*) appears within a comment. This usually "
4205 "means an earlier comment was not closed.",
4206 0, 0
4210 ** Flags for controlling warning message printing.
4213 /* Display */
4216 FK_DISPLAY, FK_ERRORS, plainFlag, ARG_NONE,
4217 "quiet",
4218 FLG_QUIET,
4219 "suppress herald and error count",
4220 NULL, 0, 0
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",
4232 NULL, 0, 0
4235 FK_DISPLAY, FK_ERRORS, idemGlobalFlag, ARG_NONE,
4236 "messagestreamstderr",
4237 FLG_MESSAGESTREAMSTDERR,
4238 "send status messages to standard error stream",
4239 NULL, 0, 0
4242 FK_DISPLAY, FK_ERRORS, globalFlag, ARG_FILE,
4243 "messagestream",
4244 FLG_MESSAGESTREAM,
4245 "send status messages to <file>",
4246 NULL, 0, 0
4250 FK_DISPLAY, FK_ERRORS, idemGlobalFlag, ARG_NONE,
4251 "warningstreamstdout",
4252 FLG_WARNINGSTREAMSTDOUT,
4253 "send warnings to standard output stream",
4254 NULL, 0, 0
4257 FK_DISPLAY, FK_ERRORS, idemGlobalFlag, ARG_NONE,
4258 "warningstreamstderr",
4259 FLG_WARNINGSTREAMSTDERR,
4260 "send warnings to standard error stream",
4261 NULL, 0, 0
4264 FK_DISPLAY, FK_ERRORS, globalFlag, ARG_FILE,
4265 "warningstream",
4266 FLG_WARNINGSTREAM,
4267 "send warnings to <file>",
4268 NULL, 0, 0
4272 FK_DISPLAY, FK_ERRORS, idemGlobalFlag, ARG_NONE,
4273 "errorstreamstdout",
4274 FLG_ERRORSTREAMSTDOUT,
4275 "send fatal errors to standard output stream",
4276 NULL, 0, 0
4279 FK_DISPLAY, FK_ERRORS, idemGlobalFlag, ARG_NONE,
4280 "errorstreamstderr",
4281 FLG_ERRORSTREAMSTDERR,
4282 "send fatal errors to standard error stream",
4283 NULL, 0, 0
4286 FK_DISPLAY, FK_ERRORS, globalFlag, ARG_FILE,
4287 "errorstream",
4288 FLG_ERRORSTREAM,
4289 "send fatal errors to <file>",
4290 NULL, 0, 0
4294 FK_DISPLAY, FK_ERRORS, globalFlag, ARG_NONE,
4295 "streamoverwrite",
4296 FLG_STREAMOVERWRITE,
4297 "warn and exit if a stream output file would overwrite an existing file",
4298 NULL, 0, 0
4303 FK_DISPLAY, FK_ERRORS, plainFlag, ARG_NONE,
4304 "showsummary",
4305 FLG_SHOWSUMMARY,
4306 "show summary of all errors reported and suppressed",
4307 NULL, 0, 0
4310 FK_DISPLAY, FK_FILES, plainFlag, ARG_NONE,
4311 "showscan",
4312 FLG_SHOWSCAN,
4313 "show file names are they are processed",
4314 NULL, 0, 0
4317 FK_DISPLAY, FK_FILES, plainFlag, ARG_NONE,
4318 "warnsysfiles",
4319 FLG_WARNSYSFILES,
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.",
4321 NULL, 0, 0
4324 FK_DISPLAY, FK_NONE, globalFlag, ARG_NONE,
4325 "stats",
4326 FLG_STATS,
4327 "display lines processed and time",
4328 NULL, 0, 0
4331 FK_DISPLAY, FK_NONE, globalFlag, ARG_NONE,
4332 "timedist",
4333 FLG_TIMEDIST,
4334 "display time distribution",
4335 NULL, 0, 0
4338 FK_DISPLAY, FK_USE, globalFlag, ARG_NONE,
4339 "showalluses",
4340 FLG_SHOWUSES,
4341 "show sorted list of uses of all globals",
4342 NULL, 0, 0
4345 /* Hints */
4348 FK_HINTS, FK_FORMAT, plainFlag, ARG_NONE,
4349 "hints",
4350 FLG_HINTS,
4351 "provide a hint the first time a particular warning appears",
4352 "Provide a hint the first time a particular warning appears",
4353 0, 0
4356 FK_HINTS, FK_FORMAT, plainFlag, ARG_NONE,
4357 "forcehints",
4358 FLG_FORCEHINTS,
4359 "provide a hint for every warnings",
4360 "Provide a hint for every warning",
4361 0, 0
4365 ** Flags for debugging
4369 FK_DEBUG, FK_NONE, plainFlag, ARG_NUMBER,
4370 "bugslimit",
4371 FLG_BUGSLIMIT,
4372 "set maximum number of bugs detected before giving up",
4373 NULL, 0, 0
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.",
4381 0, 0
4384 FK_DEBUG, FK_NONE, idemSpecialFlag, ARG_NONE,
4385 "grammar",
4386 FLG_GRAMMAR,
4387 "debug parsing", NULL,
4388 0, 0
4391 FK_DEBUG, FK_NONE, idemFlag, ARG_NONE,
4392 "keep",
4393 FLG_KEEP,
4394 "do not delete temporary files", NULL,
4395 0, 0
4398 FK_DEBUG, FK_NONE, idemFlag, ARG_NONE,
4399 "nopp",
4400 FLG_NOPP,
4401 "do not pre-process input files", NULL,
4402 0, 0
4405 FK_DEBUG, FK_NONE, idemFlag, ARG_NONE,
4406 "showsourceloc",
4407 FLG_SHOWSOURCELOC,
4408 "display the source code location where a warning is produced", NULL,
4409 0, 0