Logging in debug and release builds
Armel Asselin
armelasselin at hotmail.com
Thu Aug 10 10:24:12 PDT 2006
"Marius Kjeldahl" <marius at kjeldahl.net> a écrit dans le message de news:
44DB647E.8030700 at kjeldahl.net...
> Armel Asselin wrote:
>>> inline void wxVLogDebug(const wxChar *, va_list) { }
>>> inline void wxLogDebug(const wxChar *, ...) { }
>>> inline void wxVLogTrace(wxTraceMask, const wxChar *, va_list) { }
>>> inline void wxLogTrace(wxTraceMask, const wxChar *, ...) { }
>>> inline void wxVLogTrace(const wxChar *, const wxChar *, va_list) { }
>>> inline void wxLogTrace(const wxChar *, const wxChar *, ...) { }
>>
>> just as a note, such functions are really not at all like empty macro
>> definitions because their _arguments_ will be evaluted, even in release
>> build, and unless these arguments are inlined and/or trivial they won't
>> be
>> optimized out.
>
> Which nicely describes my problem. And if true I guess there's a few
> potential speedups for release builds of software using wxLog functions.
one problem though is that release builds (as well as debug build) may well
be dependent on this flawed approach (i.e. maybe some arguments evaluations
have side effects which are _necessary_ for the framework to work).
Armel
More information about the wx-users
mailing list