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