]> andersk Git - splint.git/blame_incremental - src/flags.def
Changes to fix malloc size problem.
[splint.git] / src / flags.def
... / ...
CommitLineData
1/*;-*-C-*-;
2**
3** flags.def
4**
5** This file is used to generate the flag header files.
6**
7** Don't forget to regenerate flag_codes.gen. (lost the Makefile...bleech!)
8*/
9 /* spec idem global mode args */
10/*@-namechecks@*/
11/*@notfunction@*/
12# define modeFlag FALSE, FALSE, FALSE, TRUE, ARG_NONE
13/*@notfunction@*/
14# define plainFlag FALSE, FALSE, FALSE, FALSE, ARG_NONE
15/*@notfunction@*/
16# define specialFlag TRUE, FALSE, FALSE, FALSE, ARG_NONE
17/*@notfunction@*/
18# define plainSpecialFlag TRUE, FALSE, FALSE, FALSE, ARG_NONE
19/*@notfunction@*/
20# define idemSpecialFlag TRUE, TRUE, FALSE, FALSE, ARG_NONE
21/*@notfunction@*/
22# define valueFlag FALSE, FALSE, FALSE, FALSE, ARG_NUMBER
23
24/*@notfunction@*/
25# define charFlag FALSE, FALSE, FALSE, FALSE, ARG_CHAR
26
27/*@notfunction@*/
28# define modeValueFlag FALSE, FALSE, FALSE, TRUE, ARG_NUMBER
29/*@notfunction@*/
30# define specialValueFlag TRUE, FALSE, FALSE, FALSE, ARG_NUMBER
31/*@notfunction@*/
32# define debugFlag FALSE, TRUE, FALSE, FALSE, ARG_NONE
33/*@notfunction@*/
34# define debugValueFlag FALSE, TRUE, FALSE, FALSE, ARG_NUMBER
35/*@notfunction@*/
36# define specialDebugFlag TRUE, TRUE, FALSE, FALSE, ARG_NONE
37/*@notfunction@*/
38# define globalFlag FALSE, FALSE, TRUE, FALSE, ARG_NONE
39/*@notfunction@*/
40# define idemGlobalFlag FALSE, TRUE, TRUE, FALSE, ARG_NONE
41/*@notfunction@*/
42# define globalValueFlag FALSE, FALSE, TRUE, FALSE, ARG_NUMBER
43
44/* Note: type argument missing */
45/*@notfunction@*/
46# define regStringFlag FALSE, FALSE, FALSE, FALSE
47/*@notfunction@*/
48# define idemStringFlag FALSE, TRUE, FALSE, FALSE
49/*@notfunction@*/
50# define globalStringFlag FALSE, FALSE, TRUE, FALSE
51
52/*@notfunction@*/
53# define extraArgFlag FALSE, FALSE, FALSE, FALSE, ARG_SPECIAL
54/*@notfunction@*/
55# define globalExtraArgFlag FALSE, FALSE, TRUE, FALSE, ARG_SPECIAL
56/*@notfunction@*/
57# define globalFileFlag FALSE, TRUE, TRUE, FALSE, ARG_FILE
58/*@=namechecks@*/
59
60/*
61** Note: the flag code must be on a separate line, since I'm
62** too stupid to write an awk/sed/whatever script that can separate
63** the lines.
64*/
65
66static flaglist flags =
67{
68 /*
69 ** Null Dereferences (Manual Section 2)
70 */
71
72 {
73 FK_NULL, FK_MEMORY, specialFlag,
74 "null",
75 FLG_NULL,
76 "misuses of null pointer",
77 "A possibly null pointer is misused (sets nullderef, nullpass, "
78 "nullref, nullassign, and nullstate).",
79 0, 0
80 },
81 {
82 FK_NULL, FK_MEMORY, modeFlag,
83 "nullderef",
84 FLG_NULLDEREF,
85 "possible dereferencce of null pointer",
86 "A possibly null pointer is dereferenced. Value is "
87 "either the result of a function which may return null "
88 "(in which case, code should check it is not null), or a "
89 "global, parameter or structure field declared with the "
90 "null qualifier.",
91 0, 0
92 },
93 {
94 FK_NULL, FK_MEMORY, modeFlag,
95 "nullpass",
96 FLG_NULLPASS,
97 "possibly null pointer passed as formal with no null annotation",
98 "A possibly null pointer is passed as a parameter corresponding to "
99 "a formal parameter with no /*@null@*/ annotation. If NULL "
100 "may be used for this parameter, add a /*@null@*/ annotation "
101 "to the function parameter declaration.",
102 0, 0
103 },
104 {
105 FK_NULL, FK_MEMORY, modeFlag,
106 "nullret",
107 FLG_NULLRET,
108 "possibly null pointer returned as result with no null annotation",
109 "Function returns a possibly null pointer, but is not declared "
110 "using /*@null@*/ annotation of result. If function may "
111 "return NULL, add /*@null@*/ annotation to the return "
112 "value declaration.",
113 0, 0
114 },
115 {
116 FK_NULL, FK_MEMORY, modeFlag,
117 "nullstate",
118 FLG_NULLSTATE,
119 "possibly null pointer reachable from a reference with no null annotation",
120 "A possibly null pointer is reachable from a parameter or global "
121 "variable that is not declared using a /*@null@*/ annotation.",
122 0, 0
123 },
124 {
125 FK_NULL, FK_MEMORY, modeFlag,
126 "nullassign",
127 FLG_NULLASSIGN,
128 "inconsistent assignment or initialization involving null pointer",
129 "A reference with no null annotation is assigned or initialized "
130 "to NULL. Use /*@null@*/ to declare the reference as "
131 "a possibly null pointer.",
132 0, 0
133 },
134 {
135 FK_NULL, FK_MEMORY, plainFlag,
136 "nullinit",
137 FLG_NULLINIT,
138 "inconsistent initialization involving null pointer",
139 "A reference with no null annotation is initialized "
140 "to NULL. Use /*@null@*/ to declare the reference as "
141 "a possibly null pointer.",
142 0, 0
143 },
144
145 /*
146 ** Undefined Values (Section 3)
147 */
148
149 {
150 FK_DEF, FK_NONE, modeFlag,
151 "usedef",
152 FLG_USEDEF,
153 "use before definition",
154 "An rvalue is used that may not be initialized to a value on some execution path.",
155 0, 0
156 },
157 {
158 FK_MEMORY, FK_DEF, modeFlag,
159 "mustdefine",
160 FLG_MUSTDEFINE,
161 "out storage not defined before return or scope exit",
162 "An out parameter or global is not defined before control is transferred.",
163 0, 0
164 },
165 {
166 FK_MEMORY, FK_DEF, modeFlag,
167 "uniondef",
168 FLG_UNIONDEF,
169 "at least one field of a union must be defined",
170 "No field of a union is defined. Generally, one field of a union is "
171 "expected to be defined.",
172 0, 0
173 },
174 {
175 FK_MEMORY, FK_DEF, modeFlag,
176 "compdef",
177 FLG_COMPDEF,
178 "parameter, return value or global completely defined",
179 "Storage derivable from a parameter, return value or global is "
180 "not defined. Use /*@out@*/ to denote passed or returned "
181 "storage which need not be defined.",
182 0, 0
183 },
184 {
185 FK_DEF, FK_NONE, plainFlag,
186 "fullinitblock",
187 FLG_FULLINITBLOCK,
188 "initializer sets all fields",
189 "Initializer does not set every field in the structure.",
190 0, 0
191 },
192 {
193 FK_DEF, FK_NONE, plainFlag,
194 "initallelements",
195 FLG_INITALLELEMENTS,
196 "initializer defines all array elements",
197 "Initializer does not define all elements of a declared array.",
198 0, 0
199 },
200 {
201 FK_DEF, FK_NONE, plainFlag,
202 "initsize",
203 FLG_INITSIZE,
204 "initializer defines extra array elements",
205 "Initializer block contains more elements than the size of a declared array.",
206 0, 0
207 },
208
209 {
210 FK_DEF, FK_IMPLICIT, modeFlag,
211 "impouts",
212 FLG_IMPOUTS,
213 "pointer parameters to unspecified functions may be implicit out parameters",
214 NULL, 0, 0
215 },
216
217 /*
218 ** Types (Section 4)
219 */
220
221 {
222 FK_DECL, FK_TYPE, modeFlag,
223 "incondefs",
224 FLG_INCONDEFS,
225 "function, variable or constant redefined with inconsistent type",
226 "A function, variable or constant is redefined with a different type.",
227 0, 0
228 },
229 {
230 FK_DECL, FK_TYPE, modeFlag,
231 "matchfields",
232 FLG_MATCHFIELDS,
233 "struct or enum type redefined with inconsistent fields or members",
234 "A struct, union or enum type is redefined with inconsistent fields or members.",
235 0, 0
236 },
237 {
238 FK_TYPE, FK_NONE, modeFlag,
239 "fcnderef",
240 FLG_FCNDEREF,
241 "dereferencce of a function type",
242 "A function type is dereferenced. The ANSI standard allows this "
243 "because of implicit conversion of function designators, however the "
244 "dereference is unnecessary.",
245 0, 0
246 },
247 {
248 FK_OPS, FK_NONE, modeFlag,
249 "realcompare",
250 FLG_REALCOMPARE,
251 "dangerous comparison between reals (dangerous because of inexact "
252 "floating point representations)",
253 "Two real (float, double, or long double) values are compared "
254 "directly using a C primitive. "
255 "This may produce unexpected results since floating point "
256 "representations are inexact. Instead, compare the difference to "
257 "FLT_EPSILON or DBL_EPSILON.",
258 0, 0,
259 },
260 {
261 FK_OPS, FK_NONE, modeFlag,
262 "unsignedcompare",
263 FLG_UNSIGNEDCOMPARE,
264 "comparison using <, <=, >= between an unsigned integral and zero constant",
265 "An unsigned value is used in a comparison with zero in a way that is either a bug or confusing.",
266 0, 0,
267 },
268 {
269 FK_OPS, FK_POINTER, modeFlag,
270 "ptrarith",
271 FLG_POINTERARITH,
272 "arithmetic involving pointer and integer",
273 "Pointer arithmetic using pointer and integer.", 0, 0
274 },
275 {
276 FK_OPS, FK_POINTER, modeFlag,
277 "nullptrarith",
278 FLG_NULLPOINTERARITH,
279 "arithmetic involving possibly null pointer and integer",
280 "Pointer arithmetic using a possibly null pointer and integer.", 0, 0
281 },
282 {
283 FK_OPS, FK_POINTER, modeFlag,
284 "ptrcompare",
285 FLG_PTRNUMCOMPARE,
286 "comparison between pointer and number",
287 "A pointer is compared to a number.", 0, 0
288 },
289 {
290 FK_OPS, FK_TYPE, modeFlag,
291 "strictops",
292 FLG_STRICTOPS,
293 "primitive operation does not type check strictly",
294 "A primitive operation does not type check strictly.", 0, 0
295 },
296 {
297 FK_OPS, FK_TYPE, modeFlag,
298 "bitwisesigned",
299 FLG_BITWISEOPS,
300 "a bitwise logical operator does not have unsigned operands",
301 "An operand to a bitwise operator is not an unsigned values. This "
302 "may have unexpected results depending on the signed "
303 "representations.", 0, 0
304 },
305 {
306 FK_OPS, FK_TYPE, modeFlag,
307 "shiftnegative",
308 FLG_SHIFTNEGATIVE,
309 "a shift right operand may be negative",
310 "The right operand to a shift operator may be negative (behavior undefined).",
311 0, 0
312 },
313 {
314 FK_OPS, FK_TYPE, modeFlag,
315 "shiftimplementation",
316 FLG_SHIFTIMPLEMENTATION,
317 "a shift left operand may be negative",
318 "The left operand to a shift operator may be negative (behavior is implementation-defined).",
319 0, 0
320 },
321 {
322 FK_OPS, FK_TYPE, modeFlag,
323 "sizeoftype",
324 FLG_SIZEOFTYPE,
325 "sizeof operator has a type argument",
326 "Operand of sizeof operator is a type. (Safer to use expression, "
327 "int *x = sizeof (*x); instead of sizeof (int).)",
328 0, 0
329 },
330 {
331 FK_OPS, FK_TYPE, plainFlag,
332 "sizeofformalarray",
333 FLG_SIZEOFFORMALARRAY,
334 "sizeof operator has an array formal parameter argument",
335 "Operand of a sizeof operator is a function parameter declared as "
336 "an array. The value of sizeof will be the size of a pointer to the "
337 "element type, not the number of elements in the array.",
338 0, 0
339 },
340 {
341 FK_DECL, FK_TYPE, plainFlag,
342 "fixedformalarray",
343 FLG_FIXEDFORMALARRAY,
344 "formal parameter of type array is declared with size",
345 "A formal parameter is declared as an array with size. The size of the array "
346 "is ignored in this context, since the array formal parameter is treated "
347 "as a pointer.",
348 0, 0
349 },
350 {
351 FK_DECL, FK_TYPE, plainFlag,
352 "incompletetype",
353 FLG_INCOMPLETETYPE,
354 "formal parameter has an incomplete type",
355 "A formal parameter is declared with an incomplete type.",
356 0, 0
357 },
358 {
359 FK_DECL, FK_TYPE, plainFlag,
360 "formalarray",
361 FLG_FORMALARRAY,
362 "formal parameter is an array",
363 "A formal parameter is declared as an array. This can be confusing, since "
364 "a formal array parameter is treated as a pointer.",
365 0, 0
366 },
367
368
369 /*
370 ** Booleans (4.2)
371 */
372
373 {
374 FK_BOOL, FK_NONE, regStringFlag, ARG_STRING,
375 "booltype",
376 FLG_BOOLTYPE,
377 "set name of boolean type (default bool)",
378 NULL, 0, 0
379 },
380 {
381 FK_BOOL, FK_NONE, regStringFlag, ARG_STRING,
382 "boolfalse",
383 FLG_BOOLFALSE,
384 "set name of boolean false (default false)",
385 NULL, 0, 0
386 },
387 {
388 FK_BOOL, FK_NONE, regStringFlag, ARG_STRING,
389 "booltrue",
390 FLG_BOOLTRUE,
391 "set name of boolean true (default true)",
392 NULL, 0, 0
393 },
394 {
395 FK_BOOL, FK_HELP, plainFlag,
396 "likelybool",
397 FLG_LIKELYBOOL,
398 "type name is probably a boolean type but does not match default "
399 "boolean type name, \"bool\", and alternate name is not set",
400 "Use the -booltype, -boolfalse and -booltrue flags to change the "
401 "name of the default boolean type.",
402 0, 0
403 },
404
405 {
406 FK_BOOL, FK_OPS, modeFlag,
407 "boolcompare",
408 FLG_BOOLCOMPARE,
409 "comparison between bools (dangerous because of multiple true values)",
410 "Two bool values are compared directly using a C primitive. This "
411 "may produce unexpected results since all non-zero values are "
412 "considered true, so different true values may not be equal. "
413 "The file bool.h (included in splint/lib) provides bool_equal "
414 "for safe bool comparisons.", 0, 0
415 },
416 {
417 FK_BOOL, FK_OPS, modeFlag,
418 "boolops",
419 FLG_BOOLOPS,
420 "primitive operation (!, && or ||) does not has a boolean argument",
421 "The operand of a boolean operator is not a boolean. Use +ptrnegate "
422 "to allow ! to be used on pointers.",
423 0, 0
424 },
425 {
426 FK_BOOL, FK_POINTER, modeFlag,
427 "ptrnegate",
428 FLG_PTRNEGATE,
429 "allow ! to be used on pointer operand",
430 "The operand of ! operator is a pointer.", 0, 0
431 },
432 {
433 FK_BOOL, FK_PRED,plainFlag,
434 "predassign",
435 FLG_PREDASSIGN,
436 "condition test (if, while or for) is an assignment",
437 "The condition test is an assignment expression. Probably, you mean "
438 "to use == instead of =. If an assignment is intended, add an "
439 "extra parentheses nesting (e.g., if ((a = b)) ...) to suppress "
440 "this message.",
441 0, 0
442 },
443 {
444 FK_BOOL, FK_PRED, specialFlag,
445 "predbool",
446 FLG_PREDBOOL,
447 "type of condition test (if, while or for) not bool (sets predboolint, "
448 "predboolptr and predboolothers)",
449 "Test expression type is not boolean.", 0, 0
450 },
451 {
452 FK_PRED, FK_BOOL, modeFlag,
453 "predboolint",
454 FLG_PREDBOOLINT,
455 "type of condition test (if, while or for) is an integral type",
456 "Test expression type is not boolean or int.", 0, 0
457 },
458 {
459 FK_BOOL, FK_PRED, modeFlag,
460 "predboolptr",
461 FLG_PREDBOOLPTR,
462 "type of condition test (if, while or for) is a pointer",
463 "Test expression type is not boolean.", 0, 0
464 },
465 {
466 FK_BOOL, FK_PRED, modeFlag,
467 "predboolothers",
468 FLG_PREDBOOLOTHERS,
469 "type of condition test (if, while or for) not bool, int or pointer",
470 "Test expression type is not boolean.", 0, 0
471 },
472
473 /*
474 ** 4.3 Abstract types
475 */
476
477 {
478 FK_ABSTRACT, FK_NONE, plainFlag,
479 "abstract",
480 FLG_ABSTRACT,
481 "data abstraction barriers",
482 "An abstraction barrier is broken. If necessary, use /*@access <type>@*/ to allow access to an abstract type.",
483 0, 0
484 },
485 {
486 FK_ABSTRACT, FK_NONE, modeFlag,
487 "abstractcompare",
488 FLG_ABSTRACTCOMPARE,
489 "object equality comparison on abstract type operands",
490 "An object comparison (== or !=) is used on operands of abstract type.",
491 0, 0
492 },
493
494 {
495 FK_ABSTRACT, FK_NONE, plainFlag,
496 "numabstract",
497 FLG_NUMABSTRACT,
498 "data abstraction barriers",
499 "An abstraction barrier involving a numabstract type is broken. If necessary, use /*@access <type>@*/ to allow access to a numabstract type.",
500 0, 0
501 },
502 {
503 FK_ABSTRACT, FK_NONE, modeFlag,
504 "numabstractcast",
505 FLG_NUMABSTRACTCAST,
506 "numeric literal cast to numabstract type",
507 "A numeric literal is cast to a numabstract type.",
508 0, 0
509 },
510 {
511 FK_ABSTRACT, FK_NONE, modeFlag,
512 "numabstractlit",
513 FLG_NUMABSTRACTLIT,
514 "numeric literal can used as numabstract type",
515 "To allow a numeric literal to be used as a numabstract type, use +numabstractlit.",
516 0, 0
517 },
518 {
519 FK_ABSTRACT, FK_TYPEEQ, modeFlag,
520 "numabstractindex",
521 FLG_NUMABSTRACTINDEX,
522 "a numabstract type can be used to index an array",
523 "To allow numabstract types to index arrays, use +numabstractindex.",
524 0, 0
525 },
526 {
527 FK_ABSTRACT, FK_NONE, modeFlag,
528 "numabstractprint",
529 FLG_NUMABSTRACTPRINT,
530 "a numabstract value is printed using %d format code",
531 "A numabstract value is printed usind %d format code in a printf.",
532 0, 0
533 },
534 {
535 FK_ABSTRACT, FK_IMPLICIT, plainFlag,
536 "impabstract",
537 FLG_IMPABSTRACT,
538 "assume user type definitions are abstract (unless /*@concrete@*/ is used)",
539 NULL,
540 0, 0
541 },
542
543 /* 4.3.1 Access */
544
545 {
546 FK_ABSTRACT, FK_NAMES, plainFlag,
547 "accessmodule",
548 FLG_ACCESSMODULE,
549 "allow access to abstract types in definition module",
550 "The representation of an abstract type defined in <M>.<x> is "
551 "accessible anywhere in a file named <M>.<y>.",
552 0, 0
553 },
554 {
555 FK_ABSTRACT, FK_NAMES, plainFlag,
556 "accessfile",
557 FLG_ACCESSFILE,
558 "allow access to abstract types by file name convention",
559 "The representation of an abstract type named <t> is "
560 "accessible anywhere in a file named <t>.<x>.",
561 0, 0
562 },
563 {
564 FK_ABSTRACT, FK_NAMES, plainFlag,
565 "accessczech",
566 FLG_ACCESSCZECH,
567 "allow access to abstract types by czech naming convention",
568 "The representation of an abstract type named <t> is accessible "
569 "in the definition of a function or constant named <t>_<name>",
570 0, 0
571 },
572 {
573 FK_ABSTRACT, FK_NAMES, plainFlag,
574 "accessslovak",
575 FLG_ACCESSSLOVAK,
576 "allow access to abstract types by slovak naming convention",
577 "The representation of an abstract type named <t> is accessible "
578 "in the definition of a function or constant named <t><Name>",
579 0, 0
580 },
581 {
582 FK_ABSTRACT, FK_NAMES, plainFlag,
583 "accessczechoslovak",
584 FLG_ACCESSCZECHOSLOVAK,
585 "allow access to abstract types by czechoslovak naming convention",
586 "The representation of an abstract type named <t> is accessible "
587 "in the definition of a function or constant named <t>_<name> or <t><Name>",
588 0, 0
589 },
590 {
591 FK_ABSTRACT, FK_NAMES, specialFlag,
592 "accessall",
593 FLG_ACCESSALL,
594 "set accessmodule, accessfile and accessczech",
595 "Sets accessmodule, accessfile and accessczech",
596 0, 0
597 },
598
599 /* 4.3.2 Mutability */
600 {
601 FK_ABSTRACT, FK_NONE, modeFlag,
602 "mutrep",
603 FLG_MUTREP,
604 "representation of mutable type has sharing semantics",
605 "LCL semantics requires that a mutable type exhibits sharing semantics. "
606 "In order for objects to be shared a indirection is necessary in the representation. "
607 "A mutable type may be represented by a pointer or an abstract mutable type. Handles "
608 "into static data are fine, too, but will generate this error message unless it is suppressed.",
609 0, 0
610 },
611
612
613 /*
614 ** Memory Management (5)
615 */
616
617 /* Deallocation Errors */
618 {
619 FK_MEMORY, FK_LEAK, modeFlag,
620 "mustfreefresh",
621 FLG_MUSTFREEFRESH,
622 "freshly allocated storage not released before return or scope exit",
623 "A memory leak has been detected. Storage allocated locally "
624 "is not released before the last reference to it is lost.",
625 0, 0
626 },
627 {
628 FK_MEMORY, FK_LEAK, modeFlag,
629 "mustfreeonly",
630 FLG_MUSTFREEONLY,
631 "only storage not released before return or scope exit",
632 "A memory leak has been detected. Only-qualified storage is not released before the last "
633 "reference to it is lost.",
634 0, 0
635 },
636 {
637 FK_MEMORY, FK_LEAK, specialFlag,
638 "mustfree",
639 FLG_MUSTFREE,
640 "fresh or only storage not released before return or scope exit (sets mustfreefresh and mustfreeonly)",
641 "A memory leak has been detected.",
642 0, 0
643 },
644 {
645 FK_MEMORY, FK_DEAD, modeFlag,
646 "usereleased",
647 FLG_USERELEASED,
648 "storage used after release",
649 "Memory is used after it has been released (either by passing "
650 "as an only param or assigning to an only global).",
651 0, 0
652 },
653 {
654 FK_MEMORY, FK_DEAD, modeFlag,
655 "strictusereleased",
656 FLG_STRICTUSERELEASED,
657 "element used after it may have been released",
658 "Memory (through fetch) is used after it may have been released "
659 "(either by passing as an only param or assigning to an only global).",
660 0, 0
661 },
662 {
663 FK_MEMORY, FK_LEAK, modeFlag,
664 "compdestroy",
665 FLG_COMPDESTROY,
666 "all only references derivable from void pointer out only parameter are released",
667 "A storage leak due to incomplete deallocation of a structure or deep "
668 "pointer is suspected. Unshared storage that is reachable from "
669 "a reference that is being deallocated has not yet been deallocated. "
670 "Splint assumes when an object is passed "
671 "as an out only void pointer that the outer object will be "
672 "deallocated, but the inner objects will not.",
673 0, 0
674 },
675 {
676 FK_MEMORY, FK_LEAK, modeFlag,
677 "strictdestroy",
678 FLG_STRICTDESTROY,
679 "report complete destruction errors for array elements that "
680 "may have been released",
681 NULL,
682 0, 0
683 },
684 {
685 FK_MEMORY, FK_ARRAY, modeFlag,
686 "deparrays",
687 FLG_DEPARRAYS,
688 "array elements are dependent storage",
689 "When an element is fetched from an array, Splint analysis is "
690 "not able to determine if the same element is reused. "
691 "If +deparrays, Splint will mark local storage assigned from "
692 "array fetches as dependent.",
693 0, 0
694 },
695 {
696 FK_MEMORY, FK_NONE, modeFlag,
697 "branchstate",
698 FLG_BRANCHSTATE,
699 "storage has inconsistent states of alternate paths through a branch",
700 "The state of a variable is different depending on which branch "
701 "is taken. This means no annotation can sensibly be applied "
702 "to the storage.",
703 0, 0
704 },
705 {
706 FK_MEMORY, FK_NONE, modeFlag,
707 "strictbranchstate",
708 FLG_STRICTBRANCHSTATE,
709 "storage through array fetch has inconsistent states of alternate "
710 "paths through a branch",
711 "The state of a variable through an array fetch is different depending "
712 "on which branch is taken. This means no annotation can sensibly be applied "
713 "to the storage.",
714 0, 0
715 },
716 {
717 FK_MEMORY, FK_NONE, specialFlag,
718 "memchecks",
719 FLG_MEMCHECKS,
720 "sets all dynamic memory checking flags (memimplicit, mustfree, mustdefine, "
721 "mustnotalias, null, memtrans)",
722 NULL, 0, 0
723 },
724 {
725 FK_MEMORY, FK_DEF, modeFlag,
726 "compmempass",
727 FLG_COMPMEMPASS,
728 "actual parameter matches alias kind of formal parameter completely ",
729 "Storage derivable from a parameter does not match the alias kind "
730 "expected for the formal parameter.",
731 0, 0
732 },
733 {
734 FK_MEMORY, FK_DEAD, modeFlag,
735 "stackref",
736 FLG_RETSTACK,
737 "external reference to stack-allocated storage is created",
738 "A stack reference is pointed to by an external reference when the "
739 "function returns. The stack-allocated storage is destroyed "
740 "after the call, leaving a dangling reference.",
741 0, 0
742 },
743
744 {
745 FK_MEMORY, FK_NONE, specialFlag,
746 "memtrans",
747 FLG_MEMTRANS,
748 "memory transfer errors (sets all *trans flags)",
749 "Memory is transferred in a way that violates annotations.",
750 0, 0
751 },
752 {
753 FK_MEMORY, FK_NONE, modeFlag,
754 "dependenttrans",
755 FLG_DEPENDENTTRANS,
756 "dependent transfer errors",
757 "Dependent storage is transferred to a non-dependent reference.",
758 0, 0
759 },
760 {
761 FK_MEMORY, FK_NONE, modeFlag,
762 "newreftrans",
763 FLG_NEWREFTRANS,
764 "new reference transfer to reference counted reference",
765 "A new reference is transferred to a reference counted reference.",
766 0, 0
767 },
768 {
769 FK_MEMORY, FK_NONE, modeFlag,
770 "onlytrans",
771 FLG_ONLYTRANS,
772 "only storage transferred to non-only reference (memory leak)",
773 "The only reference to this storage is transferred to another "
774 "reference (e.g., by returning it) that does not have the "
775 "only annotation. This may lead to a memory leak, since the "
776 "new reference is not necessarily released.",
777 0, 0
778 },
779 {
780 FK_MEMORY, FK_NONE, modeFlag,
781 "onlyunqglobaltrans",
782 FLG_ONLYUNQGLOBALTRANS,
783 "only storage transferred to an unqualified global or "
784 "static reference (memory leak)",
785 "The only reference to this storage is transferred to another "
786 "reference that does not have an aliasing annotation. "
787 "This may lead to a memory leak, since the "
788 "new reference is not necessarily released.",
789 0, 0
790 },
791 {
792 FK_MEMORY, FK_NONE, modeFlag,
793 "ownedtrans",
794 FLG_OWNEDTRANS,
795 "owned storage transferred to non-owned reference (memory leak)",
796 "The owned reference to this storage is transferred to another "
797 "reference (e.g., by returning it) that does not have the "
798 "owned annotation. This may lead to a memory leak, since the "
799 "new reference is not necessarily released.",
800 0, 0
801 },
802 {
803 FK_MEMORY, FK_NONE, modeFlag,
804 "freshtrans",
805 FLG_FRESHTRANS,
806 "fresh storage transferred to non-only reference (memory leak)",
807 "Fresh storage (newly allocated in this function) is transferred "
808 "in a way that the obligation to release storage is not "
809 "propagated. Use the /*@only@*/ annotation to indicate "
810 "the a return value is the only reference to the returned "
811 "storage.",
812 0, 0
813 },
814 {
815 FK_MEMORY, FK_NONE, modeFlag,
816 "sharedtrans",
817 FLG_SHAREDTRANS,
818 "shared storage transferred to non-shared reference",
819 "Shared storage is transferred to a non-shared reference. The other "
820 "reference may release storage needed by this reference.",
821 0, 0
822 },
823 {
824 FK_MEMORY, FK_NONE, modeFlag,
825 "temptrans",
826 FLG_TEMPTRANS,
827 "temp storage transferred to non-temporary reference",
828 "Temp storage (associated with a formal parameter) is transferred "
829 "to a non-temporary reference. The storage may be released "
830 "or new aliases created.",
831 0, 0
832 },
833 {
834 FK_MEMORY, FK_NONE, modeFlag,
835 "kepttrans",
836 FLG_KEPTTRANS,
837 "kept storage transferred to non-temporary reference",
838 "storage is transferred "
839 "to a non-temporary reference after being passed as keep parameter. The storage may be released "
840 "or new aliases created.",
841 0, 0
842 },
843 {
844 FK_MEMORY, FK_NONE, modeFlag,
845 "keeptrans",
846 FLG_KEEPTRANS,
847 "keep storage transferred inconsistently",
848 "Keep storage is transferred inconsistently --- either in a way "
849 "that may add a new alias to it, or release it.",
850 0, 0
851 },
852 {
853 FK_MEMORY, FK_NONE, modeFlag,
854 "immediatetrans",
855 FLG_IMMEDIATETRANS,
856 "an immediate address (result of &) is transferred inconsistently",
857 "An immediate address (result of & operator) is transferred "
858 "inconsistently.",
859 0, 0
860 },
861 {
862 FK_MEMORY, FK_NONE, modeFlag,
863 "refcounttrans",
864 FLG_REFCOUNTTRANS,
865 "reference counted storage is transferred in an inconsistent way",
866 "Reference counted storage is transferred in a way that may not "
867 "be consistent with the reference count.",
868 0, 0
869 },
870 {
871 FK_MEMORY, FK_NONE, modeFlag,
872 "statictrans",
873 FLG_STATICTRANS,
874 "static storage is transferred in an inconsistent way",
875 "Static storage is transferred in an inconsistent way.",
876 0, 0
877 },
878 {
879 FK_MEMORY, FK_NONE, modeFlag,
880 "unqualifiedtrans",
881 FLG_UNKNOWNTRANS,
882 "unqualified storage is transferred in an inconsistent way",
883 "Unqualified storage is transferred in an inconsistent way.",
884 0, 0
885 },
886 {
887 FK_MEMORY, FK_NONE, modeFlag,
888 "staticinittrans",
889 FLG_STATICINITTRANS,
890 "static storage is used as an initial value in an inconsistent way",
891 "Static storage is used as an initial value in an inconsistent way.",
892 0, 0
893 },
894 {
895 FK_MEMORY, FK_NONE, modeFlag,
896 "unqualifiedinittrans",
897 FLG_UNKNOWNINITTRANS,
898 "unqualified storage is used as an initial value in an inconsistent way",
899 "Unqualified storage is used as an initial value in an inconsistent way.",
900 0, 0
901 },
902 {
903 FK_MEMORY, FK_NONE, modeFlag,
904 "readonlytrans",
905 FLG_READONLYTRANS,
906 "report memory transfer errors for initializations to read-only string literals",
907 "A read-only string literal is assigned to a non-observer reference.",
908 0, 0
909 },
910 {
911 FK_MEMORY, FK_PARAMS, modeFlag,
912 "passunknown",
913 FLG_PASSUNKNOWN,
914 "passing a value as an un-annotated parameter clears its annotation",
915 NULL, 0, 0
916 },
917
918 /* 5.3 Implicit Memory Annotations */
919
920 {
921 FK_MEMORY, FK_NONE, modeFlag,
922 "readonlystrings",
923 FLG_READONLYSTRINGS,
924 "string literals are read-only (error if one is modified or released)",
925 "String literals are read-only. An error is reported "
926 "if a string literal may be modified or released.",
927 0, 0
928 },
929 {
930 FK_MEMORY, FK_IMPLICIT, modeFlag,
931 "memimp",
932 FLG_MEMIMPLICIT,
933 "memory errors for unqualified storage",
934 NULL, 0, 0
935 },
936 {
937 FK_MEMORY, FK_IMPLICIT, plainFlag,
938 "paramimptemp",
939 FLG_PARAMIMPTEMP,
940 "assume unannotated parameter is temp",
941 NULL, 0, 0
942 },
943 {
944 FK_MEMORY, FK_IMPLICIT, specialFlag,
945 "allimponly",
946 FLG_ALLIMPONLY,
947 "sets globimponly, retimponly, structimponly, specglobimponly, "
948 "specretimponly and specstructimponly",
949 NULL, 0, 0
950 },
951 {
952 FK_MEMORY, FK_IMPLICIT, specialFlag,
953 "codeimponly",
954 FLG_CODEIMPONLY,
955 "sets globimponly, retimponly and structimponly",
956 NULL, 0, 0
957 },
958 {
959 FK_MEMORY, FK_IMPLICIT, specialFlag,
960 "specimponly",
961 FLG_SPECALLIMPONLY,
962 "sets specglobimponly, specretimponly and specstructimponly",
963 NULL, 0, 0
964 },
965 {
966 FK_MEMORY, FK_IMPLICIT, plainFlag,
967 "globimponly",
968 FLG_GLOBIMPONLY,
969 "assume unannotated global storage is only",
970 NULL, 0, 0
971 },
972 {
973 FK_MEMORY, FK_IMPLICIT, plainFlag,
974 "retimponly",
975 FLG_RETIMPONLY,
976 "assume unannotated returned storage is only",
977 NULL, 0, 0
978 },
979 {
980 FK_MEMORY, FK_IMPLICIT, plainFlag,
981 "structimponly",
982 FLG_STRUCTIMPONLY,
983 "assume unannotated structure field is only",
984 NULL, 0, 0
985 },
986 {
987 FK_MEMORY, FK_IMPLICIT, plainFlag,
988 "specglobimponly",
989 FLG_SPECGLOBIMPONLY,
990 "assume unannotated global storage is only",
991 NULL, 0, 0
992 },
993 {
994 FK_MEMORY, FK_IMPLICIT, plainFlag,
995 "specretimponly",
996 FLG_SPECRETIMPONLY,
997 "assume unannotated returned storage is only",
998 NULL, 0, 0
999 },
1000 {
1001 FK_MEMORY, FK_IMPLICIT, plainFlag,
1002 "specstructimponly",
1003 FLG_SPECSTRUCTIMPONLY,
1004 "assume unannotated structure field is only",
1005 NULL, 0, 0
1006 },
1007
1008 /* Reference Counting */
1009
1010
1011
1012 /*
1013 ** 6. Sharing
1014 */
1015
1016 /* 6.1 Aliasing warnings */
1017
1018 {
1019 FK_ALIAS, FK_MEMORY, modeFlag,
1020 "aliasunique",
1021 FLG_ALIASUNIQUE,
1022 "unique parameter is aliased",
1023 "A unique or only parameter is aliased by some other parameter or visible global.",
1024 0, 0
1025 },
1026 {
1027 FK_ALIAS, FK_MEMORY, modeFlag,
1028 "mayaliasunique",
1029 FLG_MAYALIASUNIQUE,
1030 "unique parameter may be aliased",
1031 "A unique or only parameter may be aliased by some other parameter or visible global.",
1032 0, 0
1033 },
1034 {
1035 FK_ALIAS, FK_MEMORY, modeFlag,
1036 "mustnotalias",
1037 FLG_MUSTNOTALIAS,
1038 "temp storage aliased at return point or scope exit",
1039 "An alias has been added to a temp-qualifier parameter or global that is visible externally when the function returns. If the aliasing is needed, use the /*@shared@*/ annotation to indicate that new aliases to the parameter may be created.",
1040 0, 0
1041 },
1042 {
1043 FK_ALIAS, FK_NONE, modeFlag,
1044 "retalias",
1045 FLG_RETALIAS,
1046 "function returns alias to parameter or global",
1047 "The returned value shares storage with a parameter or global. If a parameter is to be returned, use the returned qualifier. If the result is not modified, use the observer qualifier on the result type. Otherwise, exposed can be used, but limited checking is done.", 0, 0
1048 },
1049
1050 /* Global aliasing */
1051 {
1052 FK_ALIAS, FK_GLOBALS, specialFlag,
1053 "globalias",
1054 FLG_GLOBALIAS,
1055 "function returns with global aliasing external state (sets "
1056 "checkstrictglobalias, checkedglobalias, checkmodglobalias and "
1057 "uncheckedglobalias)",
1058 "A global variable aliases externally-visible state when the function returns.",
1059 0, 0
1060 },
1061 {
1062 FK_ALIAS, FK_GLOBALS, modeFlag,
1063 "checkstrictglobalias",
1064 FLG_CHECKSTRICTGLOBALIAS,
1065 "function returns with a checkstrict global aliasing external state",
1066 "A global variable aliases externally-visible state when the function returns.",
1067 0, 0
1068 },
1069 {
1070 FK_ALIAS, FK_GLOBALS, modeFlag,
1071 "checkedglobalias",
1072 FLG_CHECKEDGLOBALIAS,
1073 "function returns with a checked global aliasing external state",
1074 "A global variable aliases externally-visible state when the function returns.",
1075 0, 0
1076 },
1077 {
1078 FK_ALIAS, FK_GLOBALS, modeFlag,
1079 "checkmodglobalias",
1080 FLG_CHECKMODGLOBALIAS,
1081 "function returns with a checkmod global aliasing external state",
1082 "A global variable aliases externally-visible state when the function returns.",
1083 0, 0
1084 },
1085 {
1086 FK_ALIAS, FK_GLOBALS, modeFlag,
1087 "uncheckedglobalias",
1088 FLG_UNCHECKEDGLOBALIAS,
1089 "function returns with an unchecked global aliasing external state",
1090 "A global variable aliases externally-visible state when the function returns.",
1091 0, 0
1092 },
1093
1094 /* 6.2 Exposure */
1095
1096 {
1097 FK_MEMORY, FK_NONE, modeFlag,
1098 "exposetrans",
1099 FLG_EXPOSETRANS,
1100 "exposure transfer errors",
1101 "Exposed storage is transferred to a non-exposed, non-observer reference.",
1102 0, 0
1103 },
1104 {
1105 FK_MEMORY, FK_NONE, modeFlag,
1106 "observertrans",
1107 FLG_OBSERVERTRANS,
1108 "observer transfer errors",
1109 "Observer storage is transferred to a non-observer reference.",
1110 0, 0
1111 },
1112 {
1113 FK_EXPOSURE, FK_ABSTRACT, specialFlag,
1114 "repexpose",
1115 FLG_REPEXPOSE,
1116 "abstract representation is exposed (sets assignexpose, retexpose, and castexpose)",
1117 "The internal representation of an abstract type is visible to the "
1118 "caller. This means clients may have access to a pointer "
1119 "into the abstract representation.",
1120 0, 0
1121 },
1122 {
1123 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
1124 "retexpose",
1125 FLG_RETEXPOSE,
1126 "abstract representation is exposed (return values only)",
1127 "The return value shares storage with an instance of an abstract "
1128 "type. This means clients may have access to a pointer into "
1129 "the abstract representation. Use the observer qualifier to "
1130 "return exposed storage that may not be modified by the "
1131 "client. Use the exposed qualifier to return modifiable "
1132 "(but not deallocatable) exposed storage (dangerous).",
1133 0, 0
1134 },
1135 {
1136 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
1137 "assignexpose",
1138 FLG_ASSIGNEXPOSE,
1139 "abstract representation is exposed (assignments only)",
1140 "Storage internal to the representation of an abstract type is "
1141 "assigned to an external pointer. This means clients may "
1142 "have access to a pointer into the abstract representation. "
1143 "If the external pointer is a parameter, the exposed qualifier "
1144 "can be used to allow the assignment, however, this is "
1145 "considered dangerous programming practice.",
1146 0, 0
1147 },
1148 {
1149 FK_EXPOSURE, FK_ABSTRACT, modeFlag,
1150 "castexpose",
1151 FLG_CASTEXPOSE,
1152 "abstract representation is exposed through a cast",
1153 "Storage internal to the representation of an abstract type is exposed "
1154 "through a type cast. This means clients may have access to a "
1155 "pointer into the abstract representation.",
1156 0, 0
1157 },
1158 {
1159 FK_DECL, FK_TYPE, modeFlag,
1160 "redundantsharequal",
1161 FLG_REDUNDANTSHAREQUAL,
1162 "declaration uses observer qualifier that is always true",
1163 "A declaration of an immutable object uses a redundant observer qualifier.",
1164 0, 0
1165 } ,
1166 {
1167 FK_DECL, FK_TYPE, modeFlag,
1168 "misplacedsharequal",
1169 FLG_MISPLACEDSHAREQUAL,
1170 "declaration of unsharable storage uses sharing annotation",
1171 "A declaration of an unsharable object uses a sharing annotation.",
1172 0, 0
1173 } ,
1174
1175 /*
1176 ** 7. Function Interfaces
1177 */
1178
1179 /* 7.1 Modifications */
1180
1181 {
1182 FK_MODIFIES, FK_SPEC, plainFlag,
1183 "mods",
1184 FLG_MODIFIES,
1185 "unspecified modification of caller-visible state",
1186 "An externally-visible object is modified by a function, but not "
1187 "listed in its modifies clause.",
1188 0, 0
1189 },
1190 {
1191 FK_MODIFIES, FK_SPEC, modeFlag,
1192 "mustmod",
1193 FLG_MUSTMOD,
1194 "specified modification is not detected",
1195 "An object listed in the modifies clause is not modified by the "
1196 "implementation of the function. The modification may not "
1197 "be detected if it is done through a call to an unspecified "
1198 "function.",
1199 0, 0
1200 },
1201 {
1202 FK_MODIFIES, FK_MEMORY, plainFlag,
1203 "modobserver",
1204 FLG_MODOBSERVER,
1205 "possible modification of observer storage",
1206 "Storage declared with observer is possibly modified. Observer "
1207 "storage may not be modified.",
1208 0, 0
1209 },
1210 {
1211 FK_MODIFIES, FK_MEMORY, modeFlag,
1212 "modobserveruncon",
1213 FLG_MODOBSERVERUNCON,
1214 "possible modification of observer storage through unconstrained call",
1215 "Storage declared with observer may be modified through a call to an "
1216 "unconstrained function.",
1217 0, 0
1218 },
1219 {
1220 FK_MODIFIES, FK_MEMORY, modeFlag,
1221 "modinternalstrict",
1222 FLG_MODINTERNALSTRICT,
1223 "possible modification of internal storage through function call",
1224 "A function that modifies internalState is called from a function that "
1225 "does not list internalState in its modifies clause",
1226 0, 0
1227 },
1228 {
1229 FK_MODIFIES, FK_UNSPEC, modeFlag,
1230 "modfilesys",
1231 FLG_MODFILESYSTEM,
1232 "report undocumented file system modifications (applies to unspecified "
1233 "functions if modnomods is set)",
1234 NULL, 0, 0
1235 },
1236 {
1237 FK_MODIFIES, FK_UNSPEC, specialFlag,
1238 "modunspec",
1239 FLG_MODUNSPEC,
1240 "modification in unspecified functions (sets modnomods, "
1241 "modglobunspec and modstrictglobsunspec)",
1242 NULL, 0, 0
1243 },
1244 {
1245 FK_MODIFIES, FK_UNSPEC, modeFlag,
1246 "modnomods",
1247 FLG_MODNOMODS,
1248 "modification in a function with no modifies clause",
1249 "An externally-visible object is modified by a function with no "
1250 "/*@modifies@*/ comment. The /*@modifies ... @*/ control "
1251 "comment can be used to give a modifies list for an "
1252 "unspecified function.",
1253 0, 0
1254 },
1255 {
1256 FK_MODIFIES, FK_UNSPEC, modeFlag,
1257 "moduncon",
1258 FLG_MODUNCON,
1259 "possible modification through a call to an unconstrained function",
1260 "An unconstrained function is called in a function body where "
1261 "modifications are checked. Since the unconstrained function "
1262 "may modify anything, there may be undetected modifications in "
1263 "the checked function.",
1264 0, 0
1265 },
1266 {
1267 FK_MODIFIES, FK_UNSPEC, modeFlag,
1268 "modunconnomods",
1269 FLG_MODUNCONNOMODS,
1270 "possible modification through a call to an unconstrained function in "
1271 "a function with no modifies clause",
1272 "An unconstrained function is called in a function body where "
1273 "modifications are checked. Since the unconstrained function "
1274 "may modify anything, there may be undetected modifications in "
1275 "the checked function.",
1276 0, 0
1277 },
1278 {
1279 FK_MODIFIES, FK_GLOBALS, modeFlag,
1280 "globsimpmodsnothing",
1281 FLG_GLOBALSIMPMODIFIESNOTHING,
1282 "functions declared with a globals list but no modifies clause are "
1283 "assumed to modify nothing",
1284 "An implicit modifies nothing clause is assumed for a function "
1285 "declared with a globals list but not modifies clause.",
1286 0, 0
1287 },
1288 {
1289 FK_MODIFIES, FK_GLOBALS, modeFlag,
1290 "modsimpnoglobs",
1291 FLG_MODIFIESIMPNOGLOBALS,
1292 "functions declared with a modifies clause but no globals list "
1293 "are assumed to use no globals",
1294 "An implicit empty globals list is assumed for a function "
1295 "declared with a modifies clause but no globals list.",
1296 0, 0
1297 },
1298
1299 /*
1300 ** Globals
1301 */
1302
1303 {
1304 FK_GLOBALS, FK_NONE, modeFlag,
1305 "globstate",
1306 FLG_GLOBSTATE,
1307 "returns with global in inconsistent state (null or undefined)",
1308 "A global variable does not satisfy its annotations when control is transferred.",
1309 0, 0
1310 },
1311
1312 {
1313 FK_GLOBALS, FK_SPEC, plainFlag,
1314 "globs",
1315 FLG_GLOBALS,
1316 "undocumented use of a checked global variable",
1317 "A checked global variable is used in the function, but not listed in "
1318 "its globals clause. By default, only globals specified in .lcl "
1319 "files are checked. To check all globals, use +allglobals. To "
1320 "check globals selectively use /*@checked@*/ in the global "
1321 "declaration.",
1322 0, 0
1323 },
1324 {
1325 FK_GLOBALS, FK_SPEC, modeFlag,
1326 "globuse",
1327 FLG_USEALLGLOBS,
1328 "global listed for a function not used",
1329 "A global variable listed in the function's globals list is not used "
1330 "in the body of the function.",
1331 0, 0
1332 },
1333 {
1334 FK_GLOBALS, FK_NONE, modeFlag,
1335 "internalglobs",
1336 FLG_INTERNALGLOBS,
1337 "use of internalState",
1338 "A called function uses internal state, but the globals list for the "
1339 "function being checked does not include internalState",
1340 0, 0
1341 },
1342 {
1343 FK_GLOBALS, FK_NONE, modeFlag,
1344 "internalglobsnoglobs",
1345 FLG_INTERNALGLOBSNOGLOBS,
1346 "use of internalState (in function with no globals list)",
1347 "A called function uses internal state, but the function being checked "
1348 "has no globals list",
1349 0, 0
1350 },
1351 {
1352 FK_GLOBALS, FK_MODIFIES, modeFlag,
1353 "warnmissingglobs",
1354 FLG_WARNMISSINGGLOBALS,
1355 "global variable used in modifies clause is not listed in globals list",
1356 "A global variable is used in the modifies clause, but it is not listed in "
1357 "the globals list. The variable will be added to the globals list.",
1358 0, 0
1359 },
1360
1361 {
1362 FK_GLOBALS, FK_MODIFIES, modeFlag,
1363 "warnmissingglobsnoglobs",
1364 FLG_WARNMISSINGGLOBALSNOGLOBS,
1365 "global variable used in modifies clause in a function with no globals list",
1366 "A global variable is used in the modifies clause, but the function "
1367 "has no globals list. The variable will be added to the globals list.",
1368 0, 0
1369 },
1370 {
1371 FK_GLOBALS, FK_UNSPEC, modeFlag,
1372 "globnoglobs",
1373 FLG_GLOBUNSPEC,
1374 "use of checked global in a function with no globals list or specification",
1375 "A specified global variable is used in the function, but not listed "
1376 "in its globals list. Without +globnoglobs, only globals "
1377 "declared with /*@checkedstrict@*/ will produce use "
1378 "errors in functions without globals "
1379 "lists. The /*@globals ... @*/ control comment can be used to give "
1380 "a globals list for an unspecified function.",
1381 0, 0
1382 },
1383 {
1384 FK_GLOBALS, FK_IMPLICIT, modeFlag,
1385 "allglobs",
1386 FLG_ALLGLOBALS,
1387 "report use and modification errors for globals not annotated with unchecked",
1388 NULL, 0, 0
1389 },
1390 {
1391 FK_GLOBALS, FK_UNSPEC, modeFlag,
1392 "checkstrictglobs",
1393 FLG_CHECKSTRICTGLOBALS,
1394 "report use and modification errors for checkedstrict globals",
1395 NULL, 0, 0
1396 },
1397 {
1398 FK_GLOBALS, FK_UNSPEC, modeFlag,
1399 "impcheckedspecglobs",
1400 FLG_IMPCHECKEDSPECGLOBALS,
1401 "assume checked qualifier for unqualified global declarations in .lcl files",
1402 NULL, 0, 0
1403 },
1404 {
1405 FK_GLOBALS, FK_UNSPEC, modeFlag,
1406 "impcheckmodspecglobs",
1407 FLG_IMPCHECKMODSPECGLOBALS,
1408 "assume checkmod qualifier for unqualified global declarations in .lcl files",
1409 NULL, 0, 0
1410 },
1411 {
1412 FK_GLOBALS, FK_UNSPEC, modeFlag,
1413 "impcheckedstrictspecglobs",
1414 FLG_IMPCHECKEDSTRICTSPECGLOBALS,
1415 "assume checkmod qualifier for unqualified global declarations in .lcl files",
1416 NULL, 0, 0
1417 },
1418 {
1419 FK_GLOBALS, FK_UNSPEC, modeFlag,
1420 "impcheckedglobs",
1421 FLG_IMPCHECKEDGLOBALS,
1422 "assume checked qualifier for unqualified global declarations",
1423 NULL, 0, 0
1424 },
1425 {
1426 FK_GLOBALS, FK_UNSPEC, modeFlag,
1427 "impcheckmodglobs",
1428 FLG_IMPCHECKMODGLOBALS,
1429 "assume checkmod qualifier for unqualified global declarations",
1430 NULL, 0, 0
1431 },
1432 {
1433 FK_GLOBALS, FK_UNSPEC, modeFlag,
1434 "impcheckedstrictglobs",
1435 FLG_IMPCHECKEDSTRICTGLOBALS,
1436 "assume checkedstrict qualifier for unqualified global declarations",
1437 NULL, 0, 0
1438 },
1439 {
1440 FK_GLOBALS, FK_UNSPEC, modeFlag,
1441 "impcheckedstatics",
1442 FLG_IMPCHECKEDSTATICS,
1443 "assume checked qualifier for unqualified file static declarations",
1444 NULL, 0, 0
1445 },
1446 {
1447 FK_GLOBALS, FK_UNSPEC, modeFlag,
1448 "impcheckmodstatics",
1449 FLG_IMPCHECKMODSTATICS,
1450 "assume checkmod qualifier for unqualified file static declarations",
1451 NULL, 0, 0
1452 },
1453 {
1454 FK_GLOBALS, FK_UNSPEC, modeFlag,
1455 "impcheckmodinternals",
1456 FLG_IMPCHECKMODINTERNALS,
1457 "assume checkmod qualifier for unqualified local "
1458 "static declarations (for internal state modifications)",
1459 NULL, 0, 0
1460 },
1461 {
1462 FK_GLOBALS, FK_UNSPEC, modeFlag,
1463 "impcheckedstrictstatics",
1464 FLG_IMPCHECKEDSTRICTSTATICS,
1465 "assume checkedstrict qualifier for unqualified file static declarations",
1466 NULL, 0, 0
1467 },
1468 {
1469 FK_GLOBALS, FK_MODIFIES, modeFlag,
1470 "modglobs",
1471 FLG_MODGLOBS,
1472 "undocumented modification of a checked global variable",
1473 "A checked global variable is modified by the function, but not listed in "
1474 "its modifies clause.",
1475 0, 0
1476 },
1477 {
1478 FK_GLOBALS, FK_MODIFIES, modeFlag,
1479 "modglobsnomods",
1480 FLG_MODGLOBSUNSPEC,
1481 "undocumented modification of a checked global variable in a function "
1482 "declared with no modifies clause",
1483 "A checked global variable is modified by the function, but not listed in "
1484 "its modifies clause.",
1485 0, 0
1486 },
1487 {
1488 FK_GLOBALS, FK_MODIFIES, modeFlag,
1489 "modstrictglobsnomods",
1490 FLG_MODSTRICTGLOBSUNSPEC,
1491 "undocumented modification of a strict checked global variable in a "
1492 "function declared with no modifies clause",
1493 "A checked global variable is modified by the function, but not listed in "
1494 "its modifies clause.",
1495 0, 0
1496 },
1497 {
1498 FK_GLOBALS, FK_MODIFIES, modeFlag,
1499 "modglobsunchecked",
1500 FLG_MODGLOBSUNCHECKED,
1501 "undocumented modification of an unchecked checked global variable",
1502 "An unchecked global variable is modified by the function, but not listed in "
1503 "its modifies clause.",
1504 0, 0
1505 },
1506
1507 /*
1508 ** State Clauses
1509 */
1510
1511 /*
1512 ** 8. Control Flow
1513 */
1514
1515 /* 8.1 Execution */
1516
1517 {
1518 FK_CONTROL, FK_NONE, modeFlag,
1519 "noret",
1520 FLG_NORETURN,
1521 "path with no return detected in non-void function",
1522 "There is a path through a function declared to return a value on "
1523 "which there is no return statement. This means the execution "
1524 "may fall through without returning a meaningful result to "
1525 "the caller.",
1526 0, 0
1527 },
1528 {
1529 FK_CONTROL, FK_NONE, plainFlag,
1530 "emptyret",
1531 FLG_EMPTYRETURN,
1532 "empty return in function declared to return value",
1533 NULL,
1534 0, 0
1535 },
1536 {
1537 FK_CONTROL, FK_NONE, plainFlag,
1538 "alwaysexits",
1539 FLG_ALWAYSEXITS,
1540 "loop predicate always exits",
1541 NULL,
1542 0, 0
1543 },
1544
1545 {
1546 FK_CONTROL, FK_MEMORY, specialFlag,
1547 "loopexec",
1548 FLG_LOOPEXEC,
1549 "assume all loops execute at least once (sets forloopexec, whileloopexec and iterloopexec)",
1550 NULL, 0, 0
1551 },
1552 {
1553 FK_CONTROL, FK_MEMORY, plainFlag,
1554 "forloopexec",
1555 FLG_FORLOOPEXEC,
1556 "assume all for loops execute at least once",
1557 NULL, 0, 0
1558 },
1559 {
1560 FK_CONTROL, FK_MEMORY, plainFlag,
1561 "whileloopexec",
1562 FLG_WHILELOOPEXEC,
1563 "assume all while loops execute at least once",
1564 NULL, 0, 0
1565 },
1566 {
1567 FK_CONTROL, FK_MEMORY, plainFlag,
1568 "iterloopexec",
1569 FLG_ITERLOOPEXEC,
1570 "assume all iterator loops execute at least once",
1571 NULL, 0, 0
1572 },
1573 {
1574 FK_CONTROL, FK_MEMORY, plainFlag,
1575 "obviousloopexec",
1576 FLG_OBVIOUSLOOPEXEC,
1577 "assume loop that can be determined to always execute always does",
1578 NULL, 0, 0
1579 },
1580
1581 /* 8.2 Undefined Behavior */
1582
1583 {
1584 FK_BEHAVIOR, FK_ANSI, modeFlag,
1585 "evalorder",
1586 FLG_EVALORDER,
1587 "code has unspecified or implementation-dependent behavior "
1588 "because of order of evaluation",
1589 "Code has unspecified behavior. "
1590 "Order of evaluation of function parameters or subexpressions "
1591 "is not defined, so if a value is used and modified in different "
1592 "places not separated by a sequence point constraining "
1593 "evaluation order, then the result of the expression is "
1594 "unspecified.",
1595 0, 0
1596 },
1597 {
1598 FK_BEHAVIOR, FK_ANSI, modeFlag,
1599 "evalorderuncon",
1600 FLG_EVALORDERUNCON,
1601 "code involving call to unspecified function has undefined or implementation-dependent behavior",
1602 "Code involving a call to function with no modifies or globals clause "
1603 "may have undefined or implementation-dependent behavior (Splint assumes the "
1604 "unconstrained call may modify any reachable state or use any global). Add a "
1605 "specification for the function.",
1606 0, 0
1607 },
1608
1609 /* 8.3 Problematic Control Structures */
1610
1611 /* 8.3.1 Infinite Loops */
1612
1613 {
1614 FK_CONTROL, FK_NONE, modeFlag,
1615 "infloops",
1616 FLG_INFLOOPS,
1617 "likely infinite loop is detected",
1618 "This appears to be an infinite loop. Nothing in the body of the "
1619 "loop or the loop test modifies the value of the loop test. "
1620 "Perhaps the specification of a function called in the loop "
1621 "body is missing a modification.",
1622 0, 0
1623 },
1624 {
1625 FK_CONTROL, FK_NONE, modeFlag,
1626 "infloopsuncon",
1627 FLG_INFLOOPSUNCON,
1628 "likely infinite loop is detected (may result from unconstrained function)",
1629 "This appears to be an infinite loop. Nothing in the body of the "
1630 "loop or the loop test modifies the value of the loop test. "
1631 "There may be a modification through a call to an unconstrained "
1632 "function, or an unconstrained function in the loop test may use "
1633 "a global variable modified by the loop body.",
1634 0, 0
1635 },
1636
1637 /* 8.3.2 Switches */
1638
1639 {
1640 FK_CONTROL, FK_NONE, modeFlag,
1641 "casebreak",
1642 FLG_CASEBREAK,
1643 "non-empty case in a switch without preceding break",
1644 "Execution falls through from the previous case.", 0, 0
1645 },
1646 {
1647 FK_CONTROL, FK_NONE, modeFlag,
1648 "misscase",
1649 FLG_MISSCASE,
1650 "switch on enum type missing case for some value",
1651 "Not all values in an enumeration are present as cases in the switch.",
1652 0, 0
1653 },
1654 {
1655 FK_CONTROL, FK_NONE, modeFlag,
1656 "firstcase",
1657 FLG_FIRSTCASE,
1658 "first statement in switch is not a case",
1659 "The first statement after a switch is not a case.",
1660 0, 0
1661 },
1662 {
1663 FK_CONTROL, FK_NONE, plainFlag,
1664 "duplicatecases",
1665 FLG_DUPLICATECASES,
1666 "duplicate cases in switch",
1667 "Duplicate cases in switch.",
1668 0, 0
1669 },
1670
1671 /* 8.3.3 Deep Breaks */
1672
1673 {
1674 FK_CONTROL, FK_NONE, specialFlag,
1675 "deepbreak",
1676 FLG_DEEPBREAK,
1677 "break inside nested while or for or switch",
1678 "A break statement appears inside the body of a nested while, for or "
1679 "switch statement. Sets looploopbreak, loopswitchbreak, "
1680 "switchloopbreak, switchswitchbreak, and looploopcontinue.",
1681 0, 0
1682 },
1683 {
1684 FK_CONTROL, FK_NONE, modeFlag,
1685 "looploopbreak",
1686 FLG_LOOPLOOPBREAK,
1687 "break inside nested while or for",
1688 "A break statement appears inside the body of a nested while or for "
1689 "statement. This is perfectly reasonable code, but check that "
1690 "the break is intended to break only the inner loop. The "
1691 "break statement may be preceded by /*@innerbreak@*/ to suppress "
1692 "the message for this break only.",
1693 0, 0
1694 },
1695 {
1696 FK_CONTROL, FK_NONE, modeFlag,
1697 "switchloopbreak",
1698 FLG_SWITCHLOOPBREAK,
1699 "break in loop inside switch",
1700 "A break statement appears inside the body of a while or for "
1701 "statement within a switch. This is perfectly reasonable code, but check that "
1702 "the break is intended to break only the inner loop. The "
1703 "break statement may be preceded by /*@loopbreak@*/ to suppress "
1704 "the message for this break only.",
1705 0, 0
1706 },
1707 {
1708 FK_CONTROL, FK_NONE, modeFlag,
1709 "loopswitchbreak",
1710 FLG_LOOPSWITCHBREAK,
1711 "break in switch inside loop",
1712 "A break statement appears inside a switch statement within a while or "
1713 "for loop. This is perfectly reasonable code, but check that "
1714 "the break is intended to break only the inner loop. The "
1715 "break statement may be preceded by /*@switchbreak@*/ to suppress "
1716 "the message for this break only.",
1717 0, 0
1718 },
1719 {
1720 FK_CONTROL, FK_NONE, modeFlag,
1721 "switchswitchbreak",
1722 FLG_SWITCHSWITCHBREAK,
1723 "break in switch inside switch",
1724 "A break statement appears inside a switch statement within another "
1725 "switch statement. This is perfectly reasonable code, but check that "
1726 "the break is intended to break only the inner switch. The "
1727 "break statement may be preceded by /*@innerbreak@*/ to suppress "
1728 "the message for this break only.",
1729 0, 0
1730 },
1731 {
1732 FK_CONTROL, FK_NONE, modeFlag,
1733 "looploopcontinue",
1734 FLG_LOOPLOOPCONTINUE,
1735 "continue inside nested loop",
1736 "A continue statement appears inside a loop within a loop. "
1737 "This is perfectly reasonable code, but check that "
1738 "the continue is intended to continue only the inner loop. The "
1739 "continue statement may be preceded by /*@innercontinue@*/ to suppress "
1740 "the message for this continue only.",
1741 0, 0
1742 },
1743
1744 /* 8.3.4 Loop and If Bodies */
1745
1746 {
1747 FK_CONTROL, FK_NONE, modeFlag,
1748 "whileempty",
1749 FLG_WHILEEMPTY,
1750 "a while statement has no body",
1751 "While statement has no body.",
1752 0, 0
1753 },
1754 {
1755 FK_CONTROL, FK_NONE, modeFlag,
1756 "whileblock",
1757 FLG_WHILEBLOCK,
1758 "the body of a while statement is not a block",
1759 "While body is a single statement, not a compound block.",
1760 0, 0
1761 },
1762 {
1763 FK_CONTROL, FK_NONE, modeFlag,
1764 "forempty",
1765 FLG_FOREMPTY,
1766 "a for statement has no body",
1767 "For statement has no body.",
1768 0, 0
1769 },
1770 {
1771 FK_CONTROL, FK_NONE, modeFlag,
1772 "forblock",
1773 FLG_FORBLOCK,
1774 "the body of a for statement is not a block",
1775 "Loop body is a single statement, not a compound block.",
1776 0, 0
1777 },
1778 {
1779 FK_CONTROL, FK_NONE, modeFlag,
1780 "ifempty",
1781 FLG_IFEMPTY,
1782 "an if statement has no body",
1783 "If statement has no body.",
1784 0, 0
1785 },
1786 {
1787 FK_CONTROL, FK_NONE, modeFlag,
1788 "ifblock",
1789 FLG_IFBLOCK,
1790 "the body of an if statement is not a block",
1791 "If body is a single statement, not a compound block.",
1792 0, 0
1793 },
1794 {
1795 FK_CONTROL, FK_NONE, specialFlag,
1796 "allempty",
1797 FLG_ALLEMPTY,
1798 "an if, while or for statement has no body (sets ifempty, "
1799 "whileempty and forempty",
1800 NULL,
1801 0, 0
1802 },
1803 {
1804 FK_CONTROL, FK_NONE, specialFlag,
1805 "allblock",
1806 FLG_ALLBLOCK,
1807 "the body of an if, while or for statement is not a block "
1808 "(sets ifblock, whileblock and forblock)",
1809 "Body is a single statement, not a compound block.",
1810 0, 0
1811 },
1812
1813 /* 8.3.5 Complete Logic */
1814
1815 {
1816 FK_CONTROL, FK_NONE, modeFlag,
1817 "elseifcomplete",
1818 FLG_ELSEIFCOMPLETE,
1819 "if ... else if chains must have final else",
1820 "There is no final else following an else if construct.",
1821 0, 0
1822 },
1823
1824 /* 8.4 Suspicious Statements */
1825
1826 {
1827 FK_CONTROL, FK_NONE, modeFlag,
1828 "unreachable",
1829 FLG_UNREACHABLE,
1830 "unreachable code detected",
1831 "This code will never be reached on any possible execution.",
1832 0, 0
1833 },
1834
1835 /* 8.4.1 Statements with No Effects */
1836
1837 {
1838 FK_EFFECT, FK_CONTROL, modeFlag,
1839 "noeffect",
1840 FLG_NOEFFECT,
1841 "statement with no effect",
1842 "Statement has no visible effect --- no values are modified.",
1843 0, 0
1844 },
1845 {
1846 FK_EFFECT, FK_CONTROL, modeFlag,
1847 "noeffectuncon",
1848 FLG_NOEFFECTUNCON,
1849 "statement with no effect (except possibly through call to "
1850 "unconstrained function)",
1851 "Statement has no visible effect --- no values are modified. It may "
1852 "modify something through a call to an unconstrained function.",
1853 0, 0
1854 },
1855
1856 /* 8.4.2 Ignored Return Values */
1857
1858 {
1859 FK_IGNORERET, FK_NONE, specialFlag,
1860 "retval",
1861 FLG_RETVAL,
1862 "return value ignored (sets retvalint, retvalbool and retvalother)",
1863 "Result returned by function call is not used. If this is intended, "
1864 "cast result to (void) to eliminate message.",
1865 0, 0
1866 },
1867 {
1868 FK_IGNORERET, FK_BOOL, modeFlag,
1869 "retvalother",
1870 FLG_RETVALOTHER,
1871 "return value of type other than bool or int ignored",
1872 "Result returned by function call is not used. If this is intended, "
1873 "can cast result to (void) to eliminate message.",
1874 0, 0
1875 },
1876 {
1877 FK_IGNORERET, FK_BOOL, modeFlag,
1878 "retvalbool",
1879 FLG_RETVALBOOL,
1880 "return value of manifest type bool ignored",
1881 "Result returned by function call is not used. If this is intended, "
1882 "can cast result to (void) to eliminate message.",
1883 0, 0
1884 },
1885 {
1886 FK_IGNORERET, FK_NONE, modeFlag,
1887 "retvalint",
1888 FLG_RETVALINT,
1889 "return value of type int ignored",
1890 "Result returned by function call is not used. If this is intended, "
1891 "can cast result to (void) to eliminate message.",
1892 0, 0
1893 },
1894
1895 /*
1896 ** 9. Buffer Sizes
1897 */
1898
1899 {
1900 FK_BOUNDS, FK_MEMORY, modeFlag,
1901 "nullterminated",
1902 FLG_NULLTERMINATED,
1903 "misuse of nullterminated allocation",
1904 "A possibly non-nullterminated string/memory is used/referenced as a nullterminated one.",
1905 0, 0
1906 },
1907 {
1908 FK_BOUNDS, FK_MEMORY, specialFlag,
1909 "bounds",
1910 FLG_BOUNDS,
1911 "memory bounds checking (sets boundsread and boundswrite)",
1912 "Memory read or write may be out of bounds of allocated storage.", 0, 0
1913 },
1914 {
1915 FK_BOUNDS, FK_MEMORY, specialFlag,
1916 "likelybounds",
1917 FLG_LIKELYBOUNDS,
1918 "memory bounds checking (sets likelyboundsread and likelyboundswrite)",
1919 "Memory read or write may be out of bounds of allocated storage.", 0, 0
1920 },
1921 {
1922 FK_BOUNDS, FK_MEMORY, modeFlag,
1923 "likelyboundsread",
1924 FLG_LIKELYBOUNDSREAD,
1925 "likely out of bounds read",
1926 "A memory read references memory beyond the allocated storage.",
1927 0, 0
1928 },
1929 {
1930 FK_BOUNDS, FK_MEMORY, modeFlag,
1931 "likelyboundswrite",
1932 FLG_LIKELYBOUNDSWRITE,
1933 "likely buffer overflow from an out of bounds write",
1934 "A memory write may write to an address beyond the allocated buffer.",
1935 0, 0
1936 },
1937
1938 {
1939 FK_BOUNDS, FK_MEMORY, modeFlag,
1940 "boundsread",
1941 FLG_BOUNDSREAD,
1942 "possible out of bounds read",
1943 "A memory read references memory beyond the allocated storage.",
1944 0, 0
1945 },
1946 {
1947 FK_BOUNDS, FK_MEMORY, modeFlag,
1948 "boundswrite",
1949 FLG_BOUNDSWRITE,
1950 "possible buffer overflow from an out of bounds write",
1951 "A memory write may write to an address beyond the allocated buffer.",
1952 0, 0
1953 },
1954
1955 {
1956 FK_BOUNDS, FK_DISPLAY, plainFlag,
1957 "fcnpost",
1958 FLG_FUNCTIONPOST,
1959 "display function post conditions",
1960 "Display function post conditions.",
1961 0, 0
1962 },
1963 {
1964 FK_BOUNDS, FK_DISPLAY, plainFlag,
1965 "redundantconstraints",
1966 FLG_REDUNDANTCONSTRAINTS,
1967 "display seemingly redundant constraints",
1968 "Display seemingly redundant constraints",
1969 0, 0
1970 },
1971 /*drl7x added 6/18/01 */
1972 {
1973 FK_BOUNDS, FK_MEMORY, modeFlag,
1974 "checkpost",
1975 FLG_CHECKPOST,
1976 "unable to verify predicate in ensures clause",
1977 "The function implementation may not satisfy a post condition given in an ensures clause.",
1978 0, 0
1979 },
1980
1981 {
1982 FK_BOUNDS, FK_MEMORY, plainFlag,
1983 "impboundsconstraints",
1984 FLG_IMPLICTCONSTRAINT,
1985 "generate implicit constraints for functions",
1986 NULL,
1987 0, 0
1988 },
1989 /*drl7x added 4/29/01 */
1990 {
1991 FK_BOUNDS, FK_MEMORY, plainFlag,
1992 "orconstraint",
1993 FLG_ORCONSTRAINT,
1994 "use limited OR expressions to resolve constraints",
1995 NULL,
1996 0, 0
1997 },
1998 {
1999 FK_BOUNDS, FK_DISPLAY, plainFlag,
2000 "showconstraintparens",
2001 FLG_PARENCONSTRAINT,
2002 "display parentheses around constraint terms",
2003 NULL,
2004 0, 0
2005 },
2006 /*drl added 2/4/2002*/
2007 {
2008 FK_BOUNDS, FK_DISPLAY, plainFlag,
2009 "boundscompacterrormessages",
2010 FLG_BOUNDSCOMPACTERRORMESSAGES,
2011 "Display fewer new lines in bounds checking error messages",
2012 NULL,
2013 0, 0
2014 },
2015 {
2016 FK_BOUNDS, FK_DISPLAY, plainFlag,
2017 "showconstraintlocation",
2018 FLG_CONSTRAINTLOCATION,
2019 "display location for every constraint generated",
2020 NULL,
2021 0, 0
2022 }, /*drl added flag 4/26/01*/
2023
2024 { /* evans added 2003-06-08 */
2025 FK_BOUNDS, FK_MEMORY, modeFlag,
2026 "allocmismatch",
2027 FLG_ALLOCMISMATCH,
2028 "type conversion involves storage of non-divisble size",
2029 NULL, 0, 0
2030 },
2031
2032 /*
2033 ** 10. Extensible Checking
2034 */
2035
2036 {
2037 FK_EXTENSIBLE, FK_FILES, globalStringFlag, ARG_FILE,
2038 "mts",
2039 FLG_MTSFILE,
2040 "load meta state declaration and corresponding xh file",
2041 NULL, 0, 0
2042 },
2043 {
2044 FK_EXTENSIBLE, FK_MEMORY, modeFlag,
2045 "statetransfer",
2046 FLG_STATETRANSFER,
2047 "storage has been transfered with invalid state",
2048 "Transfer violates user-defined state rules.",
2049 0, 0
2050 },
2051 {
2052 FK_EXTENSIBLE, FK_MEMORY, modeFlag,
2053 "statemerge",
2054 FLG_STATEMERGE,
2055 "control paths merge with storage in incompatible states",
2056 "Control path merge violates user-defined state merge rules.",
2057 0, 0
2058 },
2059
2060 /*
2061 ** 11. Macros
2062 */
2063
2064 {
2065 FK_MACROS, FK_NONE, modeFlag,
2066 "macroredef",
2067 FLG_MACROREDEF,
2068 "macro redefined",
2069 "A macro is defined in more than one place.", 0, 0
2070 },
2071 {
2072 FK_MACROS, FK_UNRECOG, modeFlag,
2073 "macrounrecog",
2074 FLG_MACROUNDEF,
2075 "unrecognized identifier in macro",
2076 "An unrecognized identifier appears in a macro. If the identifier "
2077 "is defined before the macro is used, then this is okay.",
2078 0, 0
2079 },
2080
2081 /* 11.1 Constant Macros */
2082
2083 {
2084 FK_MACROS, FK_PROTOS, modeFlag,
2085 "macroconstdecl",
2086 FLG_MACROCONSTDECL,
2087 "non-parameterized macro without prototype or specification",
2088 "Macro constant has no declaration. Use /*@constant ...@*/ to "
2089 "declare the macro.",
2090 0, 0
2091 },
2092
2093 /* 11.2 Function-like Macros */
2094
2095 {
2096 FK_MACROS, FK_NONE, modeFlag,
2097 "macrostmt",
2098 FLG_MACROSTMT,
2099 "macro definition is syntactically not equivalent to function",
2100 "A macro is defined in a way that may cause syntactic problems. "
2101 "If the macro returns a value, use commas to separate expressions; "
2102 "otherwise, use do { <macro body> } while (FALSE) construct.",
2103 0, 0
2104 },
2105 {
2106 FK_MACROS, FK_NONE, modeFlag,
2107 "macroempty",
2108 FLG_MACROEMPTY,
2109 "macro definition for is empty",
2110 "A macro definition has no body.",
2111 0, 0
2112 },
2113 {
2114 FK_MACROS, FK_PARAMS, modeFlag,
2115 "macroparams",
2116 FLG_MACROPARAMS,
2117 "macro parameter not used exactly once",
2118 "A macro parameter is not used exactly once in all possible "
2119 "invocations of the macro. To behave like a function, "
2120 "each macro parameter must be used exactly once on all "
2121 "invocations of the macro so that parameters with "
2122 "side-effects are evaluated exactly once. Use /*@sef@*/ to "
2123 "denote parameters that must be side-effect free.",
2124 0, 0
2125 },
2126 {
2127 FK_MACROS, FK_CONTROL, modeFlag,
2128 "macroret",
2129 FLG_MACRORETURN,
2130 "return statement in macro body",
2131 "The body of a macro declared as a function uses a return statement. "
2132 "This exhibits behavior that "
2133 "could not be implemented by a function.",
2134 0, 0
2135 },
2136 {
2137 FK_MACROS, FK_PARAMS, modeFlag,
2138 "macroassign",
2139 FLG_MACROASSIGN,
2140 "assignment to a macro parameter",
2141 "A macro parameter is used as the left side of an "
2142 "assignment expression. This exhibits behavior that "
2143 "could not be implemented by a function.",
2144 0, 0
2145 },
2146 {
2147 FK_MACROS, FK_NONE, modeFlag,
2148 "macroparens",
2149 FLG_MACROPARENS,
2150 "macro parameter used without parentheses (in potentially dangerous context)",
2151 "A macro parameter is used without parentheses. This could be "
2152 "dangerous if the macro is invoked with a complex expression "
2153 "and precedence rules will change the evaluation inside the macro.",
2154 0, 0
2155 },
2156 {
2157 FK_MACROS, FK_PROTOS, modeFlag,
2158 "macrodecl",
2159 FLG_MACRODECL,
2160 "macro without prototype or specification (sets macrofcndecl and macroconstdecl)",
2161 "Argument checking cannot be done well for macros without prototypes "
2162 "or specifications, since the types of the arguments are unknown.",
2163 0, 0
2164 },
2165 {
2166 FK_MACROS, FK_PROTOS, modeFlag,
2167 "macrofcndecl",
2168 FLG_MACROFCNDECL,
2169 "parameterized macro without prototype or specification",
2170 "Function macro has no declaration.",
2171 0, 0
2172 },
2173
2174 /* 11.2.1 Side Effect Free Parameters */
2175
2176 {
2177 FK_MACROS, FK_PARAMS, modeFlag,
2178 "sefparams",
2179 FLG_SEFPARAMS,
2180 "a parameter with side-effects is passed as a sef parameter",
2181 "An actual parameter corresponding to a sef parameter may have a side-effect.",
2182 0, 0
2183 },
2184 {
2185 FK_MACROS, FK_PARAMS, modeFlag,
2186 "sefuncon",
2187 FLG_SEFUNSPEC,
2188 "a parameter with unconstrained side-effects is passed as a sef parameter",
2189 "An actual parameter corresponding to a sef parameter involves a call "
2190 "to a procedure with no modifies clause that may have a side-effect.",
2191 0, 0
2192 },
2193
2194 /* 11.3 Controlling Macro Checking */
2195
2196 {
2197 FK_MACROS, FK_NONE, plainFlag,
2198 "constmacros",
2199 FLG_CONSTMACROS,
2200 "check all macros without parameter lists as constants",
2201 "Every non-parameterized macro (not preceded by /*@notfunction@*/) "
2202 "is checked as a constant.",
2203 0, 0
2204 },
2205 {
2206 FK_MACROS, FK_NONE, plainFlag,
2207 "fcnmacros",
2208 FLG_FCNMACROS,
2209 "check all macros with parameter lists as functions",
2210 "Every parameterized macro (not preceded by /*@notfunction@*/) "
2211 "is checked as a function.",
2212 0, 0
2213 },
2214 {
2215 FK_MACROS, FK_NONE, plainSpecialFlag,
2216 "allmacros",
2217 FLG_ALLMACROS,
2218 "sets fcnmacros and constmacros",
2219 "All macros (not preceded by /*@notfunction@*/) are checked as functions or "
2220 "constants depending on whether or not they have parameter lists.",
2221 0, 0
2222 },
2223 {
2224 FK_MACROS, FK_NONE, plainFlag,
2225 "libmacros",
2226 FLG_LIBMACROS,
2227 "check all macros with declarations in library as functions",
2228 "Every macro declared in the load library is checked.",
2229 0, 0
2230 },
2231 {
2232 FK_MACROS, FK_NONE, plainFlag,
2233 "specmacros",
2234 FLG_SPECMACROS,
2235 "check all macros corresponding to specified functions or constants",
2236 "Every macro declared a specification file is checked.",
2237 0, 0
2238 },
2239 {
2240 FK_MACROS, FK_NONE, modeFlag,
2241 "macromatchname",
2242 FLG_MACROMATCHNAME,
2243 "macro definition does not match iter or constant declaration",
2244 "A iter or constant macro is defined using a different name from the "
2245 "one used in the previous syntactic comment",
2246 0, 0
2247 },
2248 {
2249 FK_MACROS, FK_NONE, plainFlag,
2250 "nextlinemacros",
2251 FLG_MACRONEXTLINE,
2252 "the line after a constant or iter declaration must be a macro definition",
2253 "A constant or iter declaration is not immediately followed by a macro definition.",
2254 0, 0
2255 },
2256
2257 /* 11.4 Iterators */
2258
2259 {
2260 FK_ITER, FK_NONE, plainFlag,
2261 "iterbalance",
2262 FLG_ITERBALANCE,
2263 "iter is not balanced with end_<iter>",
2264 NULL,
2265 0, 0
2266 },
2267 {
2268 FK_ITER, FK_NONE, plainFlag,
2269 "iteryield",
2270 FLG_ITERYIELD,
2271 "iter yield parameter is inappropriate",
2272 NULL,
2273 0, 0
2274 },
2275 {
2276 FK_ITER, FK_NONE, plainFlag,
2277 "hasyield",
2278 FLG_HASYIELD,
2279 "iter declaration has no yield parameters",
2280 "An iterator has been declared with no parameters annotated with "
2281 "yield. This may be what you want, if the iterator is meant "
2282 "to do something a fixed number of times, but returns no "
2283 "information to the calling context. Probably, a parameter "
2284 "is missing the yield annotation to indicate that it is "
2285 "assigned a value in the calling context.",
2286 0, 0
2287 },
2288
2289 /*
2290 ** 12. Naming Conventions
2291 */
2292
2293 {
2294 FK_NAMES, FK_ABSTRACT, plainFlag,
2295 "namechecks",
2296 FLG_NAMECHECKS,
2297 "controls name checking without changing other settings",
2298 NULL, 0, 0
2299 },
2300
2301 /* 12.1.1 Czech Names */
2302
2303 {
2304 FK_NAMES, FK_ABSTRACT, specialFlag,
2305 "czech",
2306 FLG_CZECH,
2307 "czech naming convention (sets accessczech, czechfunctions, czechvars, "
2308 "czechconstants, czechenums, and czechmacros)",
2309 "Name is not consistent with Czech naming convention.", 0, 0
2310 },
2311 {
2312 FK_NAMES, FK_ABSTRACT, plainFlag,
2313 "czechfcns",
2314 FLG_CZECHFUNCTIONS,
2315 "czech naming convention violated in a function or iterator declaration",
2316 "Function or iterator name is not consistent with Czech naming convention.", 0, 0
2317 },
2318 {
2319 FK_NAMES, FK_ABSTRACT, plainFlag,
2320 "czechvars",
2321 FLG_CZECHVARS,
2322 "czech naming convention violated in a variable declaration",
2323 "Variable name is not consistent with Czech naming convention.", 0, 0
2324 },
2325 {
2326 FK_NAMES, FK_ABSTRACT, plainFlag,
2327 "czechmacros",
2328 FLG_CZECHMACROS,
2329 "czech naming convention violated in an expanded macro name",
2330 "Expanded macro name is not consistent with Czech naming convention.", 0, 0
2331 },
2332 {
2333 FK_NAMES, FK_ABSTRACT, plainFlag,
2334 "czechconsts",
2335 FLG_CZECHCONSTANTS,
2336 "czech naming convention violated in a constant declaration",
2337 "Constant name is not consistent with Czech naming convention.", 0, 0
2338 },
2339 {
2340 FK_NAMES, FK_ABSTRACT, plainFlag,
2341 "czechtypes",
2342 FLG_CZECHTYPES,
2343 "czech naming convention violated in a user-defined type definition",
2344 "Type name is not consistent with Czech naming convention. Czech type "
2345 "names must not use the underscore character.", 0, 0
2346 },
2347
2348 /* 12.1.2 Slovak Names */
2349
2350 {
2351 FK_NAMES, FK_ABSTRACT, specialFlag,
2352 "slovak",
2353 FLG_SLOVAK,
2354 "slovak naming convention violated",
2355 "Name is not consistent with Slovak naming convention.", 0, 0
2356 },
2357 {
2358 FK_NAMES, FK_ABSTRACT, plainFlag,
2359 "slovakfcns",
2360 FLG_SLOVAKFUNCTIONS,
2361 "slovak naming convention violated in a function or iterator declaration",
2362 "Function or iterator name is not consistent with Slovak naming convention.", 0, 0
2363 },
2364 {
2365 FK_NAMES, FK_ABSTRACT, plainFlag,
2366 "slovakmacros",
2367 FLG_SLOVAKMACROS,
2368 "slovak naming convention violated in an expanded macro name",
2369 "Expanded macro name is not consistent with Slovak naming convention.", 0, 0
2370 },
2371 {
2372 FK_NAMES, FK_ABSTRACT, plainFlag,
2373 "slovakvars",
2374 FLG_SLOVAKVARS,
2375 "slovak naming convention violated in a variable declaration",
2376 "Variable name is not consistent with Slovak naming convention.", 0, 0
2377 },
2378 {
2379 FK_NAMES, FK_ABSTRACT, plainFlag,
2380 "slovakconsts",
2381 FLG_SLOVAKCONSTANTS,
2382 "slovak naming convention violated in a constant declaration",
2383 "Constant name is not consistent with Slovak naming convention.", 0, 0
2384 },
2385 {
2386 FK_NAMES, FK_ABSTRACT, plainFlag,
2387 "slovaktypes",
2388 FLG_SLOVAKTYPES,
2389 "slovak naming convention violated in a use-defined type definition",
2390 "Type name is not consistent with Slovak naming convention. Slovak type "
2391 "names may not include uppercase letters.", 0, 0
2392 },
2393
2394 /* 12.1.3 Czechoslovak Names */
2395 {
2396 FK_NAMES, FK_ABSTRACT, specialFlag,
2397 "czechoslovak",
2398 FLG_CZECHOSLOVAK,
2399 "czech or slovak naming convention violated",
2400 "Name is not consistent with either Czech or Slovak naming convention.", 0, 0
2401 },
2402 {
2403 FK_NAMES, FK_ABSTRACT, plainFlag,
2404 "czechoslovakfcns",
2405 FLG_CZECHOSLOVAKFUNCTIONS,
2406 "czechoslovak naming convention violated in a function or iterator declaration",
2407 "Function name is not consistent with Czechoslovak naming convention.", 0, 0
2408 },
2409 {
2410 FK_NAMES, FK_ABSTRACT, plainFlag,
2411 "czechoslovakmacros",
2412 FLG_CZECHOSLOVAKMACROS,
2413 "czechoslovak naming convention violated in an expanded macro name",
2414 "Expanded macro name is not consistent with Czechoslovak naming convention.", 0, 0
2415 },
2416 {
2417 FK_NAMES, FK_ABSTRACT, plainFlag,
2418 "czechoslovakvars",
2419 FLG_CZECHOSLOVAKVARS,
2420 "czechoslovak naming convention violated in a variable declaration",
2421 "Variable name is not consistent with Czechoslovak naming convention.", 0, 0
2422 },
2423 {
2424 FK_NAMES, FK_ABSTRACT, plainFlag,
2425 "czechoslovakconsts",
2426 FLG_CZECHOSLOVAKCONSTANTS,
2427 "czechoslovak naming convention violated in a constant declaration",
2428 "Constant name is not consistent with Czechoslovak naming convention.", 0, 0
2429 },
2430 {
2431 FK_NAMES, FK_ABSTRACT, plainFlag,
2432 "czechoslovaktypes",
2433 FLG_CZECHOSLOVAKTYPES,
2434 "czechoslovak naming convention violated in a user-defined type definition",
2435 "Type name is not consistent with Czechoslovak naming convention. Czechoslovak "
2436 "type names may not include uppercase letters or the underscore character.", 0, 0
2437 },
2438
2439 /* 12.2 Namespace Prefixes */
2440
2441 {
2442 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2443 "macrovarprefix",
2444 FLG_MACROVARPREFIX,
2445 "set namespace prefix for variables declared in a macro body",
2446 "A variable declared in a macro body does not start with the macrovarprefix.",
2447 0, 0
2448 } ,
2449 {
2450 FK_NAMES, FK_PREFIX, plainFlag,
2451 "macrovarprefixexclude",
2452 FLG_MACROVARPREFIXEXCLUDE,
2453 "the macrovarprefix may not be used for non-macro variables",
2454 "A variable declared outside a macro body starts with the macrovarprefix.",
2455 0, 0
2456 } ,
2457 {
2458 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2459 "tagprefix",
2460 FLG_TAGPREFIX,
2461 "set namespace prefix for struct, union and enum tags",
2462 "A tag identifier does not start with the tagprefix.",
2463 0, 0
2464 } ,
2465 {
2466 FK_NAMES, FK_PREFIX, plainFlag,
2467 "tagprefixexclude",
2468 FLG_TAGPREFIXEXCLUDE,
2469 "the tagprefix may not be used for non-tag identifiers",
2470 "An identifier that is not a tag starts with the tagprefix.",
2471 0, 0
2472 } ,
2473 {
2474 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2475 "enumprefix",
2476 FLG_ENUMPREFIX,
2477 "set namespace prefix for enum members",
2478 "An enum member does not start with the enumprefix.",
2479 0, 0
2480 } ,
2481 {
2482 FK_NAMES, FK_PREFIX, plainFlag,
2483 "enumprefixexclude",
2484 FLG_ENUMPREFIXEXCLUDE,
2485 "the enumprefix may not be used for non-enum member identifiers",
2486 "An identifier that is not an enum member starts with the enumprefix.",
2487 0, 0
2488 } ,
2489 {
2490 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2491 "filestaticprefix",
2492 FLG_FILESTATICPREFIX,
2493 "set namespace prefix for file static declarations",
2494 "A file-static identifier does not start with the filestaticprefix.",
2495 0, 0
2496 } ,
2497 {
2498 FK_NAMES, FK_PREFIX, plainFlag,
2499 "filestaticprefixexclude",
2500 FLG_FILESTATICPREFIXEXCLUDE,
2501 "the filestaticprefix may not be used for identifiers that are not file static",
2502 "An identifier that is not file static starts with the filestaticprefix.",
2503 0, 0
2504 } ,
2505 {
2506 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2507 "globalprefix",
2508 FLG_GLOBPREFIX,
2509 "set namespace prefix for global variables",
2510 "A global variable does not start with the globalprefix",
2511 0, 0
2512 } ,
2513 {
2514 FK_NAMES, FK_PREFIX, plainFlag,
2515 "globalprefixexclude",
2516 FLG_GLOBPREFIXEXCLUDE,
2517 "the globalprefix may not be used for non-global identifiers",
2518 "An identifier that is not a global variable starts with the globalprefix.",
2519 0, 0
2520 } ,
2521 {
2522 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2523 "typeprefix",
2524 FLG_TYPEPREFIX,
2525 "set namespace prefix for user-defined types",
2526 "A user-defined type does not start with the typeprefix",
2527 0, 0
2528 } ,
2529 {
2530 FK_NAMES, FK_PREFIX, plainFlag,
2531 "typeprefixexclude",
2532 FLG_TYPEPREFIXEXCLUDE,
2533 "the typeprefix may not be used for identifiers that are not type names",
2534 "An identifier that is not a type name starts with the typeprefix.",
2535 0, 0
2536 } ,
2537 {
2538 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2539 "externalprefix",
2540 FLG_EXTERNALPREFIX,
2541 "set namespace prefix for external identifiers",
2542 "An external identifier does not start with the externalprefix",
2543 0, 0
2544 } ,
2545 {
2546 FK_NAMES, FK_PREFIX, plainFlag,
2547 "externalprefixexclude",
2548 FLG_EXTERNALPREFIXEXCLUDE,
2549 "the externalprefix may not be used for non-external identifiers",
2550 "An identifier that is not external starts with the externalprefix.",
2551 0, 0
2552 } ,
2553 {
2554 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2555 "localprefix",
2556 FLG_LOCALPREFIX,
2557 "set namespace prefix for local variables",
2558 "A local variable does not start with the localprefix",
2559 0, 0
2560 } ,
2561 {
2562 FK_NAMES, FK_PREFIX, plainFlag,
2563 "localprefixexclude",
2564 FLG_LOCALPREFIXEXCLUDE,
2565 "the localprefix may not be used for non-local identifiers",
2566 "An identifier that is not a local variable starts with the localprefix.",
2567 0, 0
2568 } ,
2569 {
2570 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2571 "uncheckedmacroprefix",
2572 FLG_UNCHECKEDMACROPREFIX,
2573 "set namespace prefix for unchecked macros",
2574 "An unchecked macro name does not start with the uncheckedmacroprefix",
2575 0, 0
2576 } ,
2577 {
2578 FK_NAMES, FK_PREFIX, plainFlag,
2579 "uncheckedmacroprefixexclude",
2580 FLG_UNCHECKEDMACROPREFIXEXCLUDE,
2581 "the uncheckmacroprefix may not be used for identifiers that are not "
2582 "unchecked macros",
2583 "An identifier that is not the name of an unchecked macro "
2584 "starts with the uncheckedmacroprefix.",
2585 0, 0
2586 } ,
2587 {
2588 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2589 "constprefix",
2590 FLG_CONSTPREFIX,
2591 "set namespace prefix for constants",
2592 "A constant does not start with the constantprefix",
2593 0, 0
2594 } ,
2595 {
2596 FK_NAMES, FK_PREFIX, plainFlag,
2597 "constprefixexclude",
2598 FLG_CONSTPREFIXEXCLUDE,
2599 "the constprefix may not be used for non-constant identifiers",
2600 "An identifier that is not a constant starts with the constantprefix.",
2601 0, 0
2602 } ,
2603 {
2604 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2605 "iterprefix",
2606 FLG_ITERPREFIX,
2607 "set namespace prefix for iterators",
2608 "An iter does not start with the iterator prefix",
2609 0, 0
2610 } ,
2611 {
2612 FK_NAMES, FK_PREFIX, plainFlag,
2613 "iterprefixexclude",
2614 FLG_ITERPREFIXEXCLUDE,
2615 "the iterprefix may not be used for non-iter identifiers",
2616 "An identifier that is not a iter starts with the iterprefix.",
2617 0, 0
2618 } ,
2619 {
2620 FK_NAMES, FK_PREFIX, idemStringFlag, ARG_STRING,
2621 "protoparamprefix",
2622 FLG_DECLPARAMPREFIX,
2623 "set namespace prefix for parameters in function prototype declarations",
2624 "A parameter name in a function prototype declaration does not start with the "
2625 "declaration parameter prefix",
2626 0, 0
2627 } ,
2628
2629 /* 12.3 Naming Restrictions */
2630 {
2631 FK_NAMES, FK_ANSI, modeFlag,
2632 "isoreserved",
2633 FLG_ISORESERVED,
2634 "external name conflicts with name reserved for system or standard library",
2635 "External name is reserved for system use by ISO C99 standard.",
2636 0, 0
2637 },
2638 {
2639 FK_NAMES, FK_ANSI, modeFlag,
2640 "cppnames",
2641 FLG_CPPNAMES,
2642 "external or internal name is a C++ keyword or reserved word",
2643 "External name is a C++ keyword or reserved word. "
2644 "This could lead to problems if the "
2645 "code is compiled with a C++ compiler.",
2646 0, 0
2647 },
2648 {
2649 FK_NAMES, FK_ANSI, modeFlag,
2650 "isoreservedinternal",
2651 FLG_ISORESERVEDLOCAL,
2652 "internal name conflicts with name reserved for system or standard library",
2653 "Internal name is reserved for system in ISO C99 standard (this should not be necessary unless you are worried about C library implementations that violate the standard and use macros).",
2654 0, 0
2655 },
2656 {
2657 FK_NAMES, FK_ANSI, plainFlag,
2658 "distinctexternalnames",
2659 FLG_DISTINCTEXTERNALNAMES,
2660 "external name is not distinguishable from another external name using "
2661 "the number of significant characters",
2662 "An external name is not distinguishable from another external name "
2663 "using the number of significant characters. According to "
2664 "ANSI Standard (3.1), an implementation may only consider the first 6 "
2665 "characters significant, and ignore alphabetical case "
2666 "distinctions (ISO C99 requires 31). The "
2667 "+externalnamelen <n> flag may be used to change the number "
2668 "of significant characters, and -externalnamecaseinsensitive to make "
2669 "alphabetical case significant in external names.",
2670 0, 0
2671 },
2672 {
2673 FK_NAMES, FK_ANSI, specialValueFlag,
2674 "externalnamelen",
2675 FLG_EXTERNALNAMELEN,
2676 "set the number of significant characters in an external name",
2677 "Sets the number of significant characters in an external name (default is 6 for old "
2678 "ANSI89 limit, C99 requires 31). "
2679 "Sets +distinctexternalnames.",
2680 0, 0
2681 },
2682 {
2683 FK_NAMES, FK_ANSI, plainSpecialFlag,
2684 "externalnamecaseinsensitive",
2685 FLG_EXTERNALNAMECASEINSENSITIVE,
2686 "alphabetic comparisons for external names are case-insensitive",
2687 "Make alphabetic case insignificant in external names. By ANSI89 "
2688 "standard, case need not be significant in an external name. "
2689 "If +distinctexternalnames is not set, sets "
2690 "+distinctexternalnames with unlimited external name length.",
2691 0, 0
2692 },
2693 {
2694 FK_NAMES, FK_ANSI, plainFlag,
2695 "distinctinternalnames",
2696 FLG_DISTINCTINTERNALNAMES,
2697 "internal name is not distinguishable from another internal name using "
2698 "the number of significant characters",
2699 "An internal name is not distinguishable from another internal name "
2700 "using the number of significant characters. According to "
2701 "ANSI89 Standard (3.1), an implementation may only consider the first 31 "
2702 "characters significant (ISO C99 specified 63). The "
2703 "+internalnamelen <n> flag changes the number "
2704 "of significant characters, -internalnamecaseinsensitive to makes "
2705 "alphabetical case significant, and "
2706 "+internalnamelookalike to make similar-looking characters "
2707 "non-distinct.",
2708 0, 0
2709 },
2710 {
2711 FK_NAMES, FK_ANSI, specialValueFlag,
2712 "internalnamelen",
2713 FLG_INTERNALNAMELEN,
2714 "set the number of significant characters in an internal name",
2715 "Sets the number of significant characters in an internal name (ANSI89 "
2716 "default is 31.) Sets +distinctinternalnames.",
2717 0, 0
2718 },
2719 {
2720 FK_NAMES, FK_ANSI, plainSpecialFlag,
2721 "internalnamecaseinsensitive",
2722 FLG_INTERNALNAMECASEINSENSITIVE,
2723 "set whether case is significant an internal names "
2724 "(-internalnamecaseinsensitive means case is significant)" ,
2725 "Set whether case is significant an internal names "
2726 "(-internalnamecaseinsensitive "
2727 "means case is significant). By ANSI89 default, case is not "
2728 "significant. If +distinctinternalnames is not set, sets "
2729 "+distinctinternalnames with unlimited internal name length.",
2730 0, 0
2731 },
2732 {
2733 FK_NAMES, FK_ANSI, plainSpecialFlag,
2734 "internalnamelookalike",
2735 FLG_INTERNALNAMELOOKALIKE,
2736 "lookalike characters match in internal names",
2737 "Set whether similar looking characters (e.g., \"1\" and \"l\") "
2738 "match in internal names.",
2739 0, 0
2740 },
2741 {
2742 FK_NAMES, FK_PREFIX, modeFlag,
2743 "protoparamname",
2744 FLG_DECLPARAMNAME,
2745 "a parameter in a function prototype has a name",
2746 "A parameter in a function prototype has a name. This is dangerous, "
2747 "since a macro definition could be visible here.",
2748 0, 0
2749 } ,
2750 {
2751 FK_NAMES, FK_PREFIX, modeFlag,
2752 "protoparammatch",
2753 FLG_DECLPARAMMATCH,
2754 "the name of a parameter in a function prototype and corresponding "
2755 "declaration must match (after removing the protoparamprefix",
2756 "A parameter in a function definition does not have the same name as "
2757 "the corresponding in the declaration of the function after "
2758 "removing the protoparamprefix",
2759 0, 0
2760 } ,
2761 {
2762 FK_NAMES, FK_PREFIX, plainFlag,
2763 "protoparamprefixexclude",
2764 FLG_DECLPARAMPREFIXEXCLUDE,
2765 "the protoparamprefix may not be used for non-declaraction parameter identifiers",
2766 "An identifier that is not a parameter name in a function prototype "
2767 "starts with the protoparamprefix.",
2768 0, 0
2769 } ,
2770
2771 /*
2772 ** 13. Completeness
2773 */
2774
2775 /* 13.1 Unused Declarations */
2776
2777 {
2778 FK_USE, FK_COMPLETE, modeFlag,
2779 "topuse",
2780 FLG_TOPUNUSED,
2781 "declaration at top level not used",
2782 "An external declaration not used in any source file.", 0, 0
2783 },
2784 {
2785 FK_USE, FK_EXPORT, modeFlag,
2786 "exportlocal",
2787 FLG_EXPORTLOCAL,
2788 "a declaration is exported but not used outside this module",
2789 "A declaration is exported, but not used outside this module. "
2790 "Declaration can use static qualifier.",
2791 0, 0
2792 },
2793 {
2794 FK_USE, FK_EXPORT, modeFlag,
2795 "exportheader",
2796 FLG_EXPORTHEADER,
2797 "a declaration is exported but does not appear in a header file",
2798 "A declaration is exported, but does not appear in a header file.",
2799 0, 0
2800 },
2801 {
2802 FK_USE, FK_EXPORT, modeFlag,
2803 "exportheadervar",
2804 FLG_EXPORTHEADERVAR,
2805 "a variable declaration is exported but does not appear in a header file",
2806 "A variable declaration is exported, but does not appear in a header "
2807 "file. (Used with exportheader.)",
2808 0, 0
2809 },
2810 {
2811 FK_USE, FK_NONE, modeFlag,
2812 "fielduse",
2813 FLG_FIELDUNUSED,
2814 "field of structure type not used",
2815 "A field is present in a structure type but never used. Use /*@unused@*/ in front of field declaration to suppress message.",
2816 0, 0
2817 },
2818 {
2819 FK_USE, FK_NONE, modeFlag,
2820 "enummemuse",
2821 FLG_ENUMMEMUNUSED,
2822 "member of an enum type not used",
2823 "A member of an enum type is never used.",
2824 0, 0
2825 },
2826 {
2827 FK_USE, FK_NONE, modeFlag,
2828 "constuse",
2829 FLG_CONSTUNUSED,
2830 "constant declared but not used",
2831 "A constant is declared but not used. Use unused in the constant declaration to suppress message.",
2832 0, 0
2833 },
2834 {
2835 FK_USE, FK_NONE, modeFlag,
2836 "fcnuse",
2837 FLG_FUNCUNUSED,
2838 "function declared but not used",
2839 "A function is declared but not used. Use /*@unused@*/ in front of function header to suppress message.",
2840 0, 0
2841 },
2842 {
2843 FK_USE, FK_PARAMS, modeFlag,
2844 "paramuse",
2845 FLG_PARAMUNUSED,
2846 "function parameter not used ",
2847 "A function parameter is not used in the body of the function. If the argument is needed for type compatibility or future plans, use /*@unused@*/ in the argument declaration.",
2848 0, 0
2849 },
2850 {
2851 FK_USE, FK_TYPE, modeFlag,
2852 "typeuse",
2853 FLG_TYPEUNUSED,
2854 "type declared but not used",
2855 "A type is declared but not used. Use /*@unused@*/ in front of typedef to suppress messages.",
2856 0, 0
2857 },
2858 {
2859 FK_USE, FK_NONE, modeFlag,
2860 "varuse",
2861 FLG_VARUNUSED,
2862 "variable declared but not used",
2863 "A variable is declared but never used. Use /*@unused@*/ in front "
2864 "of declaration to suppress message.",
2865 0, 0
2866 },
2867 {
2868 FK_USE, FK_COMPLETE, modeFlag,
2869 "unusedspecial",
2870 FLG_UNUSEDSPECIAL,
2871 "unused declaration in special file (corresponding to .l or .y file)",
2872 NULL, 0, 0
2873 } ,
2874
2875 /* 13.2 Complete Programs */
2876
2877 {
2878 FK_COMPLETE, FK_NONE, modeFlag,
2879 "declundef",
2880 FLG_DECLUNDEF,
2881 "function or variable declared but never defined",
2882 "A function or variable is declared, but not defined in any source code file.",
2883 0, 0
2884 },
2885 {
2886 FK_COMPLETE, FK_SPEC, modeFlag,
2887 "specundef",
2888 FLG_SPECUNDEF,
2889 "function or variable specified but never defined",
2890 "A function or variable is declared in an .lcl file, but not defined in any source code file.",
2891 0, 0
2892 },
2893 {
2894 FK_COMPLETE, FK_SPEC, plainFlag,
2895 "specundecl",
2896 FLG_SPECUNDECL,
2897 "function or variable specified but never declared in a source file",
2898 "A function or variable is declared in an .lcl file, but not declared "
2899 "in any source code file.",
2900 0, 0
2901 },
2902 {
2903 FK_DECL, FK_LIBS, plainFlag,
2904 "newdecl",
2905 FLG_NEWDECL,
2906 "report new global declarations in source files",
2907 "There is a new declaration that is not declared in a loaded library "
2908 "or earlier file. (Use this flag to check for consistency "
2909 "against a library.)",
2910 0, 0
2911 },
2912 {
2913 FK_INIT, FK_SPEC, plainFlag,
2914 "needspec",
2915 FLG_NEEDSPEC,
2916 "information in specifications is not also included in syntactic comments",
2917 "There is information in the specification that is not duplicated "
2918 "in syntactic comments. Normally, this is not an "
2919 "error, but it may be useful to detect it to make "
2920 "sure checking incomplete systems without the specifications will "
2921 "still use this information.",
2922 0, 0
2923 },
2924
2925 /*
2926 ** 14. Libraries and Header File Inclusion
2927 */
2928
2929 /* 14.1 Standard Libraries */
2930
2931 {
2932 FK_LIBS, FK_INIT, idemGlobalFlag,
2933 "nolib",
2934 FLG_NOLIB,
2935 "do not load standard library",
2936 NULL, 0, 0
2937 },
2938 {
2939 FK_LIBS, FK_INIT, idemGlobalFlag,
2940 "isolib",
2941 FLG_ANSILIB,
2942 "use normal standard library",
2943 "Library based on the ISO standard library specification is used.",
2944 0, 0
2945 },
2946 {
2947 FK_LIBS, FK_INIT, idemGlobalFlag,
2948 "strictlib",
2949 FLG_STRICTLIB,
2950 "interpret standard library strictly",
2951 "Stricter version of the standard library is used. (The default "
2952 "library is standard.lcd; strict library is strict.lcd.)",
2953 0, 0
2954 },
2955 {
2956 FK_LIBS, FK_INIT, idemGlobalFlag,
2957 "unixlib",
2958 FLG_UNIXLIB,
2959 "use UNIX (sort-of) standard library",
2960 "UNIX version of the standard library is used.",
2961 0, 0
2962 },
2963 {
2964 FK_LIBS, FK_INIT, idemGlobalFlag,
2965 "unixstrictlib",
2966 FLG_UNIXSTRICTLIB,
2967 "use strict version of UNIX (sort-of) library",
2968 "strict version of the UNIX library is used.",
2969 0, 0
2970 },
2971 {
2972 FK_LIBS, FK_INIT, idemGlobalFlag,
2973 "posixlib",
2974 FLG_POSIXLIB,
2975 "use POSIX standard library",
2976 "POSIX version of the standard library is used.",
2977 0, 0
2978 },
2979 {
2980 FK_LIBS, FK_INIT, idemGlobalFlag,
2981 "posixstrictlib",
2982 FLG_POSIXSTRICTLIB,
2983 "use strict POSIX standard library",
2984 "POSIX version of the strict standard library is used.",
2985 0, 0
2986 },
2987 {
2988 FK_LIBS, FK_INIT, idemGlobalFlag,
2989 "whichlib",
2990 FLG_WHICHLIB,
2991 "show standard library filename",
2992 NULL, 0, 0
2993 },
2994 {
2995 FK_LIBS, FK_ANSI, plainFlag,
2996 "warnposixheaders",
2997 FLG_WARNPOSIX,
2998 "a POSIX header is included, but the POSIX library is not used",
2999 "Header name matches a POSIX header, but the POSIX library is not selected.",
3000 0, 0
3001 },
3002 {
3003 FK_LIBS, FK_ANSI, plainFlag,
3004 "warnunixlib",
3005 FLG_WARNUNIXLIB,
3006 "warn when the unix library is used",
3007 "Unix library may not be compatible with all platforms",
3008 0, 0
3009 },
3010 {
3011 FK_LIBS, FK_ANSI, plainFlag,
3012 "usevarargs",
3013 FLG_USEVARARGS,
3014 "non-standard <varargs.h> included",
3015 "Header <varargs.h> is not part of ANSI Standard. "
3016 "Should use <stdarg.h> instead.",
3017 0, 0
3018 },
3019 {
3020 FK_HEADERS, FK_FILES, plainFlag,
3021 "caseinsensitivefilenames",
3022 FLG_CASEINSENSITIVEFILENAMES,
3023 "file names are case insensitive (file.h and FILE.H are the same file)",
3024 NULL, 0, 0
3025 },
3026
3027 /* 14.2 Generating Libraries */
3028
3029 {
3030 FK_LIBS, FK_FILES, globalStringFlag, ARG_FILE,
3031 "dump",
3032 FLG_DUMP,
3033 "save state for merging (default suffix .lcd)",
3034 NULL, 0, 0
3035 },
3036 {
3037 FK_LIBS, FK_FILES, globalStringFlag, ARG_FILE,
3038 "load",
3039 FLG_MERGE,
3040 "load state from dump file (default suffix .lcd)",
3041 NULL, 0, 0
3042 },
3043
3044 /* 14.3 Header File Inclusion */
3045
3046 {
3047 FK_HEADERS, FK_SPEED, globalFlag,
3048 "singleinclude",
3049 FLG_SINGLEINCLUDE,
3050 "optimize header inclusion to eliminate redundant includes",
3051 "When checking multiple files, each header file is processed only "
3052 "once. This may change the meaning of the code, if the "
3053 "same header file is included in different contexts (e.g., the "
3054 "header file includes #if directives and the values are "
3055 "different when it is included in different places.)",
3056 0, 0
3057 },
3058 {
3059 FK_HEADERS, FK_SPEED, globalFlag,
3060 "neverinclude",
3061 FLG_NEVERINCLUDE,
3062 "optimize header inclusion to not include any header files",
3063 "Ignore header includes. Only works if relevant information is "
3064 "loaded from a library.",
3065 0, 0
3066 },
3067 {
3068 FK_HEADERS, FK_SPEED, globalFlag,
3069 "skipsysheaders",
3070 FLG_SKIPSYSHEADERS,
3071 "do not include header files in system directories (set by -sysdirs)",
3072 "Do not include header files in system directories (set by -sysdirs)",
3073 0, 0
3074 },
3075
3076 /*
3077 ** A. Operation?
3078 */
3079
3080
3081 /*
3082 ** Syntax
3083 */
3084
3085 {
3086 FK_SYNTAX, FK_ANSI, plainFlag,
3087 "gnuextensions",
3088 FLG_GNUEXTENSIONS,
3089 "support some gnu (gcc) language extensions",
3090 "ANSI C does not allow some language features supported by gcc and other compilers. "
3091 "Use +gnuextensions to allow some of these extensions.", 0, 0
3092 },
3093
3094 /* Prototypes */
3095
3096 {
3097 FK_PROTOS, FK_ANSI, modeFlag,
3098 "noparams",
3099 FLG_NOPARAMS,
3100 "function declaration has no parameter list",
3101 "A function declaration does not have a parameter list.",
3102 0, 0
3103 },
3104 {
3105 FK_PROTOS, FK_ANSI, modeFlag,
3106 "oldstyle",
3107 FLG_OLDSTYLE,
3108 "old style function definition",
3109 "Function definition is in old style syntax. Standard prototype "
3110 "syntax is preferred.",
3111 0, 0
3112 },
3113
3114
3115 /*
3116 ** System functions
3117 */
3118
3119 {
3120 FK_SYSTEMFUNCTIONS, FK_TYPE, plainFlag,
3121 "maintype",
3122 FLG_MAINTYPE,
3123 "type of main does not match expected type",
3124 "The function main does not match the expected type.",
3125 0, 0
3126 },
3127 {
3128 FK_SYSTEMFUNCTIONS, FK_BEHAVIOR, modeFlag,
3129 "exitarg",
3130 FLG_EXITARG,
3131 "argument to exit has implementation defined behavior",
3132 "The argument to exit should be 0, EXIT_SUCCESS or EXIT_FAILURE",
3133 0, 0
3134 },
3135
3136 {
3137 FK_DECL, FK_NONE, modeFlag,
3138 "shadow",
3139 FLG_SHADOW,
3140 "declaration reuses name visible in outer scope",
3141 "An outer declaration is shadowed by the local declaration.",
3142 0, 0
3143 },
3144 {
3145 FK_DECL, FK_LIBS, modeFlag,
3146 "incondefslib",
3147 FLG_INCONDEFSLIB,
3148 "function, variable or constant defined in a library is redefined with inconsistent type",
3149 "A function, variable or constant previously defined in a library is "
3150 "redefined with a different type.",
3151 0, 0
3152 },
3153 {
3154 FK_DECL, FK_LIBS, modeFlag,
3155 "overload",
3156 FLG_WARNOVERLOAD,
3157 "library function overloaded",
3158 "A function, variable or constant defined in the library is redefined "
3159 "with a different type.",
3160 0, 0
3161 },
3162 {
3163 FK_DECL, FK_NONE, modeFlag,
3164 "nestedextern",
3165 FLG_NESTEDEXTERN,
3166 "an extern declaration is inside a function scope",
3167 "An extern declaration is used inside a function scope.",
3168 0, 0
3169 },
3170 {
3171 FK_DECL, FK_NONE, modeFlag,
3172 "redecl",
3173 FLG_REDECL,
3174 "function or variable redeclared",
3175 "A function or variable is declared in more than one place. This is "
3176 "not necessarily a problem, since the declarations are consistent.",
3177 0, 0
3178 },
3179 {
3180 FK_DECL, FK_NONE, plainFlag,
3181 "redef",
3182 FLG_REDEF,
3183 "function or variable redefined",
3184 "A function or variable is redefined. One of the declarations should use extern.",
3185 0, 0
3186 },
3187 {
3188 FK_DECL, FK_TYPE, modeFlag,
3189 "imptype",
3190 FLG_IMPTYPE,
3191 "variable declaration has unknown (implicitly int) type",
3192 "A variable declaration has no explicit type. The type is implicitly int.",
3193 0, 0
3194 },
3195
3196 {
3197 FK_DIRECT, FK_FILES, globalStringFlag, ARG_DIRECTORY,
3198 "tmpdir",
3199 FLG_TMPDIR,
3200 "set directory for writing temp files",
3201 NULL, 0, 0
3202 },
3203 {
3204 FK_DIRECT, FK_FILES, globalStringFlag, ARG_PATH,
3205 "larchpath",
3206 FLG_LARCHPATH,
3207 "set path for searching for library files (overrides LARCH_PATH environment variable)",
3208 NULL, 0, 0
3209 },
3210 {
3211 FK_DIRECT, FK_FILES, globalStringFlag, ARG_DIRECTORY,
3212 "lclimportdir",
3213 FLG_LCLIMPORTDIR,
3214 "set directory to search for LCL import files (overrides LCLIMPORTDIR)",
3215 NULL, 0, 0
3216 },
3217 {
3218 FK_DIRECT, FK_FILES, globalStringFlag, ARG_PATH,
3219 "sysdirs",
3220 FLG_SYSTEMDIRS,
3221 "set directories for system files (default /usr/include). Separate "
3222 "directories with path separator (colons in Unix, semi-colons in Windows). "
3223 "Flag settings propagate to files in a system directory. If "
3224 "-sysdirerrors is set, no errors are reported for files in "
3225 "system directories.",
3226 NULL, 0, 0
3227 },
3228 {
3229 FK_DIRECT, FK_FILES, plainFlag,
3230 "skipisoheaders",
3231 FLG_SKIPISOHEADERS,
3232 "prevent inclusion of header files in a system directory with "
3233 "names that match standard ANSI headers. The symbolic information "
3234 "in the standard library is used instead. Flag in effect only "
3235 "if a library including the ANSI library is loaded. The ANSI "
3236 "headers are: assert, ctype, errno, float, limits, locale, math, "
3237 "setjmp, signal, stdarg, stddef, stdio, stdlib, strings, string, "
3238 "time, and wchar.",
3239 NULL, 0, 0
3240 },
3241 {
3242 FK_DIRECT, FK_FILES, plainFlag,
3243 "skipposixheaders",
3244 FLG_SKIPPOSIXHEADERS,
3245 "prevent inclusion of header files in a system directory with "
3246 "names that match standard POSIX headers. The symbolic information "
3247 "in the posix library is used instead. The POSIX headers are: "
3248 "dirent, fcntl, grp, pwd, termios, sys/stat, sys/times, "
3249 "sys/types, sys/utsname, sys/wait, unistd, and utime.",
3250 NULL, 0, 0
3251 },
3252 {
3253 FK_DIRECT, FK_SUPPRESS, modeFlag,
3254 "sysdirerrors",
3255 FLG_SYSTEMDIRERRORS,
3256 "report errors in files in system directories (set by -sysdirs)",
3257 NULL, 0, 0
3258 },
3259 {
3260 FK_DIRECT, FK_MACROS, plainFlag,
3261 "sysdirexpandmacros",
3262 FLG_SYSTEMDIREXPAND,
3263 "expand macros in system directories regardless of other settings, "
3264 "except for macros corresponding to names defined in a load library",
3265 NULL, 0, 0
3266 },
3267
3268 {
3269 FK_DIRECT, FK_HEADERS, globalExtraArgFlag,
3270 "I<directory>",
3271 FLG_INCLUDEPATH,
3272 "add to C include path",
3273 NULL, 0, 0
3274 },
3275 {
3276 FK_DIRECT, FK_SPEC, globalExtraArgFlag,
3277 "S<directory>",
3278 FLG_SPECPATH,
3279 "add to spec path",
3280 NULL, 0, 0
3281 },
3282 {
3283 FK_EXPORT, FK_SPEC, specialFlag,
3284 "exportany",
3285 FLG_EXPORTANY,
3286 "variable, function or type exported but not specified",
3287 "A variable, function or type is exported, but not specified.",
3288 0, 0
3289 },
3290 {
3291 FK_EXPORT, FK_SPEC, modeFlag,
3292 "exportfcn",
3293 FLG_EXPORTFCN,
3294 "function exported but not specified",
3295 "A function is exported, but not specified.", 0, 0
3296 },
3297 {
3298 FK_EXPORT, FK_SPEC, modeFlag,
3299 "exportmacro",
3300 FLG_EXPORTMACRO,
3301 "expanded macro exported but not specified",
3302 "A macro is exported, but not specified.", 0, 0
3303 },
3304 {
3305 FK_EXPORT, FK_SPEC, modeFlag,
3306 "exporttype",
3307 FLG_EXPORTTYPE,
3308 "type definition exported but not specified",
3309 "A type is exported, but not specified.", 0, 0
3310 },
3311 {
3312 FK_EXPORT, FK_SPEC, modeFlag,
3313 "exportvar",
3314 FLG_EXPORTVAR,
3315 "variable exported but not specified",
3316 "A variable is exported, but not specified.", 0, 0
3317 },
3318 {
3319 FK_EXPORT, FK_SPEC, modeFlag,
3320 "exportconst",
3321 FLG_EXPORTCONST,
3322 "constant exported but not specified",
3323 "A constant is exported, but not specified.", 0, 0
3324 },
3325 {
3326 FK_EXPORT, FK_SPEC, modeFlag,
3327 "exportiter",
3328 FLG_EXPORTITER,
3329 "constant exported but not specified",
3330 "A constant is exported, but not specified.", 0, 0
3331 },
3332
3333 {
3334 FK_FORMAT, FK_DISPLAY, valueFlag,
3335 "linelen",
3336 FLG_LINELEN,
3337 "set length of messages (number of chars)",
3338 NULL, 0, 0
3339 },
3340 {
3341 FK_FORMAT, FK_DISPLAY, valueFlag,
3342 "indentspaces",
3343 FLG_INDENTSPACES,
3344 "set number of spaces to indent sub-messages",
3345 NULL, 0, 0
3346 },
3347 {
3348 FK_FORMAT, FK_DISPLAY, valueFlag,
3349 "locindentspaces",
3350 FLG_LOCINDENTSPACES,
3351 "set number of spaces to indent sub-messages that start with file locations",
3352 NULL, 0, 0
3353 },
3354 {
3355 FK_FORMAT, FK_DISPLAY, plainFlag,
3356 "showdeephistory",
3357 FLG_SHOWDEEPHISTORY,
3358 "show all available information about storage mentioned in warnings",
3359 NULL, 0, 0
3360 },
3361 {
3362 FK_FORMAT, FK_DISPLAY, plainFlag,
3363 "showcolumn",
3364 FLG_SHOWCOL,
3365 "show column number where error is found",
3366 NULL, 0, 0
3367 },
3368 {
3369 FK_FORMAT, FK_DISPLAY, plainFlag,
3370 "showloadloc",
3371 FLG_SHOWLOADLOC,
3372 "show location information for load files",
3373 NULL, 0, 0
3374 },
3375 {
3376 FK_FORMAT, FK_DISPLAY, globalFileFlag,
3377 "csv",
3378 FLG_CSV,
3379 "produce comma-separated values (CSV) warnings output file",
3380 NULL, 0, 0
3381 },
3382 {
3383 FK_FORMAT, FK_DISPLAY, plainFlag,
3384 "csvoverwrite",
3385 FLG_CSVOVERWRITE,
3386 "overwrite exisiting CVS output file",
3387 NULL, 0, 0
3388 },
3389 {
3390 FK_FORMAT, FK_DISPLAY, plainFlag,
3391 "parenfileformat",
3392 FLG_PARENFILEFORMAT,
3393 "show column number where error is found",
3394 NULL, 0, 0
3395 },
3396 {
3397 FK_FORMAT, FK_DISPLAY, plainFlag,
3398 "htmlfileformat",
3399 FLG_HTMLFILEFORMAT,
3400 "show file locations as links",
3401 NULL, 0, 0
3402 },
3403 {
3404 FK_FORMAT, FK_NONE, plainFlag,
3405 "showfunc",
3406 FLG_SHOWFUNC,
3407 "show name of function containing error",
3408 NULL, 0, 0
3409 },
3410 {
3411 FK_FORMAT, FK_NONE, plainFlag,
3412 "showallconjs",
3413 FLG_SHOWALLCONJS,
3414 "show all possible types",
3415 "When a library function is declared with multiple possible type, the "
3416 "alternate types are shown only if +showallconjs.",
3417 0, 0
3418 },
3419 {
3420 FK_LIBS, FK_NONE, plainFlag,
3421 "impconj",
3422 FLG_IMPCONJ,
3423 "make all alternate types implicit (useful for making system libraries",
3424 NULL, 0, 0
3425 } ,
3426 {
3427 FK_GLOBAL, FK_ERRORS, globalValueFlag,
3428 "expect",
3429 FLG_EXPECT,
3430 "expect <int> code errors",
3431 NULL, 0, 0
3432 },
3433 {
3434 FK_GLOBAL, FK_ERRORS, globalValueFlag,
3435 "lclexpect",
3436 FLG_LCLEXPECT,
3437 "expect <int> spec errors",
3438 NULL, 0, 0
3439 },
3440 {
3441 FK_GLOBAL, FK_USE, idemSpecialFlag,
3442 "partial",
3443 FLG_PARTIAL,
3444 "check as partial system (-specundef, -declundef, -exportlocal, "
3445 "don't check macros in headers without corresponding .c files)",
3446 NULL, 0, 0
3447 },
3448
3449 /*
3450 ** Appendix D. Specifications
3451 */
3452
3453 {
3454 FK_HEADERS, FK_SPEC, globalFlag,
3455 "lh",
3456 FLG_DOLH,
3457 "generate .lh files", NULL,
3458 0, 0
3459 },
3460 {
3461 FK_HEADERS, FK_SPEC, globalFlag,
3462 "lcs",
3463 FLG_DOLCS,
3464 "generate .lcs files", NULL,
3465 0, 0
3466 },
3467
3468 /*
3469 ** 1. Operation
3470 */
3471
3472 {
3473 FK_HELP, FK_NONE, plainFlag,
3474 "warnflags",
3475 FLG_WARNFLAGS,
3476 "warn when command line sets flag in abnormal way",
3477 "Command line sets flag in abnormal way",
3478 0, 0
3479 },
3480 {
3481 FK_HELP, FK_NONE, plainFlag,
3482 "warnrc",
3483 FLG_WARNRC,
3484 "warn when there are problems with reading the initialization files",
3485 "There was a problem reading an initialization file",
3486 0, 0
3487 },
3488 {
3489 FK_HELP, FK_NONE, plainFlag,
3490 "badflag",
3491 FLG_BADFLAG,
3492 "warn about bad command line flags",
3493 "A flag is not recognized or used in an incorrect way",
3494 0, 0
3495 },
3496 {
3497 FK_HELP, FK_NONE, plainFlag,
3498 "fileextensions",
3499 FLG_FILEEXTENSIONS,
3500 "warn when command line file does not have a recognized extension",
3501 NULL, 0, 0
3502 },
3503 {
3504 FK_HELP, FK_NONE, globalExtraArgFlag,
3505 "help",
3506 FLG_HELP,
3507 "-help <flags> will describe flags",
3508 "Display help",
3509 0, 0
3510 },
3511 {
3512 FK_INIT, FK_FILES, globalFileFlag,
3513 "f",
3514 FLG_OPTF,
3515 "read an options file (default ~/.splintrc not loaded)",
3516 "Read an options file (instead of loading default ~/.splintc)",
3517 0, 0
3518 },
3519 {
3520 FK_INIT, FK_FILES, globalFileFlag,
3521 "i",
3522 FLG_INIT,
3523 "set LCL initilization file",
3524 NULL, 0, 0
3525 },
3526 {
3527 FK_INIT, FK_FILES, globalFlag,
3528 "nof",
3529 FLG_NOF,
3530 "do not read options file",
3531 "Do not read the default options file (~/.splintrc)",
3532 0, 0
3533 },
3534 {
3535 FK_INIT, FK_COMMENTS, charFlag,
3536 "commentchar",
3537 FLG_COMMENTCHAR,
3538 "set marker character for syntactic comments (default is '@')",
3539 "Set the marker character for syntactic comments. Comments beginning "
3540 "with /*<char> are interpreted by Splint, where <char> is the "
3541 "comment marker character.",
3542 0, 0
3543 },
3544
3545 /*
3546 ** Limits
3547 */
3548
3549 {
3550 FK_LIMITS, FK_ANSI, modeValueFlag,
3551 "controlnestdepth",
3552 FLG_CONTROLNESTDEPTH,
3553 "set maximum nesting depth of compound statements, iteration control "
3554 "structures, and selection control structures (ANSI89 minimum is 15; ISO99 is 63)",
3555 "Maximum number of control levels exceeded.",
3556 0, 0
3557 },
3558 {
3559 FK_LIMITS, FK_ANSI, modeValueFlag,
3560 "stringliterallen",
3561 FLG_STRINGLITERALLEN,
3562 "set maximum length of string literals (ANSI89 minimum is 509; ISO99 is 4095)",
3563 "Maximum length of string literal exceeded.",
3564 0, 0
3565 },
3566 {
3567 FK_LIMITS, FK_ANSI, modeValueFlag,
3568 "numstructfields",
3569 FLG_NUMSTRUCTFIELDS,
3570 "set maximum number of fields in a struct or union (ANSI89 minimum is 127; ISO99 is 1023)",
3571 "Maximum number of fields in a struct or union exceeded.",
3572 0, 0
3573 },
3574 {
3575 FK_LIMITS, FK_ANSI, modeValueFlag,
3576 "numenummembers",
3577 FLG_NUMENUMMEMBERS,
3578 "set maximum number of members of an enum (ANSI89 minimum is 127; ISO99 is 1023)",
3579 "Limit on maximum number of members of an enum is exceeded.",
3580 0, 0
3581 },
3582 {
3583 FK_LIMITS, FK_ANSI, modeValueFlag,
3584 "includenest",
3585 FLG_INCLUDENEST,
3586 "set maximum number of nested #include files (ANSI89 minimum is 8; ISO99 is 63)",
3587 "Maximum number of nested #include files exceeded.",
3588 0, 0
3589 },
3590 {
3591 FK_LIMITS, FK_ANSI, specialFlag,
3592 "ansi89limits",
3593 FLG_ANSI89LIMITS,
3594 "check for violations of standard limits (controlnestdepth, "
3595 "stringliterallen, includenest, numstructfields, numenummembers) based on ANSI89 standard",
3596 NULL,
3597 0, 0
3598 },
3599 {
3600 FK_LIMITS, FK_ANSI, specialFlag,
3601 "iso99limits",
3602 FLG_ISO99LIMITS,
3603 "check for violations of standard limits (controlnestdepth, "
3604 "stringliterallen, includenest, numstructfields, numenummembers) based on ISO99 standard",
3605 NULL,
3606 0, 0
3607 },
3608
3609 {
3610 FK_PREPROC, FK_NONE, globalExtraArgFlag,
3611 "D<initializer>",
3612 FLG_DEFINE,
3613 "passed to pre-processor",
3614 NULL, 0, 0
3615 },
3616 {
3617 FK_PREPROC, FK_NONE, globalExtraArgFlag,
3618 "U<initializer>",
3619 FLG_UNDEFINE,
3620 "passed to pre-processor",
3621 NULL, 0, 0
3622 },
3623 {
3624 FK_PREPROC, FK_SYNTAX, plainFlag,
3625 "unrecogdirective",
3626 FLG_UNRECOGDIRECTIVE,
3627 "unrecognized pre-processor directive",
3628 "Pre-processor directive is not recognized.",
3629 0, 0
3630 },
3631 {
3632 FK_SUPPRESS, FK_COMMENTS, globalFlag,
3633 "supcounts",
3634 FLG_SUPCOUNTS,
3635 "The number of errors detected does not match number in /*@i<n>@*/.",
3636 NULL, 0, 0
3637 },
3638 {
3639 FK_SUPPRESS, FK_ERRORS, valueFlag,
3640 "limit",
3641 FLG_LIMIT,
3642 "limit <int> consecutive repeated errors",
3643 NULL, 0, 0
3644 },
3645 {
3646 FK_SYNTAX, FK_NONE, plainFlag,
3647 "syntax",
3648 FLG_SYNTAX,
3649 "syntax error in parsing",
3650 "Code cannot be parsed. For help on parse errors, see splint -help parseerrors.",
3651 0, 0
3652 },
3653 {
3654 FK_SYNTAX, FK_NONE, plainFlag,
3655 "trytorecover",
3656 FLG_TRYTORECOVER,
3657 "try to recover from parse error",
3658 "Try to recover from parse error. It really means try - this doesn't usually work.", 0, 0
3659 },
3660 {
3661 FK_SYNTAX, FK_PREPROC, plainFlag,
3662 "preproc",
3663 FLG_PREPROC,
3664 "preprocessing error",
3665 "Preprocessing error.",
3666 0, 0
3667 },
3668
3669 {
3670 FK_TYPE, FK_NONE, plainFlag,
3671 "type",
3672 FLG_TYPE,
3673 "type mismatch",
3674 "Types are incompatible.",
3675 0, 0
3676 },
3677
3678 {
3679 FK_TYPE, FK_NONE, plainFlag,
3680 "stringliteraltoolong",
3681 FLG_STRINGLITTOOLONG,
3682 "string literal too long for character array",
3683 "A string literal is assigned to a char array too small to hold it.",
3684 0, 0
3685 },
3686 {
3687 FK_TYPE, FK_NONE, modeFlag,
3688 "stringliteralnoroomfinalnull",
3689 FLG_STRINGLITNOROOMFINALNULL,
3690 "string literal leaves no room for null terminator",
3691 "A string literal is assigned to a char array that is not big enough to hold the final null terminator. This may not be a problem because a null character has been explictedly included in the string literal using an escape sequence",
3692 0, 0
3693 },
3694 {
3695 FK_TYPE, FK_NONE, modeFlag,
3696 "stringliteralnoroom",
3697 FLG_STRINGLITNOROOM,
3698 "string literal leaves no room for null terminator",
3699 "A string literal is assigned to a char array that is not big enough to hold the null terminator.",
3700 0, 0
3701 },
3702 {
3703 FK_TYPE, FK_NONE, modeFlag,
3704 "stringliteralsmaller",
3705 FLG_STRINGLITSMALLER,
3706 "string literal is smaller than the char array it is assigned to",
3707 "A string literal is assigned to a char array that smaller than the string literal needs.",
3708 0, 0
3709 },
3710 {
3711 FK_TYPE, FK_NONE, modeFlag,
3712 "enummembers",
3713 FLG_ENUMMEMBERS,
3714 "enum members must be int values",
3715 "Type of initial values for enum members must be int.",
3716 0, 0
3717 },
3718
3719 {
3720 FK_TYPE, FK_NONE, plainFlag,
3721 "formattype",
3722 FLG_FORMATTYPE,
3723 "type-mismatch in parameter corresponding to format code in a printf or scanf-like function",
3724 "Type of parameter is not consistent with corresponding code in format string.",
3725 0, 0
3726 },
3727 {
3728 FK_TYPE, FK_NONE, modeFlag,
3729 "formatconst",
3730 FLG_FORMATCONST,
3731 "format parameter is not a string constant (hence variable arguments cannot be typechecked)",
3732 "Format parameter is not known at compile-time. This can lead to security vulnerabilities because the arguments cannot be type checked.",
3733 0, 0
3734 },
3735 {
3736 FK_TYPE, FK_NONE, plainFlag,
3737 "formatcode",
3738 FLG_FORMATCODE,
3739 "invalid format code in format string for printf or scanf-like function",
3740 "Format code in a format string is not valid.",
3741 0, 0
3742 },
3743 {
3744 FK_TYPEEQ, FK_ABSTRACT, modeFlag,
3745 "forwarddecl",
3746 FLG_FORWARDDECL,
3747 "forward declarations of pointers to abstract representation match abstract type",
3748 NULL, 0, 0
3749 },
3750 {
3751 FK_TYPEEQ, FK_ABSTRACT, modeFlag,
3752 "voidabstract",
3753 FLG_ABSTVOIDP,
3754 "void * matches pointers to abstract types, casting ok (dangerous)",
3755 "A pointer to void is cast to a pointer to an abstract type (or vice versa).",
3756 0, 0
3757 },
3758 {
3759 FK_TYPEEQ, FK_POINTER, plainFlag,
3760 "castfcnptr",
3761 FLG_CASTFCNPTR,
3762 "a pointer to a function is cast to a pointer to void (or vice versa)",
3763 "A pointer to a function is cast to (or used as) a pointer to void (or vice versa).",
3764 0, 0
3765 },
3766 {
3767 FK_TYPEEQ, FK_ARRAY, modeFlag,
3768 "charindex",
3769 FLG_CHARINDEX,
3770 "char can be used to index arrays",
3771 "To allow char types to index arrays, use +charindex.", 0, 0
3772 },
3773 {
3774 FK_TYPEEQ, FK_ARRAY, modeFlag,
3775 "enumindex",
3776 FLG_ENUMINDEX,
3777 "enum can be used to index arrays",
3778 "To allow enum types to index arrays, use +enumindex.", 0, 0
3779 },
3780 {
3781 FK_TYPEEQ, FK_BOOL, modeFlag,
3782 "boolint",
3783 FLG_BOOLINT,
3784 "bool and int are equivalent",
3785 "To make bool and int types equivalent, use +boolint.",
3786 0, 0
3787 },
3788 {
3789 FK_TYPEEQ, FK_NONE, modeFlag,
3790 "charint",
3791 FLG_CHARINT,
3792 "char and int are equivalent",
3793 "To make char and int types equivalent, use +charint.",
3794 0, 0
3795 },
3796 {
3797 FK_TYPEEQ, FK_NONE, modeFlag,
3798 "enumint",
3799 FLG_ENUMINT,
3800 "enum and int are equivalent",
3801 "To make enum and int types equivalent, use +enumint.",
3802 0, 0
3803 },
3804 {
3805 FK_TYPEEQ, FK_NONE, modeFlag,
3806 "longint",
3807 FLG_LONGINT,
3808 "long int and int are equivalent",
3809 "To make long int and int types equivalent, use +longint.",
3810 0, 0
3811 },
3812 {
3813 FK_TYPEEQ, FK_NONE, modeFlag,
3814 "shortint",
3815 FLG_SHORTINT,
3816 "short int and int are equivalent",
3817 "To make short int and int types equivalent, use +shortint.",
3818 0, 0
3819 },
3820 {
3821 FK_TYPEEQ, FK_NONE, modeFlag,
3822 "floatdouble",
3823 FLG_FLOATDOUBLE,
3824 "float and double are equivalent",
3825 "To make float and double types equivalent, use +floatdouble.",
3826 0, 0
3827 },
3828 {
3829 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3830 "ignorequals",
3831 FLG_IGNOREQUALS,
3832 "ignore type qualifiers (long, short, unsigned)",
3833 "To ignore type qualifiers in type comparisons use +ignorequals.",
3834 0, 0
3835 },
3836 {
3837 FK_TYPEEQ, FK_SYNTAX, plainFlag,
3838 "duplicatequals",
3839 FLG_DUPLICATEQUALS,
3840 "report duplicate type qualifiers (e.g., unsigned unsigned)",
3841 "Duplicate type qualifiers not supported by ISO standard.",
3842 0, 0
3843 },
3844 {
3845 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3846 "ignoresigns",
3847 FLG_IGNORESIGNS,
3848 "ignore signs in type comparisons (unsigned matches signed)",
3849 "To ignore signs in type comparisons use +ignoresigns",
3850 0, 0
3851 },
3852 {
3853 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3854 "numliteral",
3855 FLG_NUMLITERAL,
3856 "int literals can be reals",
3857 "An int literal is used as any numeric type (including float and long long). Use +numliteral to "
3858 "allow int literals to be used as any numeric type.",
3859 0, 0
3860 },
3861 {
3862 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3863 "charintliteral",
3864 FLG_CHARINTLITERAL,
3865 "character constants (e.g., 'a') can be used as ints",
3866 "A character constant is used as an int. Use +charintliteral to "
3867 "allow character constants to be used as ints. (This is safe "
3868 "since the actual type of a char constant is int.)",
3869 0, 0
3870 },
3871 {
3872 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3873 "relaxquals",
3874 FLG_RELAXQUALS,
3875 "report qualifier mismatches only if dangerous",
3876 "To allow qualifier mismatches that are not dangerous, use +relaxquals.", 0, 0
3877 },
3878 {
3879 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3880 "relaxtypes",
3881 FLG_RELAXTYPES,
3882 "allow all numeric types to match",
3883 "To allow all numeric types to match, use +relaxtypes.", 0, 0
3884 },
3885 {
3886 FK_TYPEEQ, FK_NONE, modeFlag,
3887 "charunsignedchar",
3888 FLG_CHARUNSIGNEDCHAR,
3889 "allow char and unsigned char types to match",
3890 "To allow char and unsigned char types to match use +charunsignedchar.",
3891 0, 0
3892 },
3893 {
3894 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3895 "matchanyintegral",
3896 FLG_MATCHANYINTEGRAL,
3897 "allow any intergral type to match an arbitrary integral type (e.g., dev_t)",
3898 "To allow arbitrary integral types to match any integral type, use +matchanyintegral.",
3899 0, 0
3900 },
3901 {
3902 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3903 "longunsignedintegral",
3904 FLG_LONGUNSIGNEDINTEGRAL,
3905 "allow long unsigned type to match an arbitrary integral type (e.g., dev_t)",
3906 "To allow arbitrary integral types to match long unsigned, use +longunsignedintegral.",
3907 0, 0
3908 },
3909 {
3910 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3911 "longintegral",
3912 FLG_LONGINTEGRAL,
3913 "allow long type to match an arbitrary integral type (e.g., dev_t)",
3914 "To allow arbitrary integral types to match long unsigned, use +longintegral.",
3915 0, 0
3916 },
3917 {
3918 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3919 "longunsignedunsignedintegral",
3920 FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL,
3921 "allow long unsigned type to match an arbitrary unsigned integral type (e.g., size_t)",
3922 "To allow arbitrary unsigned integral types to match long unsigned, "
3923 "use +longunsignedunsignedintegral.",
3924 0, 0
3925 },
3926 {
3927 FK_TYPEEQ, FK_NUMBERS, modeFlag,
3928 "longsignedintegral",
3929 FLG_LONGSIGNEDINTEGRAL,
3930 "allow long type to match an arbitrary signed integral type (e.g., ssize_t)",
3931 "To allow arbitrary signed integral types to match long unsigned, use +longsignedintegral.",
3932 0, 0
3933 },
3934 {
3935 FK_TYPEEQ, FK_POINTER, plainFlag,
3936 "zeroptr",
3937 FLG_ZEROPTR,
3938 "treat 0 as a pointer",
3939 NULL, 0, 0
3940 },
3941 {
3942 FK_TYPEEQ, FK_BOOL, modeFlag,
3943 "zerobool",
3944 FLG_ZEROBOOL,
3945 "treat 0 as a boolean",
3946 NULL, 0, 0
3947 },
3948 {
3949 FK_UNRECOG, FK_DISPLAY, plainFlag,
3950 "repeatunrecog",
3951 FLG_REPEATUNRECOG,
3952 "do not suppress repeated unrecognized identifier messages (instead of only reporting the first error)",
3953 "Identifier used in code has not been declared. (Message repeated for future uses in this file.)",
3954 0, 0
3955 },
3956 {
3957 FK_UNRECOG, FK_DISPLAY, plainFlag,
3958 "sysunrecog",
3959 FLG_SYSTEMUNRECOG,
3960 "report unrecognized identifiers with system (__) prefix",
3961 "Identifier used in code has not been declared. (Message repeated for "
3962 "future uses in this file.) Use +gnuextensions to make Splint "
3963 "recognize some keywords that are gnu extensions.",
3964 0, 0
3965 },
3966 {
3967 FK_UNRECOG, FK_NONE, plainFlag,
3968 "unrecog",
3969 FLG_UNRECOG,
3970 "unrecognized identifier",
3971 "Identifier used in code has not been declared.", 0, 0
3972 },
3973
3974
3975 {
3976 FK_DECL, FK_TYPE, plainFlag,
3977 "annotationerror",
3978 FLG_ANNOTATIONERROR,
3979 "annotation is used in inconsistent location",
3980 "A declaration uses an invalid annotation.",
3981 0, 0
3982 } ,
3983 {
3984 FK_DECL, FK_TYPE, plainFlag,
3985 "commenterror",
3986 FLG_COMMENTERROR,
3987 "inconsistent syntactic comment",
3988 "A syntactic comment is used inconsistently.",
3989 0, 0
3990 } ,
3991
3992 /*
3993 ** Use Warnings
3994 */
3995
3996 {
3997 FK_WARNUSE, FK_NONE, plainFlag,
3998 "warnuse",
3999 FLG_WARNUSE,
4000 "warn when declaration marked with warn is used",
4001 "Declaration marked with warn clause is used (can be suppresed by more specific flags).",
4002 0, 0
4003 },
4004 {
4005 FK_WARNUSE, FK_SECURITY, modeFlag,
4006 "bufferoverflow",
4007 FLG_BUFFEROVERFLOW,
4008 "possible buffer overflow vulnerability",
4009 "Use of function that may lead to buffer overflow.",
4010 0, 0
4011 },
4012 {
4013 FK_WARNUSE, FK_SECURITY, modeFlag,
4014 "bufferoverflowhigh",
4015 FLG_BUFFEROVERFLOWHIGH,
4016 "likely buffer overflow vulnerability",
4017 "Use of function that may lead to buffer overflow.",
4018 0, 0
4019 },
4020 {
4021 FK_WARNUSE, FK_SECURITY, modeFlag,
4022 "implementationoptional",
4023 FLG_IMPLEMENTATIONOPTIONAL,
4024 "declarator is implementation optional (ISO99 does not require an implementation to provide it)",
4025 "Use of a declarator that is implementation optional, not required by ISO99.",
4026 0, 0
4027 },
4028 {
4029 FK_WARNUSE, FK_NONE, modeFlag,
4030 "legacy",
4031 FLG_LEGACY,
4032 "legacy declaration in Unix Standard",
4033 "Use of a declarator that is marked as a legacy entry in the Unix Standard.",
4034 0, 0
4035 },
4036 {
4037 FK_WARNUSE, FK_SECURITY, modeFlag,
4038 "multithreaded",
4039 FLG_MULTITHREADED,
4040 "function is not reentrant",
4041 "Non-reentrant function should not be used in multithreaded code.",
4042 0, 0
4043 },
4044 {
4045 FK_WARNUSE, FK_SECURITY, modeFlag,
4046 "portability",
4047 FLG_PORTABILITY,
4048 "function may have undefined behavior",
4049 "Use of function that may have implementation-dependent behavior.",
4050 0, 0
4051 },
4052 {
4053 FK_WARNUSE, FK_SECURITY, modeFlag,
4054 "superuser",
4055 FLG_SUPERUSER,
4056 "function is restricted to superusers",
4057 "Call to function restricted to superusers.",
4058 0, 0
4059 },
4060 {
4061 FK_WARNUSE, FK_SECURITY, modeFlag,
4062 "toctou",
4063 FLG_TOCTOU,
4064 "possible time of check, time of use vulnerability",
4065 "Possible time of check, time of use vulnerability.",
4066 0, 0
4067 },
4068 {
4069 FK_WARNUSE, FK_SECURITY, modeFlag,
4070 "unixstandard",
4071 FLG_UNIXSTANDARD,
4072 "function is not required in Standard UNIX Specification",
4073 "Use of function that need not be provided by UNIX implementations",
4074 0, 0
4075 },
4076
4077 /*
4078 ** ITS4 Compability Flags
4079 **
4080 ** These flags flags must appear in order (most severe -> weakest).
4081 */
4082
4083 {
4084 FK_ITS4, FK_SECURITY, specialFlag,
4085 "its4mostrisky",
4086 FLG_ITS4MOSTRISKY,
4087 "most risky security vulnerabilities (from its4 database)",
4088 "Security vulnerability classified as most risky in its4 database.",
4089 0, 0
4090 },
4091 {
4092 FK_ITS4, FK_SECURITY, specialFlag,
4093 "its4veryrisky",
4094 FLG_ITS4VERYRISKY,
4095 "very risky security vulnerabilities (from its4 database)",
4096 "Security vulnerability classified as very risky in its4 database.",
4097 0, 0
4098 },
4099 {
4100 FK_ITS4, FK_SECURITY, specialFlag,
4101 "its4risky",
4102 FLG_ITS4RISKY,
4103 "risky security vulnerabilities (from its4 database)",
4104 "Security vulnerability classified as risky in its4 database.",
4105 0, 0
4106 },
4107 {
4108 FK_ITS4, FK_SECURITY, specialFlag,
4109 "its4moderate",
4110 FLG_ITS4MODERATERISK,
4111 "moderately risky security vulnerabilities (from its4 database)",
4112 "Security vulnerability classified as moderate risk in its4 database.",
4113 0, 0
4114 },
4115 {
4116 FK_ITS4, FK_SECURITY, specialFlag,
4117 "its4low",
4118 FLG_ITS4LOWRISK,
4119 "risky security vulnerabilities (from its4 database)",
4120 "Security vulnerability classified as risky in its4 database.",
4121 0, 0
4122 },
4123
4124 /*
4125 ** Syntactic comments
4126 */
4127
4128 {
4129 FK_SYNCOMMENTS, FK_SUPPRESS, plainFlag,
4130 "nocomments",
4131 FLG_NOCOMMENTS,
4132 "ignore all stylized comments",
4133 NULL, 0, 0
4134 },
4135 {
4136 FK_SYNCOMMENTS, FK_ABSTRACT, plainFlag,
4137 "noaccess",
4138 FLG_NOACCESS,
4139 "ignore access comments",
4140 NULL, 0, 0
4141 },
4142
4143 {
4144 FK_SYNCOMMENTS, FK_SYNTAX, plainFlag,
4145 "unrecogcomments",
4146 FLG_UNRECOGCOMMENTS,
4147 "stylized comment is unrecognized",
4148 "Word after a stylized comment marker does not correspond to a "
4149 "stylized comment.",
4150 0, 0
4151 },
4152 {
4153 FK_SYNCOMMENTS, FK_SYNTAX, plainFlag,
4154 "unrecogflagcomments",
4155 FLG_UNRECOGFLAGCOMMENTS,
4156 "stylized flag comment uses an unrecognized flag",
4157 "Semantic comment attempts to set a flag that is not recognized.",
4158 0, 0
4159 },
4160 {
4161 FK_SYNCOMMENTS, FK_SUPPRESS, modeFlag,
4162 "tmpcomments",
4163 FLG_TMPCOMMENTS,
4164 "interpret t comments (ignore errors in lines marked with /*@t<n>@*/",
4165 NULL, 0, 0
4166 },
4167 {
4168 FK_SYNCOMMENTS, FK_SUPPRESS, plainFlag,
4169 "lintcomments",
4170 FLG_LINTCOMMENTS,
4171 "interpret traditional lint comments (/*FALLTHROUGH*/, /*NOTREACHED*/)",
4172 NULL, 0, 0
4173 },
4174 {
4175 FK_SYNCOMMENTS, FK_SUPPRESS, modeFlag,
4176 "warnlintcomments",
4177 FLG_WARNLINTCOMMENTS,
4178 "warn when a traditional lint comment is used",
4179 "A traditional lint comment is used. Some traditional lint comments "
4180 "are interpreted by Splint to enable easier checking of legacy "
4181 "code. It is preferable to replace these comments with the "
4182 "suggested Splint alternative.",
4183 0, 0
4184 },
4185
4186 /*
4187 ** Comments
4188 */
4189
4190 {
4191 FK_COMMENTS, FK_SYNTAX, plainFlag,
4192 "continuecomment",
4193 FLG_CONTINUECOMMENT,
4194 "line continuation marker (\\) in comment before */ on same line",
4195 "A line continuation marker (\\) appears inside a comment on the same "
4196 "line as the comment close. Preprocessors should handle this "
4197 "correctly, but it causes problems for some preprocessors.",
4198 0, 0
4199 },
4200 {
4201 FK_COMMENTS, FK_SYNTAX, plainFlag,
4202 "slashslashcomment",
4203 FLG_SLASHSLASHCOMMENT,
4204 "use of // comment",
4205 "A // comment is used. ISO C99 allows // comments, but earlier standards did not.",
4206 0, 0
4207 },
4208 {
4209 FK_COMMENTS, FK_SYNTAX, plainFlag,
4210 "nestcomment",
4211 FLG_NESTCOMMENT,
4212 "comment begins inside comment",
4213 "A comment open sequence (/*) appears within a comment. This usually "
4214 "means an earlier comment was not closed.",
4215 0, 0
4216 },
4217
4218 /*
4219 ** Flags for controlling warning message printing.
4220 */
4221
4222 /* Display */
4223
4224 {
4225 FK_DISPLAY, FK_ERRORS, plainFlag,
4226 "quiet",
4227 FLG_QUIET,
4228 "suppress herald and error count",
4229 NULL, 0, 0
4230 },
4231
4232 /*
4233 ** Default is to send messages, warnings and errors to stderr
4234 */
4235
4236 {
4237 FK_DISPLAY, FK_ERRORS, idemGlobalFlag,
4238 "messagestreamstdout",
4239 FLG_MESSAGESTREAMSTDOUT,
4240 "send status messages to standard output stream",
4241 NULL, 0, 0
4242 },
4243 {
4244 FK_DISPLAY, FK_ERRORS, idemGlobalFlag,
4245 "messagestreamstderr",
4246 FLG_MESSAGESTREAMSTDERR,
4247 "send status messages to standard error stream",
4248 NULL, 0, 0
4249 },
4250 {
4251 FK_DISPLAY, FK_ERRORS, globalStringFlag, ARG_FILE,
4252 "messagestream",
4253 FLG_MESSAGESTREAM,
4254 "send status messages to <file>",
4255 NULL, 0, 0
4256 },
4257
4258 {
4259 FK_DISPLAY, FK_ERRORS, idemGlobalFlag,
4260 "warningstreamstdout",
4261 FLG_WARNINGSTREAMSTDOUT,
4262 "send warnings to standard output stream",
4263 NULL, 0, 0
4264 },
4265 {
4266 FK_DISPLAY, FK_ERRORS, idemGlobalFlag,
4267 "warningstreamstderr",
4268 FLG_WARNINGSTREAMSTDERR,
4269 "send warnings to standard error stream",
4270 NULL, 0, 0
4271 },
4272 {
4273 FK_DISPLAY, FK_ERRORS, globalStringFlag, ARG_FILE,
4274 "warningstream",
4275 FLG_WARNINGSTREAM,
4276 "send warnings to <file>",
4277 NULL, 0, 0
4278 },
4279
4280 {
4281 FK_DISPLAY, FK_ERRORS, idemGlobalFlag,
4282 "errorstreamstdout",
4283 FLG_ERRORSTREAMSTDOUT,
4284 "send fatal errors to standard output stream",
4285 NULL, 0, 0
4286 },
4287 {
4288 FK_DISPLAY, FK_ERRORS, idemGlobalFlag,
4289 "errorstreamstderr",
4290 FLG_ERRORSTREAMSTDERR,
4291 "send fatal errors to standard error stream",
4292 NULL, 0, 0
4293 },
4294 {
4295 FK_DISPLAY, FK_ERRORS, globalStringFlag, ARG_FILE,
4296 "errorstream",
4297 FLG_ERRORSTREAM,
4298 "send fatal errors to <file>",
4299 NULL, 0, 0
4300 },
4301
4302 {
4303 FK_DISPLAY, FK_ERRORS, globalFlag,
4304 "streamoverwrite",
4305 FLG_STREAMOVERWRITE,
4306 "warn and exit if a stream output file would overwrite an existing file",
4307 NULL, 0, 0
4308 },
4309
4310
4311 {
4312 FK_DISPLAY, FK_ERRORS, plainFlag,
4313 "showsummary",
4314 FLG_SHOWSUMMARY,
4315 "show summary of all errors reported and suppressed",
4316 NULL, 0, 0
4317 },
4318 {
4319 FK_DISPLAY, FK_FILES, plainFlag,
4320 "showscan",
4321 FLG_SHOWSCAN,
4322 "show file names are they are processed",
4323 NULL, 0, 0
4324 },
4325 {
4326 FK_DISPLAY, FK_FILES, plainFlag,
4327 "warnsysfiles",
4328 FLG_WARNSYSFILES,
4329 "Splint has been run on a system file, by default no errors are reported for system files. Use +systemdirerrors if you want splint to report errors in system files. A file is considered a system file if it is in a system directory or a subdirectory of a system directory. The sysdirs flag can be used to control the directories treated as system directories.",
4330 NULL, 0, 0
4331 },
4332 {
4333 FK_DISPLAY, FK_NONE, globalFlag,
4334 "stats",
4335 FLG_STATS,
4336 "display lines processed and time",
4337 NULL, 0, 0
4338 },
4339 {
4340 FK_DISPLAY, FK_NONE, globalFlag,
4341 "timedist",
4342 FLG_TIMEDIST,
4343 "display time distribution",
4344 NULL, 0, 0
4345 },
4346 {
4347 FK_DISPLAY, FK_USE, globalFlag,
4348 "showalluses",
4349 FLG_SHOWUSES,
4350 "show sorted list of uses of all globals",
4351 NULL, 0, 0
4352 },
4353
4354 /* Hints */
4355
4356 {
4357 FK_HINTS, FK_FORMAT, plainFlag,
4358 "hints",
4359 FLG_HINTS,
4360 "provide a hint the first time a particular warning appears",
4361 "Provide a hint the first time a particular warning appears",
4362 0, 0
4363 },
4364 {
4365 FK_HINTS, FK_FORMAT, plainFlag,
4366 "forcehints",
4367 FLG_FORCEHINTS,
4368 "provide a hint for every warnings",
4369 "Provide a hint for every warning",
4370 0, 0
4371 },
4372
4373 /*
4374 ** Flags for debugging
4375 */
4376
4377 {
4378 FK_DEBUG, FK_NONE, valueFlag,
4379 "bugslimit",
4380 FLG_BUGSLIMIT,
4381 "set maximum number of bugs detected before giving up",
4382 NULL, 0, 0
4383 },
4384 {
4385 FK_DEBUG, FK_BOUNDS, plainFlag,
4386 "debugfcnconstraint",
4387 FLG_DEBUGFUNCTIONCONSTRAINT,
4388 "debug function constraints",
4389 "Perform buffer overflow checking even if the errors would be surpressed.",
4390 0, 0
4391 },
4392 {
4393 FK_DEBUG, FK_NONE, specialDebugFlag,
4394 "grammar",
4395 FLG_GRAMMAR,
4396 "debug parsing", NULL,
4397 0, 0
4398 },
4399 {
4400 FK_DEBUG, FK_NONE, debugFlag,
4401 "keep",
4402 FLG_KEEP,
4403 "do not delete temporary files", NULL,
4404 0, 0
4405 },
4406 {
4407 FK_DEBUG, FK_NONE, debugFlag,
4408 "nopp",
4409 FLG_NOPP,
4410 "do not pre-process input files", NULL,
4411 0, 0
4412 },
4413 {
4414 FK_DEBUG, FK_NONE, debugFlag,
4415 "showsourceloc",
4416 FLG_SHOWSOURCELOC,
4417 "display the source code location where a warning is produced", NULL,
4418 0, 0
4419 },
4420} ;
4421
4422
This page took 0.104087 seconds and 5 git commands to generate.