Mario Semo
2006-06-26 08:35:10 UTC
Just in case someone with better knowledge of C/C++ rules read this and has
some comments:
evaluating
(foo(bar(100.0))) / foo(bar(10.0)))
i would expect
calculate foo(bar(100.0)
calculate foo(bar(10.0)
divide
but VACPP 3.5 calculates
reg1=bar(100.0)
reg2=bar(10.0)
foo(reg1)
foo(reg2)
divide
this yields incorrect results in the following sample :
double * bar(double d)
{
static double _sd;
_sd = d;
return &_sd;
}
double foo(double *d)
{
return *d;
}
(VACPP's result of 100/10 is 1.)
some comments:
evaluating
(foo(bar(100.0))) / foo(bar(10.0)))
i would expect
calculate foo(bar(100.0)
calculate foo(bar(10.0)
divide
but VACPP 3.5 calculates
reg1=bar(100.0)
reg2=bar(10.0)
foo(reg1)
foo(reg2)
divide
this yields incorrect results in the following sample :
double * bar(double d)
{
static double _sd;
_sd = d;
return &_sd;
}
double foo(double *d)
{
return *d;
}
(VACPP's result of 100/10 is 1.)
--
mit freundlichen Grüßen/best regards
mario semo
mit freundlichen Grüßen/best regards
mario semo