Logging in debug and release builds

Alex Bligh alex at alex.org.uk
Thu Aug 10 11:01:33 PDT 2006



--On 10 August 2006 19:50 +0200 Marius Kjeldahl <marius at kjeldahl.net> wrote:

> As you can see, I'm running release mode, no debug flags, -O2 - the
> works, and i is _still_ incremented, where what we probably want to
> accomplish is to make sure wxLog stuff basically dispappears ("nop") when
> not in debug mode.

No, because operands with side-effects are undefined within wxLogDebug.
I think the point Vadim was making is that you should neither expect
the parameters to be evaluated, or for them NOT to be evaluated.

However, you point that evaluating them causes a call() even though
they are inline, is peculiar, and still stands. I think you have said
you are using gcc 3.4, and (without wishing to start a flame war) that
may be sufficient to explain what you are seeing. Optimization is
significantly better under 4.0, and (according to someone who has
tried it) even under 3.3, than under 3.4.

And Vadim, +1, wx-config should *not* emit -O2 IMHO.

My completely separate point that wxLogDebug itself is still REALLY
slow especially under kdevelop (on debug builds) also still stands.

Alex




More information about the wx-users mailing list