Front page | perl.perl5.porters |
Postings from June 2016
Re: The new Unescaped-left-brace-warning can be noisy
Thread Previous
|
Thread Next
From:
Karl Williamson
Date:
June 21, 2016 01:13
Subject:
Re: The new Unescaped-left-brace-warning can be noisy
Message ID:
5768948D.2010008@khwilliamson.com
On 06/20/2016 04:13 PM, Karl Williamson wrote:
> On 06/20/2016 03:57 PM, Karl Williamson wrote:
>> On 06/20/2016 12:39 PM, Andreas Koenig wrote:
>>> Karl,
>>>
>>> FWIW, on GWILLIAMS/IRI-0.005.tar.gz 'make test' used to produce ~433
>>> bytes, now ~3348343. This causes the normal reporting mechanisms to
>>> refuse to work, so this does not show up on cpantesters.
>>>
>>> If you are looking for tests that trigger the new warnings, here are
>>> others:
>>>
>>> http://www.cpantesters.org/cpan/report/f5acc38e-363d-11e6-82f7-cd4e388fbd9d
>>>
>>>
>>> (KJETILK/RDF-Trine-Node-Literal-XML-0.16.tar.gz)
>>
>> Every one of the above warnings is almost certainly a bug in the module,
>> as all of them are of the form /\{,\d\}/. It appears that they believe
>> that one can omit the lower bound of a quantifier. Indeed that is part
>> of the purpose of this deprecation, to change the language so that this
>> lower bound can be omitted. But it isn't the case today, and the code
>> compiles into matching the sequence "{" "," \d "}", silently until now.
>>>
>>> http://www.cpantesters.org/cpan/report/ee393738-362c-11e6-83b5-bcf7378fbd9d
>>>
>>>
>>> (GWILLIAMS/Attean-0.017.tar.gz)
>>
>> This is the exact same thing, omitting the lower bound of a quantifier.
>> The new warning has caught an existing bug in the code.
>>>
>>> http://www.cpantesters.org/cpan/report/c9f77224-35f8-11e6-974b-b539388fbd9d
>>>
>>>
>>> (IVANWILLS/File-CodeSearch-v0.7.4.tar.gz)
>>
>> This is probably just the warning legitimately deprecating an existing
>> legitimate usage. There are two constructs failing ".{-1}" and .{-2}".
>> It's possible those are very weird attempts at a quantifier, but it
>> seems to me more likely that the author meant to literally match the
>> sequence "{" "-" "1" "}". The report shows three instances of this
>> warning.
>>
>>>
>>> Thanks,
>>>
>>
>> So I'm not sure what to do about this. The tests show all three of the
>> examples are either bugs in the modules, or show correctly a
>> now-deprecated usage.
>>
>> I looked at IRI, and it has 5 occurrences of the {,\d} paradigm. I will
>> look further to see if those are the things that could be causing all
>> the noise, and issue a PR on it.
>
> I have now issued the PR. On my system, I downloaded this module and
> got some noise, but not the huge amount you reported. After adding in a
> lower bound of 0, to the five instances, no warnings were raised, and
> all tests passed.
>>
The IRI author has already merged the PR, and asked where in Attean the
problem was, as his grep didn't find it. Thus prompted, I looked at the
first two module failures further, and it turns out that both use IRI,
and the errors are all from IRI, so they should both go away when IRI is
update on CPAN.
There are some other instances of apparent missing lower bound on CPAN
http://grep.cpan.me/?q=%7B%2C%5Cd%2B%7D
gives 33 results, some of which are false positives
>> Maybe the regex compiler should not show the entire pattern when it
>> finds problems, but instead some amount (perhaps a large amount) of
>> context around the error.
>>
>>
>>
>
>
Thread Previous
|
Thread Next