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