develooper Front page | perl.perl5.porters | Postings from July 2012

[perl #114180] illegalproto warnings are very incomplete

From:
Father Chrysostomos via RT
Date:
July 31, 2012 00:22
Subject:
[perl #114180] illegalproto warnings are very incomplete
Message ID:
rt-3.6.HEAD-11172-1343719357-1462.114180-15-0@perl.org
On Wed Jul 18 00:10:51 2012, l.mai@web.de wrote:
> 
> This is a bug report for perl from l.mai@web.de,
> generated with the help of perlbug 1.39 running under perl 5.16.0.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> 
> All of these should warn about illegal prototypes but don't:
> 
> % perl -we 'sub f ([)'
> % perl -we 'sub f (][[[[[[)'
> % perl -we 'sub f (\;)'
> % perl -we 'sub f (\[_;@])'
> % perl -we 'sub f (\+)'
> % perl -we 'sub f (\\\\)'
> % perl -we 'sub f ([$])'
> 
> 
> This one warns for the wrong reason:
> 
> % perl -we 'sub f (\[_$])'
> Illegal character after '_' in prototype for main::f : \\[_$] at -e
>    line 1.
> 
> 
> This one is semantically nonsense but "works":
> 
> % perl -we 'sub f (_;_;_)'

What I don’t understand is why we need the warning anyway, since you get
an error why applying the prototype.  And perl can’t know ahead of time
whether its default call checker will be parsing the prototype.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=114180



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