Joerg Barfurth wrote:
Hi Kay,
Kay Ramme - Sun Germany - Hamburg wrote:
Sorry for the (may be stupid) question, but why not just change
OSL_VERIFY to emit nothing, in case OSL_DEBUG_LEVEL == 0? I would
expect that only weird code would relay on the evaluation in case of a
zero debug level. And these case can probably easily be changed to
something with "assert" (or ensure).
It is the very purpose of OSL_VERIFY to evaluate the expression
regardless of debug level. For expressions without side effect
OSL_ASSERT/OSL_ENSURE should be used instead.
It is used to avoid cluttering the code with extraneous temporary
variables and control structures for assertions about values that are
not used otherwise.
Return values signaling the success or failure of a function call are
typically ideal candidates to be promoted further, up the call stack.
Only in very very rare situations this has to be "asserted".
So, such an OSL_VERFIY, which only logs something in case of
OSL_DEBUG_LEVEL > 0, really _displaces_ error detection and handling!!
Ciao, Jörg
Kay
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]