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