Re: CVS: commit uwog abiword-plugins/tools/abicollab/handlers/xmpp/xp XMPPAccountHandler.cpp

From: Dominic Lachowicz <domlachowicz_at_gmail.com>
Date: Wed Jan 03 2007 - 21:46:03 CET

> - pManager->registerEventListener(this);
> + if (pManager)
> + {
> + pManager->registerEventListener(this);
> + }
> + else
> + UT_ASSERT(UT_SHOULD_NOT_HAPPEN);
> * more code could go here *

In a non-debug build, UT_ASSERT evaluates to nothing. So this code
fragment becomes syntactically invalid. Or worse, the next line gets
executed only if !pManager, instead of unconditionally.

Please place this stuff into brackets, or change UT_ASSERT's
definition in NDEBUG mode to be something like:

"do{}while(0)" or "void(0)"

The compiler's dead code elimination phase should optimize such a
block out, but still produce the desired result.

Thanks,
Dom

-- 
Counting bodies like sheep to the rhythm of the war drums.
Received on Wed Jan 3 21:46:38 2007

This archive was generated by hypermail 2.1.8 : Wed Jan 03 2007 - 21:46:38 CET