bug-gawk
[Top][All Lists]
Advanced

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

Re: Why 'statement may have no effect' lint warning here?


From: arnold
Subject: Re: Why 'statement may have no effect' lint warning here?
Date: Wed, 14 Apr 2021 07:44:58 -0600
User-agent: Heirloom mailx 12.5 7/5/10

Wolfgang Laun <wolfgang.laun@gmail.com> wrote:

> We all agree with lint not being a code quality analysis tool.
>
> If I understand you correctly, you intend to fix the current misbehaviour
> so that only truly useless statements should be flagged.

Correct.

> I don't want to make life hard for you but can you please clarify your
> intention. Which of the following will lint flag after your fix?
>    a + b    # as above: useless
>    a == b  # as above: useless

All of the below will not produce a warning.  `a = a' is an interesting
case, as are some of the others, but I don't feel like overly investing
in this feature.

>    a++ == a--    # ?
>   f_without_side_effect(a);   # ?
>   f_with_side_effect(b) == 2       # ?
>   1 == 2 && a++     # ?
>   1 == 1 || b--     # ?
>   a = a # ?
>   a *= 1 #?
>   a += 0 #?
>   a*a < 0 && b = 1001  # ?
> and so on - you get the drift.
>
> Will you be able to describe the situation after the patch in a single,
> simple sentence?

I don't know. I'll just let the feature speak for itself. :-)

Arnold



reply via email to

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