Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On Thu, 2011-02-03 at 03:20 +0900, Takeshi Abe wrote:
Hi,

On building calc, I found a warning suggesting an ambiguous "else".
The attached patch is under LGPLv3+/MPL.

Hmm... But your patch may change the intention of that code block based
on how the lines are indented.

Here is the code we have right now

if(eType==SC_CAT_CONTENT)
    if(!pScChangeAction->IsDialogParent())
        pScChangeAction->GetDescription( aDesc, pDoc, TRUE);
else
    pScChangeAction->GetDescription( aDesc, pDoc,!pScChangeAction->IsMasterDelete());

which makes me think the the else block is supposed to get executed when

eType != SC_CAT_CONTENT

I have no idea how the compiler parses that block of code as it is
indeed ambiguous.  But I'm more in favor of interpreting it based on the
indent levels than how the compiler might be parsing it.

Kohei

-- 
Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida@novell.com>



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.