intd=&y-&x;// expected-warning{{Subtraction of two pointers that do not point to the same memory chunk may cause incorrect result.}}
inta[10];
int*p=&a[2];
int*q=&a[8];
d=q-p;// no-warning
}
voidf4(){
int*p;
p=(int*)0x10000;// expected-warning{{Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.}}
}
voidf5(){
intx,y;
int*p;
p=&x+1;// expected-warning{{Pointer arithmetic done on non-array variables means reliance on memory layout, which is dangerous.}}
inta[10];
p=a+1;// no-warning
}
// Allow arithmetic on different symbolic regions.