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:50:52 CET

Please ignore my temporary bout of stupidity. It won't happen again.

On 1/3/07, Dominic Lachowicz <domlachowicz@gmail.com> wrote:
> > - 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.
>

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

This archive was generated by hypermail 2.1.8 : Wed Jan 03 2007 - 21:51:35 CET