File: val_ptr.i

package info (click to toggle)
frama-c 20161101%2Bsilicon%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 42,324 kB
  • ctags: 35,695
  • sloc: ml: 200,142; ansic: 31,465; makefile: 2,334; sh: 1,643; lisp: 259; python: 85; asm: 26
file content (55 lines) | stat: -rw-r--r-- 619 bytes parent folder | download | duplicates (3)
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
/* run.config*
   GCC:
   STDOPT: #"-main f"
   STDOPT: #"-main f1"
   STDOPT: #"-main f3"
   STDOPT: #"-main f2"
*/
int i,j,x,k,l,m,n,d,a,b,c;
int *p;

void f(int c) {
  j= 16;
  k= 17;
  l= 18;
  a= 11; b = 12; d= 13;


  p = &a;
  if (c) p=&a; else {
    a = 10;
    if (d) p=&b; else p = &d;
    }
  if (a <= 10)
    { j = *p;
    k = a;
      }
  else { k = *p ;};

  i = 10;
}

int T[8],*p;
void f1() {
  for (p=T;p==&T[8];p++)
    *p = 0 ;
}


void f3() {
  p = T;
  if (p + 8 <= &T[8])
    *p = 0 ;
}

void f2(int c)
{
  j = 3;
  a = 1;
  b = 2;
  c = 0;
  if (!c) p = &a; else p = &b;
  if (!p)
    j = *p;

}