File: cast.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 (40 lines) | stat: -rw-r--r-- 2,019 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

cast.c:1:13: Mutable abstract type abst1 declared without pointer indirection:
                int (violates assignment semantics)
cast.c:1:20: Mutable abstract type abst2 declared without pointer indirection:
                int (violates assignment semantics)
cast.c: (in function main)
cast.c:6:13: Variable b initialized to type int, expects abst2: 3
cast.c:7:25: Cast to underlying abstract type abst2 *:
                (abst2 *)malloc(sizeof(abst2))
cast.c:11:10: Dereference of possibly null pointer ip: *ip
   cast.c:9:14: Storage ip may become null
cast.c:12:10: Dereference of possibly null pointer bp: *bp
   cast.c:7:15: Storage bp may become null
cast.c:12:9: Assignment of int to abst2: *bp = 5
cast.c:13:21: Cast to abstract type abst1: (abst1)ip
cast.c:14:24: Cast to underlying abstract type abst1 *: (abst1 *)ip
cast.c:15:22: Cast to underlying abstract type FILE *: (FILE *)ip
cast.c:16:21: Redundant cast involving abstract type abst1: (abst1)a
cast.c:17:22: Cast from underlying abstract type abst1 *: (int *)ap
cast.c:18:22: Cast from underlying abstract type FILE *: (int *)f
cast.c:19:22: Cast from underlying abstract type abst1: (int *)a
cast.c:20:21: Cast from abstract type abst2: (abst1)b
cast.c:20:21: Cast to abstract type abst1: (abst1)b
cast.c:21:24: Cast to underlying abstract type abst1 *: (abst1 *)bp
cast.c:21:24: Cast from underlying abstract type abst2 *: (abst1 *)bp
cast.c:22:19: Owned storage ap not released before return
   cast.c:21:10: Storage ap becomes owned
cast.c:22:19: Last reference ip to owned storage a not released before return
   cast.c:20:10: Original reference lost

Finished checking --- 20 code warnings, as expected

cast2.c: (in function f1)
cast2.c:9:10: Implicitly temp storage x returned as implicitly only: x
cast2.c:9:10: Function returns reference to parameter x: x
cast2.c: (in function f2)
cast2.c:15:10: Implicitly dependent storage x returned as implicitly only:
                  (abst1)x

Finished checking --- 3 code warnings, as expected