develooper Front page | perl.perl5.porters | Postings from September 2013

Re: [perl #119251] [PATCH] Enhancement request - a prototype attribute

Thread Previous | Thread Next
From:
Peter Martini
Date:
September 17, 2013 22:10
Subject:
Re: [perl #119251] [PATCH] Enhancement request - a prototype attribute
Message ID:
CAFyW6MTXgWJQmE=ZnYuZ_qc3K7nQtN4xynWN_k5+fL=0u3-O_g@mail.gmail.com
On Tue, Sep 17, 2013 at 5:15 PM, Father Chrysostomos via RT
<perlbug-followup@perl.org> wrote:
> On Mon Sep 16 23:10:19 2013, pcm wrote:
>> On Wed, Aug 14, 2013 at 2:54 AM, Father Chrysostomos via RT
>> <perlbug-followup@perl.org> wrote:
>> > Second patch:
>> >
>> > $ ./miniperl -e 'sub f { use }'
>> > Assertion failed: (name), function S_move_proto_attr, file op.c,
>> line 2578.
>> > Abort trap: 6
>>
>> I'm getting:
>>
>> [pmartini@pmlenlaptop blah]$ ./miniperl -e 'sub f { use }'
>> syntax error at -e line 1, near "use }"
>> Execution of -e aborted due to compilation errors.
>>
>> If you apply the original second patch now, do you still see the
>> error?
>
> With your *new* patch, I still get that result.  Are you compiling with
> -DDEBUGGING?  (If not, make sure to delete config.sh and Policy.sh
> before re-running Configure.)

My whole perl -V:

[pmartini@pmlenlaptop proto-attr]$ ./perl -e 'sub f { use } '
syntax error at -e line 1, near "use }"
Execution of -e aborted due to compilation errors.
[pmartini@pmlenlaptop proto-attr]$ ./perl -e 'sub f { use }'
syntax error at -e line 1, near "use }"
Execution of -e aborted due to compilation errors.
[pmartini@pmlenlaptop proto-attr]$ ./miniperl -e 'sub f { use }'
syntax error at -e line 1, near "use }"
Execution of -e aborted due to compilation errors.
[pmartini@pmlenlaptop proto-attr]$ grep ^C
[pmartini@pmlenlaptop proto-attr]$ ./perl -Ilib -V
Summary of my perl5 (revision 5 version 19 subversion 4) configuration:
  Commit id: 52d097d99176412041811ec3c8c663e4a912d2c7
  Platform:
    osname=linux, osvers=2.6.32-358.el6.x86_64,
archname=x86_64-linux-thread-multi
    uname='linux pmlenlaptop 2.6.32-358.el6.x86_64 #1 smp fri feb 22
00:31:26 utc 2013 x86_64 x86_64 x86_64 gnulinux '
    config_args='-Dusedevel -Dusethreads -DDEBUGGING -des'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -g',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.4.7 20120313 (Red Hat 4.4.7-3)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/../lib64 /usr/lib/../lib64 /lib
/usr/lib /lib64 /usr/lib64 /usr/local/lib64
    libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.12.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.12'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib
-fstack-protector'


Characteristics of this binary (from libperl):
  Compile-time options: DEBUGGING HAS_TIMES MULTIPLICITY PERLIO_LAYERS
                        PERL_DONT_CREATE_GVSV
                        PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
                        PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV
                        PERL_TRACK_MEMPOOL PERL_USE_DEVEL USE_64_BIT_ALL
                        USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
                        USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
                        USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
                        USE_REENTRANT_API
  Built under linux
  Compiled at Sep 17 2013 17:56:51
  %ENV:
    PERL5LIB="/home/pmartini/perl5/lib/perl5:/home/pmartini/perl5/lib/perl5:"
    PERL_LOCAL_LIB_ROOT=":/home/pmartini/perl5:/home/pmartini/perl5"
    PERL_MB_OPT="--install_base /home/pmartini/perl5"
    PERL_MM_OPT="INSTALL_BASE=/home/pmartini/perl5"
  @INC:
    lib
    /home/pmartini/perl5/lib/perl5/x86_64-linux-thread-multi
    /home/pmartini/perl5/lib/perl5
    /home/pmartini/perl5/lib/perl5/x86_64-linux-thread-multi
    /home/pmartini/perl5/lib/perl5
    /usr/local/lib/perl5/site_perl/5.19.4/x86_64-linux-thread-multi
    /usr/local/lib/perl5/site_perl/5.19.4
    /usr/local/lib/perl5/5.19.4/x86_64-linux-thread-multi
    /usr/local/lib/perl5/5.19.4
    /usr/local/lib/perl5/site_perl
    .



>
> Please note the comment that I added to ck_subr in 3a74e0e282 (you may
> find the commit message informative, too):
>
> +           /* After a syntax error in a lexical sub, the cv that
> +              rv2cv_op_cv returns may be a nameless stub. */
> +           if (!hek) return ck_entersub_args_list(o);;
>
> Also:
>
> # Failed test 28 - Multiple prototype declarations warns at
> op/attrproto.t line 77
> #      got 'Attribute prototype($$$) discards earlier prototype
> attribute in same sub at (eval 14) line 1.
> # '
> # expected /attribute prototype\(\$\$\$\) discards earlier prototype
> attribute in same sub/
> op/attrproto.t ....................................................
> Failed 1/48 subtests
>
> I think the test is wrong here.  Should be a capital A.

Err, you're right, I changed the pod before committing and apparently
changed op.c afterwards.  I have to figure out why I'm not seeing name
as NULL in the case where you are though.

>
> Also, if you are going to pass a GV straight into validate_proto, it
> needs to handle GVs and not print the asterisk:
>
> $ ./perl -Ilib -lwe 'use attributes __PACKAGE__, \&foo, "prototype([)"'
> Missing ']' in prototype for *main::foo : [ at lib/attributes.pm line 33.
> Prototype mismatch: sub main::foo: none vs ([) at lib/attributes.pm line 33.
>
> Maybe validate_proto should call the cv_name we discussed earlier, and
> that will be an excuse for adding it. :-)

That's why I'd gone for the gv_efullname3 route before :-)  Making a
separate cv_name function certainly looks useful, as soon as I figure
out where that NULL name is coming from.

>
> These are just the first few things I have noticed.  I have not
> scrutinized your new patches yet.
>
> --
>
> Father Chrysostomos
>

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