digitalmars.D - pointer aliasing in D
- Sebastian Biallas (17/17) Jan 15 2007 Hello,
Hello,
Are there some pointer-aliasing contraints in D? Is there maybe some
similar like strict-aliasing in C?
Consider the following program:
struct S {
int i;
};
struct T {
int i;
};
void bar(S *a, T *b, S *c)
{
b.i = a.i;
c.i = a.i;
}
Since a and b are pointers of different types, a C compiler is allowed
to cache a.i in a register (the store to b.i must no change a.i).
Jan 15 2007








Sebastian Biallas <groups.5.sepp spamgourmet.com>