Closed p5pRT closed 10 years ago
After upgrading from 5.16.3 to 5.18.1\, various programs fialed with errors such as:
Bareword "a" not allowed while "strict subs" in use Warning: Use of "-a" without parentheses is ambiguous
This is due to this construct\, which should yield the string "-a":
-a
examples:
perl -e '-a' # Warning: Use of "-a" without parentheses is ambiguous perl -e 'warn -a' # warns about -a as it should perl -e 'use strict; -a' # silent as it should perl -e 'no strict; -a' # silent as it should perl -e '; -a' # silent as it should
This is very weird (adding a ; should not really have an effect\, and a regression\, thus I am reporting it.
On Mon\, Oct 21\, 2013 at 01:49:40AM -0700\, root@mail.nethype.de wrote:
# New Ticket Created by root@mail.nethype.de # Please include the string: [perl #120288] # in the subject line of all future correspondence about this issue. # \<URL: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=120288 >
This is a bug report for perl from root@mail.nethype.de\, generated with the help of perlbug 1.39 running under perl 5.18.1.
----------------------------------------------------------------- [Please describe your issue here]
After upgrading from 5.16.3 to 5.18.1\, various programs fialed with errors such as:
Bareword "a" not allowed while "strict subs" in use Warning: Use of "-a" without parentheses is ambiguous
This is due to this construct\, which should yield the string "-a":
-a
examples:
perl -e '-a' # Warning: Use of "-a" without parentheses is ambiguous perl -e 'warn -a' # warns about -a as it should perl -e 'use strict; -a' # silent as it should perl -e 'no strict; -a' # silent as it should perl -e '; -a' # silent as it should
This is very weird (adding a ; should not really have an effect\, and a regression\, thus I am reporting it.
All the examples you've shown above behave exactly the same with 5.16.3 and 5.18.1\, thus so far you haven't shown a regression. Do you have any examples that differ?
Having said that\, -a at the start of a statement shouldn't really behave differently depending on whether its at the start of the line or not.
-- But Pity stayed his hand. "It's a pity I've run out of bullets"\, he thought. -- "Bored of the Rings"
The RT System itself - Status changed from 'new' to 'open'
On Mon\, Oct 21\, 2013 at 11:36 AM\, Dave Mitchell \davem@​iabyn\.com wrote:
This is very weird (adding a ; should not really have an effect\, and a regression\, thus I am reporting it.
All the examples you've shown above behave exactly the same with 5.16.3 and 5.18.1\, thus so far you haven't shown a regression. Do you have any examples that differ?
Even 5.8.8 behaves as 5.18.1.
Hi\, is there a special reason for sending me the text of your mail twice\, once as text\, once as html attachment? The two attachments *look* identical - quite confusing.
On Mon\, Oct 21\, 2013 at 09:00:39AM -0700\, Eric Brine via RT \perlbug\-followup@​perl\.org wrote:
This is very weird (adding a ; should not really have an effect\, and a regression\, thus I am reporting it.
All the examples you've shown above behave exactly the same with 5.16.3 and 5.18.1\, thus so far you haven't shown a regression. Do you have any examples that differ?
Well\, the bug is a bug regardless of whether it happens in earlier versions\, but the program I use daily crashes with 5.18.1 and works with 5.16.3 because of an unquoted "-a" (from Gtk2::CV):
Bareword "a" not allowed while "strict subs" in use at /opt/perl/lib/perl5/Gtk2/CV/Schnauzer.pm line 301.
The examples differ for me in 5.16.3 as well\, but interestingly\, debian's 5.14.1 shows the same behaviour as perl 5.18.1\, while working with Gtk2::CV\, so there are apparently two issues (the bareword issue and the ambiguous warning).
In any case\, it either shouldn't crash\, or the documentation should explain that -a is an exception.
The original code that crashes with 5.18.1 and not with my previous 5.16.3 binary is this btw. (from Gtk2::CV):
$rot = $rot eq "auto" ? -a : ($rot % 360) == 0 ? undef : ($rot % 360) == 90 ? -9 : ($rot % 360) == 180 ? -1 : ($rot % 360) == 270 ? -2 : die "can only rotate by 0\, 90\, 180 and 270 degrees";
This runs with my 5.16.3 and debians 5.14.1\, but not my 5.18.1.
This is the code now in CVS\, which runs with all three of the above:
$rot = $rot eq "auto" ? "-a" [...]
On Mon\, Oct 21\, 2013 at 11:36 AM\, Dave Mitchell \davem@​iabyn\.com wrote:
> This is very weird \(adding a ; should not really have an effect\, and a > regression\, thus I am reporting it\. All the examples you've shown above behave exactly the same with 5\.16\.3 and 5\.18\.1\, thus so far you haven't shown a regression\. Do you have any examples that differ?
Even 5.8.8 behaves as 5.18.1.
-- The choice of a Deliantra\, the free code+content MORPG -----==- _GNU_ http://www.deliantra.net ----==-- _ generation ---==---(_)__ __ ____ __ Marc Lehmann --==---/ / _ \/ // /\ \/ / schmorp@schmorp.de -=====/_/_//_/\_\,_/ /_/\_\
On Mon\, Oct 21\, 2013 at 09:10:55PM +0200\, Marc Lehmann wrote:
Hi\, is there a special reason for sending me the text of your mail twice\, once as text\, once as html attachment? The two attachments *look* identical - quite confusing.
On Mon\, Oct 21\, 2013 at 09:00:39AM -0700\, Eric Brine via RT \perlbug\-followup@​perl\.org wrote:
This is very weird (adding a ; should not really have an effect\, and a regression\, thus I am reporting it.
All the examples you've shown above behave exactly the same with 5.16.3 and 5.18.1\, thus so far you haven't shown a regression. Do you have any examples that differ?
Well\, the bug is a bug regardless of whether it happens in earlier versions\, but the program I use daily crashes with 5.18.1 and works with 5.16.3 because of an unquoted "-a" (from Gtk2::CV):
Well\, the bug you're encountering with Gtk2::CV is a different issue than the one you described with the 'perl -e' examples in the original ticket.
I can reduce the Gtk2::CV code to this (the 'use integer' is necessary):
use strict; use integer; my $x = -a;
This starts failing from 5.17.2; a bisect shows the offending commit to be the following. FC\, do you have any comments?
commit 077da62ff955a1517f28fde7b6613d123050dbcb Author: Father Chrysostomos \sprout@​cpan\.org AuthorDate: Fri Jun 29 22:25:28 2012 -0700 Commit: Father Chrysostomos \sprout@​cpan\.org CommitDate: Fri Jun 29 22:25:28 2012 -0700
op.c: S_op_integerize: -foo no longer needs an exception
Affected files ...
M op.c
Differences ...
Monto Blanco... scorchio!
On Mon Oct 21 15:33:17 2013\, davem wrote:
On Mon\, Oct 21\, 2013 at 09:10:55PM +0200\, Marc Lehmann wrote:
Hi\, is there a special reason for sending me the text of your mail twice\, once as text\, once as html attachment? The two attachments *look* identical - quite confusing.
On Mon\, Oct 21\, 2013 at 09:00:39AM -0700\, Eric Brine via RT \perlbug\-followup@​perl\.org wrote:
This is very weird (adding a ; should not really have an effect\, and a regression\, thus I am reporting it.
All the examples you've shown above behave exactly the same with 5.16.3 and 5.18.1\, thus so far you haven't shown a regression. Do you have any examples that differ?
Well\, the bug is a bug regardless of whether it happens in earlier versions\, but the program I use daily crashes with 5.18.1 and works with 5.16.3 because of an unquoted "-a" (from Gtk2::CV):
Well\, the bug you're encountering with Gtk2::CV is a different issue than the one you described with the 'perl -e' examples in the original ticket.
I can reduce the Gtk2::CV code to this (the 'use integer' is necessary):
use strict; use integer; my $x = \-a;
This starts failing from 5.17.2; a bisect shows the offending commit to be the following. FC\, do you have any comments?
Mea culpa.
That patch was supposed to remove code rendered unnecessary two commits earlier\, but it changed what ‘type’ could be set to.
I have a local patch. Tests are running....
commit 077da62ff955a1517f28fde7b6613d123050dbcb Author: Father Chrysostomos \sprout@​cpan\.org AuthorDate: Fri Jun 29 22:25:28 2012 -0700 Commit: Father Chrysostomos \sprout@​cpan\.org CommitDate: Fri Jun 29 22:25:28 2012 -0700
op\.c​: S\_op\_integerize​: \-foo no longer needs an exception
Affected files ...
M op\.c
Differences ...
diff --git a/op.c b/op.c index e708a99..ae0d6e8 100644 --- a/op.c +++ b/op.c @@ -3184\,11 +3184\,8 @@ S_op_integerize(pTHX_ OP *o)
PERL\_ARGS\_ASSERT\_OP\_INTEGERIZE;
- /* integerize op\, unless it happens to be C\<-foo>. - * XXX should pp_i_negate() do magic string negation instead? */ - if ((PL_opargs[type] & OA_OTHERINT) && (PL_hints & HINT_INTEGER) - && !(type == OP_NEGATE && cUNOPo->op_first->op_type == OP_CONST - && (cUNOPo->op_first->op_private & OPpCONST_BARE))) + /* integerize op. */ + if ((PL_opargs[type] & OA_OTHERINT) && (PL_hints & HINT_INTEGER)) { dVAR; o->op_ppaddr = PL_ppaddr[type = ++(o->op_type)];
--
Father Chrysostomos
On Mon\, Oct 21\, 2013 at 03:33:18PM -0700\, Dave Mitchell via RT \perlbug\-followup@​perl\.org wrote:
Well\, the bug you're encountering with Gtk2::CV is a different issue than the one you described with the 'perl -e' examples in the original ticket.
I reported two bugs\, but indeed my testcase is only for one of them. I can open a separate bug for the other one if that is required/helpful?
-- The choice of a Deliantra\, the free code+content MORPG -----==- _GNU_ http://www.deliantra.net ----==-- _ generation ---==---(_)__ __ ____ __ Marc Lehmann --==---/ / _ \/ // /\ \/ / schmorp@schmorp.de -=====/_/_//_/\_\,_/ /_/\_\
On Tue\, Oct 22\, 2013 at 08:49:05AM +0200\, Marc Lehmann wrote:
On Mon\, Oct 21\, 2013 at 03:33:18PM -0700\, Dave Mitchell via RT \perlbug\-followup@​perl\.org wrote: I reported two bugs\, but indeed my testcase is only for one of them. I can open a separate bug for the other one if that is required/helpful?
No it's ok\, I'll deal with them both under this ticket\, thanks.
-- Justice is when you get what you deserve. Law is when you get what you pay for.
On Mon Oct 21 21:37:13 2013\, sprout wrote:
Mea culpa.
That patch was supposed to remove code rendered unnecessary two commits earlier\, but it changed what ‘type’ could be set to.
I have a local patch. Tests are running....
Now applied as fcbc518d7ac.
This should be a candidate for 5.18.2.
--
Father Chrysostomos
On Tue Oct 22 03:29:24 2013\, davem wrote:
On Tue\, Oct 22\, 2013 at 08:49:05AM +0200\, Marc Lehmann wrote:
On Mon\, Oct 21\, 2013 at 03:33:18PM -0700\, Dave Mitchell via RT \perlbug\-followup@​perl\.org wrote: I reported two bugs\, but indeed my testcase is only for one of them. I can open a separate bug for the other one if that is required/helpful?
No it's ok\, I'll deal with them both under this ticket\, thanks.
I have just diagnosed the other bug. I should have a fix some time today.
--
Father Chrysostomos
On Tue\, Oct 22\, 2013 at 06:11:26AM -0700\, Father Chrysostomos via RT wrote:
On Tue Oct 22 03:29:24 2013\, davem wrote:
On Tue\, Oct 22\, 2013 at 08:49:05AM +0200\, Marc Lehmann wrote:
On Mon\, Oct 21\, 2013 at 03:33:18PM -0700\, Dave Mitchell via RT \perlbug\-followup@​perl\.org wrote: I reported two bugs\, but indeed my testcase is only for one of them. I can open a separate bug for the other one if that is required/helpful?
No it's ok\, I'll deal with them both under this ticket\, thanks.
I have just diagnosed the other bug. I should have a fix some time today.
I didn't see your post\, so I've already fixed it as
46879fadd034dcb5d6f720076845767f8ccf152d Author: David Mitchell \davem@​iabyn\.com AuthorDate: Tue Oct 22 16:48:16 2013 +0100 Commit: David Mitchell \davem@​iabyn\.com CommitDate: Tue Oct 22 17:01:30 2013 +0100
spurious "Use of "-x" without parentheses" mesg
RT #120288.
Something like '-X' at the start of a line (where X is one char\, but not a
filetest operator) was giving a spurious
Warning: Use of "-a" without parentheses is ambiguous
error. This was because the toker was provisionally marking the -a as the
last encountered unary operator (PL_last_uni)\, then not unmarking it when
it found that that it wasn't in fact a filetest operator.
M t/lib/warnings/toke M toke.c
-- Hofstadter's Law: It always takes longer than you expect\, even when you take into account Hofstadter's Law.
On Tue Oct 22 09:04:57 2013\, davem wrote:
On Tue\, Oct 22\, 2013 at 06:11:26AM -0700\, Father Chrysostomos via RT wrote:
On Tue Oct 22 03:29:24 2013\, davem wrote:
On Tue\, Oct 22\, 2013 at 08:49:05AM +0200\, Marc Lehmann wrote:
On Mon\, Oct 21\, 2013 at 03:33:18PM -0700\, Dave Mitchell via RT \perlbug\-followup@​perl\.org wrote: I reported two bugs\, but indeed my testcase is only for one of them. I can open a separate bug for the other one if that is required/helpful?
No it's ok\, I'll deal with them both under this ticket\, thanks.
I have just diagnosed the other bug. I should have a fix some time today.
I didn't see your post\, so I've already fixed it as
46879fadd034dcb5d6f720076845767f8ccf152d Author: David Mitchell \davem@​iabyn\.com AuthorDate: Tue Oct 22 16:48:16 2013 +0100 Commit: David Mitchell \davem@​iabyn\.com CommitDate: Tue Oct 22 17:01:30 2013 +0100
spurious "Use of "\-x" without parentheses" mesg
My fix was identical. :-)
--
Father Chrysostomos
@iabyn - Status changed from 'open' to 'resolved'
* Father Chrysostomos via RT \perlbug\-followup@​perl\.org [2013-10-22T08:46:48]
Now applied as fcbc518d7ac.
This should be a candidate for 5.18.2.
This seems to have slipped by. I'll apply it to maint for 5.18.3 after .2 is out the door.
-- rjbs
This ticket was marked blocking 5.18.2\, but closed before 5.18.2 was released and before the fix was applied to maint-5.18.
I've re-opened it.
-- rjbs
@rjbs - Status changed from 'resolved' to 'open'
Thanks\, applied to maint-5.18 as 18ca6dc.
-- rjbs
@rjbs - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#120288 (status was 'resolved')
Searchable as RT120288$