1 | $ splint sudoko.c
|
2 | Splint 3.1.2 --- 23 Apr 2014
|
3 |
|
4 | sudoko.c: (in function spielGeruest)
|
5 | sudoko.c:10:1: Observer storage assigned to unqualified reference:
|
6 | spielfeld[0] = " 012345678"
|
7 | Observer storage is transferred to a non-observer reference. (Use
|
8 | -observertrans to inhibit warning)
|
9 | sudoko.c:10:14: Storage becomes observer
|
10 | sudoko.c:23:12: Test expression for if not boolean, type int: (i % 2)
|
11 | Test expression type is not boolean or int. (Use -predboolint to inhibit
|
12 | warning)
|
13 | sudoko.c:24:16: Test expression for if not boolean, type int: (j % 2)
|
14 | sudoko.c:25:17: Suspect modification of observer spielfeld[][]:
|
15 | spielfeld[i][j] = '|'
|
16 | Storage declared with observer is possibly modified. Observer storage may not
|
17 | be modified. (Use -modobserver to inhibit warning)
|
18 | sudoko.c:10:14: Storage spielfeld[][] becomes observer
|
19 | sudoko.c:28:13: Suspect modification of observer spielfeld[][]:
|
20 | spielfeld[i][j] = '-'
|
21 | sudoko.c:10:14: Storage spielfeld[][] becomes observer
|
22 | sudoko.c:33:16: Test expression for if not boolean, type int: (j % 2)
|
23 | sudoko.c:34:17: Suspect modification of observer spielfeld[][]:
|
24 | spielfeld[i][j] = '|'
|
25 | sudoko.c:10:14: Storage spielfeld[][] becomes observer
|
26 | sudoko.c:37:17: Suspect modification of observer spielfeld[][]:
|
27 | spielfeld[i][j] = 'x'
|
28 | sudoko.c:10:14: Storage spielfeld[][] becomes observer
|
29 | sudoko.c:40:9: Suspect modification of observer spielfeld[][]:
|
30 | spielfeld[i][j + 2] = '\0'
|
31 | sudoko.c:10:14: Storage spielfeld[][] becomes observer
|
32 | sudoko.c: (in function sodokuVorlage)
|
33 | sudoko.c:64:17: Return value (type int) ignored: scanf("%c", &spi...
|
34 | Result returned by function call is not used. If this is intended, can cast
|
35 | result to (void) to eliminate message. (Use -retvalint to inhibit warning)
|
36 | sudoko.c:65:17: Return value (type int) ignored: fflush(stdin)
|
37 | sudoko.c:69:17: Return value (type int) ignored: scanf("%c", &spi...
|
38 | sudoko.c:70:17: Return value (type int) ignored: fflush(stdin)
|
39 | sudoko.c:66:23: Suspected infinite loop. No value used in loop test (i,
|
40 | spielfeld, j, spielfeld[], spielfeld[][]) is modified by test or loop body.
|
41 | This appears to be an infinite loop. Nothing in the body of the loop or the
|
42 | loop test modifies the value of the loop test. Perhaps the specification of a
|
43 | function called in the loop body is missing a modification. (Use -infloops to
|
44 | inhibit warning)
|
45 | sudoko.c:75:17: Return value (type int) ignored: fflush(stdin)
|
46 | sudoko.c:56:18: Variable x declared but not used
|
47 | A variable is declared but never used. Use /*@unused@*/ in front of
|
48 | declaration to suppress message. (Use -varuse to inhibit warning)
|
49 | sudoko.c:56:22: Variable y declared but not used
|
50 | sudoko.c: (in function sodokuStart)
|
51 | sudoko.c:102:5: Return value (type int) ignored: scanf("%i %i", &...
|
52 | sudoko.c:103:5: Return value (type int) ignored: fflush(stdin)
|
53 | sudoko.c:109:9: Return value (type int) ignored: scanf("%i %i", &...
|
54 | sudoko.c:112:9: Return value (type int) ignored: fflush(stdin)
|
55 | sudoko.c:115:8: Value x[] used before definition
|
56 | An rvalue is used that may not be initialized to a value on some execution
|
57 | path. (Use -usedef to inhibit warning)
|
58 | sudoko.c:115:19: Value y[] used before definition
|
59 | sudoko.c:120:9: Return value (type int) ignored: scanf("%i %i", &...
|
60 | sudoko.c:123:9: Return value (type int) ignored: fflush(stdin)
|
61 | sudoko.c:126:5: Return value (type int) ignored: scanf("%c", &spi...
|
62 | sudoko.c:127:5: Return value (type int) ignored: fflush(stdin)
|
63 | sudoko.c:130:9: Return value (type int) ignored: scanf("%c", &spi...
|
64 | sudoko.c:131:9: Return value (type int) ignored: fflush(stdin)
|
65 | sudoko.c:128:11: Suspected infinite loop. No value used in loop test (a,
|
66 | spielfeld, b, spielfeld[], spielfeld[][]) is modified by test or loop body.
|
67 | sudoko.c: (in function main)
|
68 | sudoko.c:185:9: Index of possibly null pointer Feld: Feld
|
69 | A possibly null pointer is dereferenced. Value is either the result of a
|
70 | function which may return null (in which case, code should check it is not
|
71 | null), or a global, parameter or structure field declared with the null
|
72 | qualifier. (Use -nullderef to inhibit warning)
|
73 | sudoko.c:183:10: Storage Feld may become null
|
74 | sudoko.c:187:14: Possibly null storage Feld[] derivable from parameter
|
75 | spielGeruest (Feld)
|
76 | A possibly null pointer is reachable from a parameter or global variable that
|
77 | is not declared using a /*@null@*/ annotation. (Use -nullstate to inhibit
|
78 | warning)
|
79 | sudoko.c:185:19: Storage Feld[] may become null
|
80 | sudoko.c:187:14: Passed storage Feld not completely defined (*(Feld[]) is
|
81 | undefined): spielGeruest (Feld)
|
82 | Storage derivable from a parameter, return value or global is not defined.
|
83 | Use /*@out@*/ to denote passed or returned storage which need not be defined.
|
84 | (Use -compdef to inhibit warning)
|
85 | sudoko.c:185:9: Storage *(Feld[]) allocated
|
86 | sudoko.c:188:18: Passed storage Feld not completely defined (*(Feld[]) is
|
87 | undefined): ausgabeSpielfeld (Feld)
|
88 | sudoko.c:185:9: Storage *(Feld[]) allocated
|
89 | sudoko.c:189:15: Passed storage Feld not completely defined (*(Feld[]) is
|
90 | undefined): sodokuVorlage (Feld)
|
91 | sudoko.c:185:9: Storage *(Feld[]) allocated
|
92 | sudoko.c:190:18: Passed storage Feld not completely defined (*(Feld[]) is
|
93 | undefined): ausgabeSpielfeld (Feld)
|
94 | sudoko.c:185:9: Storage *(Feld[]) allocated
|
95 | sudoko.c:191:13: Passed storage Feld not completely defined (*(Feld[]) is
|
96 | undefined): sodokuStart (Feld)
|
97 | sudoko.c:185:9: Storage *(Feld[]) allocated
|
98 | sudoko.c:192:13: Passed storage Feld not completely defined (*(Feld[]) is
|
99 | undefined): sodokuCheck (Feld)
|
100 | sudoko.c:185:9: Storage *(Feld[]) allocated
|
101 | sudoko.c:193:10: Fresh storage Feld not released before return
|
102 | A memory leak has been detected. Storage allocated locally is not released
|
103 | before the last reference to it is lost. (Use -mustfreefresh to inhibit
|
104 | warning)
|
105 | sudoko.c:183:5: Fresh storage Feld created
|
106 | sudoko.c:8:6: Function exported but not used outside sudoko: spielGeruest
|
107 | A declaration is exported, but not used outside this module. Declaration can
|
108 | use static qualifier. (Use -exportlocal to inhibit warning)
|
109 | sudoko.c:43:1: Definition of spielGeruest
|
110 | sudoko.c:48:6: Function exported but not used outside sudoko: ausgabeSpielfeld
|
111 | sudoko.c:53:1: Definition of ausgabeSpielfeld
|
112 | sudoko.c:55:6: Function exported but not used outside sudoko: sodokuVorlage
|
113 | sudoko.c:80:1: Definition of sodokuVorlage
|
114 | sudoko.c:82:10: Function exported but not used outside sudoko: sodokuStart
|
115 | sudoko.c:148:5: Definition of sodokuStart
|
116 | sudoko.c:150:10: Function exported but not used outside sudoko: sodokuCheck
|
117 | sudoko.c:177:5: Definition of sodokuCheck
|
118 |
|
119 | Finished checking --- 44 code warnings
|