J
Joachim Schmitz
Gordon said:You have an object and do some operation on it. It returns
an odd failure. Where do you find the code that was used for
the operation, so you can figure out what's going on?
Due to inheritance and/or operator overloading, there may be plenty
of different sets of code that look like they apply, but they don't.
A friend was having this problem, so he added a few dozen abort()
calls to the code. None of the abort() calls got used. Eventually
the correct code was found, and the problem was simple - some sort
of setup had to be done with the object first - but it took a LOT
of time to find the problem.
Now, you *can* have the same problem with plain old C, especially
with a lot of #ifdef s littering the code. I've also had the
experience of adding lines like:
)))))))))))!*!*!*!}CRAP{!*!*!*!((((((((((
to heavily ifdef'd code (to figure out which section is 'live') and
not managed to provoke a syntax error.
Why not
#error CRAP
I think this is guaranteed to generate a diagnostic, if in an active part of
an ifdef
Bye, Jojo