develooper Front page | perl.perl5.porters | Postings from December 2018

Re: regexec.c: LGTM analysis warns about two comparisons, butweactually need them

Thread Previous | Thread Next
From:
Dominic Hargreaves
Date:
December 6, 2018 13:31
Subject:
Re: regexec.c: LGTM analysis warns about two comparisons, butweactually need them
Message ID:
20181206133058.kr5l7k27l6iipufa@urchin.earth.li
On Thu, Dec 06, 2018 at 08:20:50AM -0500, James E Keenan wrote:
> On 12/6/18 3:16 AM, Tony Cook wrote:
> > On Wed, Dec 05, 2018 at 10:28:54PM -0500, James E Keenan wrote:
> > > Here is a case where the LGTM.com analysis of the Perl 5 source code
> > > produces results that are at first plausible but ultimately incorrect.
> > > 
> > > The following section of regexec.c is cited (https://lgtm.com/projects/g/Perl/perl5/alerts/?mode=tree&ruleFocus=2154840804)
> > > with the warning-level alert "Comparison result is always the same":
> > 
> > This was discussed in #133686, the comparison needs to stay to allow
> > for local configuration of larger values of NUM_ANYOF_CODE_POINTS.
> > 
> 
> Would it be okay if I inserted a comment to that effect into regexec.c so
> that we don't stumble upon this again in the future?

That sounds sensible to me regardless of systems like LGTM. You *could*
even use the LGTM suppression syntax (in addition to a human-readable
explanation); this would mean that if in the future we can implement
/* */ suppression comments in LGTM, they would be recognised.

You can watch this topic for more updates on that feature request:

https://discuss.lgtm.com/t/rfe-support-for-supression-comments-in-comment-blocks/1364

In case you weren't aware, if you think that a certain type of alert
will *never* be interesting for a given code-base you can disable it
entirely in .lgtm.yml:

https://lgtm.com/help/lgtm/showing-hiding-query-results

Cheers,
Dominic.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About