Hi Stephan,
> As I wrote before, I think
>
> if (!callSomeFooWhichSignalsSuccess(bar)) {
> OSL_ENSURE(false, "this was expected to succeed!");
> }
>
> is the better alternative to the OSL_VERIFY above, as it does not
> violate the Principle of Least Surprise (and helps get rid of a spurious
> warning ;) ).
I admit I do not like this pattern, since it always leaves me with the
gut feeling that there's unnecessary code left with OSL_DEBUG_LEVEL ==
0. I.e., a dumb compiler might compile this to the equivalent of
if ( !callSomeFooWhichSignalsSuccess( bar ) )
;
instead of
callSomeFooWhichSignalsSuccess( bar )
Yes, nowadays compilers probably aren't that dumb, so I would probably
just educate myself to not stumble upon this pattern anymore ... :)
Ciao
Frank
--
- Frank Schönheit, Software Engineer [EMAIL PROTECTED] -
- Sun Microsystems http://www.sun.com/staroffice -
- OpenOffice.org Database http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]