File: preds.expect

package info (click to toggle)
splint 3.1.2.dfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 12,908 kB
  • ctags: 15,816
  • sloc: ansic: 150,306; yacc: 3,463; sh: 3,426; makefile: 2,218; lex: 412
file content (69 lines) | stat: -rw-r--r-- 3,737 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69

preds.c: (in function f)
preds.c:10:7: Test expression for if not bool, type int: *p
  Test expression type is not boolean or int. (Use -predboolint to inhibit
  warning)
preds.c:15:8: Operand of ! is non-boolean (int): !(*p)
  The operand of a boolean operator is not a boolean. Use +ptrnegate to allow !
  to be used on pointers. (Use -boolops to inhibit warning)
preds.c:20:7: Test expression for if is assignment expression: b1 = b2
  The condition test is an assignment expression. Probably, you mean to use ==
  instead of =. If an assignment is intended, add an extra parentheses nesting
  (e.g., if ((a = b)) ...) to suppress this message. (Use -predassign to
  inhibit warning)
preds.c:25:7: Test expression for if not bool, type char: (c = 'a')
  Test expression type is not boolean. (Use -predboolothers to inhibit warning)
preds.c:30:7: Use of == with bool variables (risks inconsistency because of
                 multiple true values): b1 == b2
  Two bool values are compared directly using a C primitive. This may produce
  unexpected results since all non-zero values are considered true, so
  different true values may not be equal. The file bool.h (included in
  splint/lib) provides bool_equal for safe bool comparisons. (Use -boolcompare
  to inhibit warning)
preds.c:35:7: Test expression for if not bool, type char: c

Finished checking --- 6 code warnings, as expected

preds.c: (in function f)
preds.c:20:7: Test expression for if is assignment expression: b1 = b2
  The condition test is an assignment expression. Probably, you mean to use ==
  instead of =. If an assignment is intended, add an extra parentheses nesting
  (e.g., if ((a = b)) ...) to suppress this message. (Use -predassign to
  inhibit warning)

Finished checking --- 1 code warning, as expected

bool.h:11:25: Constant exported, but not specified: FALSE
  A constant is exported, but not specified. (Use -exportconst to inhibit
  warning)
bool.h:16:25: Constant exported, but not specified: TRUE
preds.c: (in function f)
preds.c:5:8: Operand of ! is non-boolean (int *): !p
  The operand of ! operator is a pointer. (Use +ptrnegate to inhibit warning)
preds.c:10:7: Test expression for if not bool, type int: *p
  Test expression type is not boolean or int. (Use -predboolint to inhibit
  warning)
preds.c:15:8: Operand of ! is non-boolean (int): !(*p)
  The operand of a boolean operator is not a boolean. Use +ptrnegate to allow !
  to be used on pointers. (Use -boolops to inhibit warning)
preds.c:20:7: Test expression for if is assignment expression: b1 = b2
  The condition test is an assignment expression. Probably, you mean to use ==
  instead of =. If an assignment is intended, add an extra parentheses nesting
  (e.g., if ((a = b)) ...) to suppress this message. (Use -predassign to
  inhibit warning)
preds.c:25:7: Test expression for if not bool, type char: (c = 'a')
  Test expression type is not boolean. (Use -predboolothers to inhibit warning)
preds.c:30:7: Use of == with bool variables (risks inconsistency because of
                 multiple true values): b1 == b2
  Two bool values are compared directly using a C primitive. This may produce
  unexpected results since all non-zero values are considered true, so
  different true values may not be equal. The file bool.h (included in
  splint/lib) provides bool_equal for safe bool comparisons. (Use -boolcompare
  to inhibit warning)
preds.c:35:7: Test expression for if not bool, type char: c
preds.c:3:5: Function f declared but not used
  A function is declared but not used. Use /*@unused@*/ in front of function
  header to suppress message. (Use -fcnuse to inhibit warning)
   preds.c:41:1: Definition of f

Finished checking --- 10 code warnings, as expected