R
Rudy Ray Moore
I work on a large native c++ application. We have about 15 developers. We
recently moved to "Visual C++ .net 2003 7.1." Two devleopers have seen an
odd problem since we migrated.
The address of local variables change when they are passed to another
function by reference (or when their addresses are passed). The address of
the variable increases by 420 bytes.
An example below illustrates the problem (but the problem does not happen in
this example). While the problem is quite reproducable when it appears, I
cannot make it appear at will.
Looking at assembly doesn't help because in assembly local variables are
listed by their c++ variable name in square brackets (assembly doesn't show
the actual adresses of local variables). The assembly thing is also pretty
hard to use (scroll bar don't work...?).
The problem just appears in a certain "group" of developers (math people,
not programmers), so I might suspect they are doing something weird in their
project files or coding.
Does anyone have any clues about how I can solve this problem?
Thank you!
Rudy
===
class A
{
void f(double& d){}
void g()
{
double d;
cout << &d; // "0x0012fac8"
f(d);
cout << &d; // "0x0012fe10" (== 0x0012fac8 + 420)
}
}
void main()
{
A a;
a.g();
}
recently moved to "Visual C++ .net 2003 7.1." Two devleopers have seen an
odd problem since we migrated.
The address of local variables change when they are passed to another
function by reference (or when their addresses are passed). The address of
the variable increases by 420 bytes.
An example below illustrates the problem (but the problem does not happen in
this example). While the problem is quite reproducable when it appears, I
cannot make it appear at will.
Looking at assembly doesn't help because in assembly local variables are
listed by their c++ variable name in square brackets (assembly doesn't show
the actual adresses of local variables). The assembly thing is also pretty
hard to use (scroll bar don't work...?).
The problem just appears in a certain "group" of developers (math people,
not programmers), so I might suspect they are doing something weird in their
project files or coding.
Does anyone have any clues about how I can solve this problem?
Thank you!
Rudy
===
class A
{
void f(double& d){}
void g()
{
double d;
cout << &d; // "0x0012fac8"
f(d);
cout << &d; // "0x0012fe10" (== 0x0012fac8 + 420)
}
}
void main()
{
A a;
a.g();
}