Re: Warning in fv_View.cpp


Subject: Re: Warning in fv_View.cpp
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Tue Mar 06 2001 - 19:04:28 CST


Hi Tom,
        Thanks very much for pointing this out. This was genuine bug and
might have been responsible for some bizzare crashes I've been seeing.

I got bitten by C++ scoping rules. I defined pBL outside an if() and
then did:

        if(pBL->isHdrFtr())
        {
                fl_HdrFtrSectionLayout * pSSL = (fl_HdrFtrSectionLayout *)
pBL->getSectionLayout();
                fl_BlockLayout * pBL = pSSL->getFirstShadow()->findMatchingBlock(pBL);
        }
        return pBL;
}

Inside!! Of course the if() statement is totally useless then.

I've just removed the fl_BlockLayout * declaration which should fix
things.

Thanks very much! Edittible headers and footers just took a a major step
forward.

Geeze does this mean I have to thank MS for providing a better compiler
than gcc?

Oh the horror!

Martin

On Tue, 6 Mar 2001, Tom Briggs wrote:

>
> Hi Martin,
>
> One of your commits to fv_View.cpp yesterday generates a warning on
> Windows. I don't know if it does on Unix or not, but in case it isn't and
> you haven't seen it, here it is:
>
> fv_View.cpp(1146) : warning C4700: local variable 'pBL' used without
> having been initialized
>
> I don't know anything about any of AbiWord's XP code, so I'm not going
> to try to fix it (as I'm sure I would just make things worse :) ).
>
> -Tom
>
>
>



This archive was generated by hypermail 2b25 : Tue Mar 06 2001 - 19:04:56 CST