~ubuntu-branches/debian/sid/frama-c/sid

« back to all changes in this revision

Viewing changes to tests/misc/cmp_ptr.c

  • Committer: Bazaar Package Importer
  • Author(s): Mehdi Dogguy
  • Date: 2009-06-03 08:19:25 UTC
  • Revision ID: james.westby@ubuntu.com-20090603081925-kihvxvt0wy3zc4ar
Tags: upstream-20081201.dfsg
ImportĀ upstreamĀ versionĀ 20081201.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
int *p,T[10]={0,1,2,3,4,5,6,7,8,9};
 
2
char C[10]={0,1,2,3,4,5,6,7,8,9};
 
3
char *q;
 
4
int f(void) { /* make a top integer */
 
5
  int i = 0;
 
6
  while (&i+(int)&i) {
 
7
    i++;}
 
8
  return i;
 
9
};
 
10
 
 
11
int main () {
 
12
 
 
13
  p = &T[1] + f();
 
14
  q = &C[1] + f();
 
15
  
 
16
  if (p >= &(T[5])) {*p=88;*q=77;}
 
17
 
 
18
        
 
19
}
 
20
int main1 () {
 
21
 
 
22
  for (p = T;p<&(T[10]);p++) {*p=1;}
 
23
 
 
24
 
 
25
}