Mail Archives: djgpp/1998/01/29/04:21:24
On Wed, 28 Jan 1998, Nate Eldredge wrote:
> My preference is to compile without optimizations, get it to work (perhaps
> with the debugger), bang on it for a while, then compile with optimizations
> and test some more before releasing. I think that's the best trade-off, but
> of course for anyone, YMMV.
Well, my mileage varies. I was doing the same as you suggest
initially. But then I noticed that most of the testing and debugging
is done on the non-optimized version; by the time I got to debug the
optimized one, I was usually bored or sick and tired, and tended to
skip some of the tests. So now I begin the debugging with the
optimized version and only go to unoptimized one if I can't find the
bug otherwise.
Besides, turning on optimizations will make GCC check the source for
additional problems, like variables that are used before they are
initialized, so at least -O is mandatory, I think.
- Raw text -