I am not quick to leap to this conclusion, but...
I have a bit of code for doing a color space conversion (RGB to HSB). This
is not a trvial conversion but it isn't that complicated either. It is just
really a 3D coordinate conversion.
It works perfectly well in the IDE. When running the application direcly, it
mainly works, except for a certain narrow band of colors the calculation
goes wrong.
Unfortunately, any attempt to add debug seems to make the problem disappear.
Indeed, even the inclusion of a line of code which has no effect, eg int x =
y; when x is never used again, makes the problem go away.
The only remotely dodgy thing about the code (it is "standard" code, at
least in its C++ form, I didn't write it) is that it compares 2 floats for
equality. To be fair, it first assigns a to b, and then later tests if a==b,
so it should work.
Howevr I wonder if some compiler bug is mistakenly deciding the values
cannot be equal in some cases.
Anyway I changed the logic to use flags and it works. But that diesn't prove
much.
Dom
Stunning fractal photographs
http://www.morello.co.uk/fractal.htm