Re: Logical Value Of A Pointer
On 30 jan, 17:55, Noah Roberts <n...@nowhere.com> wrote:
Pete Becker wrote:
Turn off stupid warnings.
I couldn't disagree more. There are too many easy mistakes
you can make which the compiler can warn you about long before
you have to hunt them down in debugging. Many of those
mistakes can cost many hours if they make it to that point.
He didn't say turn off all warnings. He said turn off stupid
warnings. For whatever reasons, every compiler I've ever used
has some really stupid warnings, along side many very useful
ones. If you can turn them off with a compile line option,
fine; most of the time, we've ended up piping the compiler
output through sed, to get rid of some we couldn't turn off.
One great example: forgetting to make your destructor virtual
when it should be.
The problem is that the compiler generally can't know when it
should be, so it's almost impossible to get a good warning for
this. (Warning if there are virtual functions and the
destructor is public is probably close enough, however. It
shouldn't result in too many false warnings.)
--
James Kanze