Hi Stephan, On Wed, Aug 31, 2005 at 10:04:47 +0200, Stephan Bergmann 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). > > No, the code I saw was of the form > > OSL_VERIFY(close(f) >= 0); Well, to me that _is_ weird code. The programmer tried to save a variable and an assignment of the return value to the variable, but trades that in for not detecting an unsuccessfull close() in an OSL_DEBUG_LEVEL == 0 build, and not reacting on it. That's not only bad style, that's ugly, and maybe even wrong code. Leaving statements of debug macros in a product version most times leads to unnecessary code being executed, instead nasty uses such as above should be detected and eliminated and then OSL_VERIFY() set to empty for OSL_DEBUG_LEVEL == 0. Btw, since when would a close() return a value > 0 ?!? Eike -- OOo/SO Calc core developer. Number formatter bedevilled I18N transpositionizer. GnuPG key 0x293C05FD: 997A 4C60 CE41 0149 0DB3 9E96 2F1A D073 293C 05FD --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
