File: pointer.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 (42 lines) | stat: -rw-r--r-- 431 bytes parent folder | download | duplicates (7)
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
int x,y,c,*p,*q,T[10];

void g() {
  p = (int*)(void*)&y;
  *p = c;
}

void f1() {
  x = y;
  q= &x;
  if (c) p = &x;
  p = &c;
// p = &T[c];
  *p = *q;
}

/*@ ensures x > 0; */
void h() {
  p = &x;
  c = *p;
  *p = y;
}


void l(int *y) {
  *y = x;
}
void k(int *x) {
  l(x);
}

int cc1, cc2;;

void main(int en) {
  c=17;
  x=19;
  k(&c);
  k(&x);
  cc1 = cc2 = 99;
  if (en & 1) cc1 = T-1 <= T;
  if (en & 2) cc2 = T <= T+12;
}