strange c++ problem (linux/redhat)

strange c++ problem (linux/redhat)

Post by Feng X » Fri, 06 Jun 2003 05:48:49



Currently I modify a big C++ program for scientific computation. when I do
debuging, some strange things happened, that is: when I added some print
out statement, some previous NaN numbers(which is wrong, that is why I
need to do debugging, those NaNs are the calculation results of the
variabes I used in my print out statement) become real floating point
numbers, but when I commented out those statements, the numbers become NaN again.

Are there any experts knowing what is the problem here. I use g++ under
redhat linux.

Thanks a lot

 
 
 

strange c++ problem (linux/redhat)

Post by Juergen Heinz » Fri, 06 Jun 2003 07:01:24



> Currently I modify a big C++ program for scientific computation. when I do
> debuging, some strange things happened, that is: when I added some print
> out statement, some previous NaN numbers(which is wrong, that is why I
> need to do debugging, those NaNs are the calculation results of the
> variabes I used in my print out statement) become real floating point
> numbers, but when I commented out those statements, the numbers become NaN again.

[-]
Could be some stack / memory problem. You may try some other printf(), like
printf( <format>, 1.234 ) if you want. The only point of it would be to
let the compiler generate similar code.

I've seen similar behaviour, actually and yes, at times an additional function
call can hide an existing problem, yet of course it's just one possibility.

Cheers,
Juergen

--
\ Real name     : Juergen Heinzl       \       no flames      /


 
 
 

1. strange C++ problem (redhat/linux)

Currently I modify a big C++ program for scientific computation. when I do
debuging, some strange things happened, that is: when I added some print
out statement, some previous NaN numbers(which is wrong, that is why I
need to do debugging, those NaNs are the calculation results of  variabes
I used in my print out statement) become real floating point numbers, but
when I commented out those statements, the numbers become NaN again.

Are there any experts knowing what is the problem here. I use g++ under
redhat linux.

Thanks a millinion times

2. Changes to the printing interaction via samba from windoze 95/98 to redhat between 5.2 and 6.0 ?

3. uninstall REDhat linux uninstall REDhat linux uninstall REDhat linux uninstall REDhat linux uninstall REDhat linux uninstall REDhat linux uninstall REDhat linux

4. developer.kde.og disappeared

5. strange shell problems with Redhat linux

6. ESS1688 sound card drivers?

7. strange problem on ofstream of c++.

8. new module infrastructure for net_proto_family

9. gcc/C++ problems in RedHat 5.1

10. Problems installing C++ on redhat 6.0

11. Strange problem with screen savers using Gnome on Redhat 6.2

12. Strange problem with nxterm vs. ncftp under RedHat 4.1

13. Strange problem with passwords in RedHat 6.0