[m-rev.] for review: Improve warnings generated by?--warn-non-tail-recursive

Paul Bone paul at bone.id.au
Sun Nov 1 14:23:55 AEDT 2015


On Sun, Nov 01, 2015 at 01:46:57PM +1100, Zoltan Somogyi wrote:
> 
> On Sun, 1 Nov 2015 11:38:49 +1100, Paul Bone <paul at bone.id.au> wrote:
> > > I will look at it post commit.
> > > 
> > 
> > Okay done.
> 
> I think the diff was fine, but I made it less conservative,
> by committing the attached diff.
> 

I don't see an attachment, I'll ask git and view the diff there.

One of the reasons I left this as conservative is that if a switch looks
like this (recall this is MLDS):

    recursive_call();
    switch (var) {
        case X:
            recursive_call();
            break;
        case Y:
            ...
            break;
    }
    return;

I don't know if it would make sense to a user to warn for the first
recursive call (before the switch) because I'm not sure how code might be
generated by the HLDS->MLDS transformation.  In other words, I don't know if
it would be obvious to the programmer that that call was not recursive, it
probably would, but I wasn't 100% sure.

Thanks.

-- 
Paul Bone



More information about the reviews mailing list