]> andersk Git - splint.git/blame - test/preds.expect
Committing Evans's update of man page to fix problems reported by ESR.
[splint.git] / test / preds.expect
CommitLineData
885824d3 1
2preds.c: (in function f)
3preds.c:10:7: Test expression for if not bool, type int: *p
2e127cb8 4 Test expression type is not boolean or int. (Use -predboolint to inhibit
5 warning)
885824d3 6preds.c:15:8: Operand of ! is non-boolean (int): !(*p)
7 The operand of a boolean operator is not a boolean. Use +ptrnegate to allow !
2e127cb8 8 to be used on pointers. (Use -boolops to inhibit warning)
885824d3 9preds.c:20:7: Test expression for if is assignment expression: b1 = b2
10 The condition test is an assignment expression. Probably, you mean to use ==
11 instead of =. If an assignment is intended, add an extra parentheses nesting
2e127cb8 12 (e.g., if ((a = b)) ...) to suppress this message. (Use -predassign to
13 inhibit warning)
885824d3 14preds.c:25:7: Test expression for if not bool, type char: (c = 'a')
2e127cb8 15 Test expression type is not boolean. (Use -predboolothers to inhibit warning)
885824d3 16preds.c:30:7: Use of == with bool variables (risks inconsistency because of
17 multiple true values): b1 == b2
18 Two bool values are compared directly using a C primitive. This may produce
19 unexpected results since all non-zero values are considered TRUE, so
20 different TRUE values may not be equal. The file bool.h (included in
2e127cb8 21 splint/lib) provides bool_equal for safe bool comparisons. (Use -boolcompare
22 to inhibit warning)
885824d3 23preds.c:35:7: Test expression for if not bool, type char: c
24
11db3170 25Finished checking --- 6 code warnings, as expected
885824d3 26
27preds.c: (in function f)
28preds.c:20:7: Test expression for if is assignment expression: b1 = b2
29 The condition test is an assignment expression. Probably, you mean to use ==
30 instead of =. If an assignment is intended, add an extra parentheses nesting
2e127cb8 31 (e.g., if ((a = b)) ...) to suppress this message. (Use -predassign to
32 inhibit warning)
885824d3 33
11db3170 34Finished checking --- 1 code warning, as expected
885824d3 35
36preds.c: (in function f)
37preds.c:5:8: Operand of ! is non-boolean (int *): !p
2e127cb8 38 The operand of ! operator is a pointer. (Use +ptrnegate to inhibit warning)
885824d3 39preds.c:10:7: Test expression for if not bool, type int: *p
2e127cb8 40 Test expression type is not boolean or int. (Use -predboolint to inhibit
41 warning)
885824d3 42preds.c:15:8: Operand of ! is non-boolean (int): !(*p)
43 The operand of a boolean operator is not a boolean. Use +ptrnegate to allow !
2e127cb8 44 to be used on pointers. (Use -boolops to inhibit warning)
885824d3 45preds.c:20:7: Test expression for if is assignment expression: b1 = b2
46 The condition test is an assignment expression. Probably, you mean to use ==
47 instead of =. If an assignment is intended, add an extra parentheses nesting
2e127cb8 48 (e.g., if ((a = b)) ...) to suppress this message. (Use -predassign to
49 inhibit warning)
885824d3 50preds.c:25:7: Test expression for if not bool, type char: (c = 'a')
2e127cb8 51 Test expression type is not boolean. (Use -predboolothers to inhibit warning)
885824d3 52preds.c:30:7: Use of == with bool variables (risks inconsistency because of
53 multiple true values): b1 == b2
54 Two bool values are compared directly using a C primitive. This may produce
55 unexpected results since all non-zero values are considered TRUE, so
56 different TRUE values may not be equal. The file bool.h (included in
2e127cb8 57 splint/lib) provides bool_equal for safe bool comparisons. (Use -boolcompare
58 to inhibit warning)
885824d3 59preds.c:35:7: Test expression for if not bool, type char: c
efd360a3 60bool.h:21:13: Function bool_initMod declared but not used
885824d3 61 A function is declared but not used. Use /*@unused@*/ in front of function
2e127cb8 62 header to suppress message. (Use -fcnuse to inhibit warning)
efd360a3 63bool.h:24:29: Function bool_unparse declared but not used
64bool.h:27:13: Function bool_not declared but not used
65bool.h:30:13: Function bool_equal declared but not used
66preds.c:3:5: Function f declared but not used
885824d3 67 preds.c:41:1: Definition of f
68
11db3170 69Finished checking --- 12 code warnings, as expected
This page took 0.074747 seconds and 5 git commands to generate.