bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] Warning message issued with no source line number [PATCH]


From: arnold
Subject: Re: [bug-gawk] Warning message issued with no source line number [PATCH]
Date: Fri, 19 May 2017 07:40:10 -0600
User-agent: Heirloom mailx 12.4 7/29/08

> > Andy - does this look OK to you to commit?
>
> It seems fine, although I do have 2 questions/comments:
>
> 1. It says:
>
> +                               if (line == 0 && ip->source_line != 0)
> +                                       line = ip->source_line;
>
> So once "line" is set, it won't change. That gives a preference for the
> a line value at the front of the list. Is that better than:
>
> +                               if (ip->source_line != 0)
> +                                       line = ip->source_line;
>
> which would prefer the back of the list?

My thought was to prefer the actual expression if it has a line
number, but to default to the line where the expression or statement
begins if not.

> I have no idea, but if I had done it, I would have guessed that the back
> of the list should be preferred, since we scan until the back.

It might be better to do it your way, in which case the line is
closer to where the expression occurs.

> 2. I would have put the "line" variable inside the scope of the "if"
> statement, but that's basically a cosmetic decision.

Probably a good idea. I'll likely push a patch early next week.

Thanks,

Arnold



reply via email to

[Prev in Thread] Current Thread [Next in Thread]