Skip Menu |
 
Report information
Id: 37897
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: gisle [at] ActiveState.com
Cc:
AdminCc:

Operating System: Linux
PatchStatus: (no value)
Severity: low
Type: core
Perl Version: 5.9.3
Fixed In: (no value)



Subject: sprintf of version objects
Date: Mon, 12 Dec 2005 02:50:20 -0800
To: perlbug [...] perl.org
From: Gisle Aas <gisle [...] ActiveState.com>
Download (untitled) / with headers
text/plain 3.1k
This is a bug report for perl from gisle@activestate.com, generated with the help of perlbug 1.35 running under perl v5.9.3. ----------------------------------------------------------------- [Please enter your report here] Version objects are special cased in perl's sprintf() code, but the result is not quite right if anything but "%vd" is used: $ perl -e 'printf "%vd\n", $^V' v5.9.3 $ perl -e 'printf "%v3d\n", $^V' v5.9.3 $ perl -e 'printf "%v.3d\n", $^V' 118.053.046.057.046.051 $ perl -e 'printf "%vx\n", $^V' 76.35.2e.39.2e.33 [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=core severity=low --- Site configuration information for perl v5.9.3: Configured by gisle at Fri Dec 2 10:27:35 CET 2005. Summary of my perl5 (revision 5 version 9 subversion 3 patch 26241) configuration: Platform: osname=linux, osvers=2.6.12-gentoo-r4, archname=i686-linux uname='linux ask.g.aas.no 2.6.12-gentoo-r4 #3 smp mon jul 11 19:30:39 cest 2005 i686 intel(r) pentium(r) 4 cpu 2.80ghz genuineintel gnulinux ' config_args='-Dprefix=/opt/perl/26241 -Dusedevel -Uversiononly -Doptimize=-g -ders' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-g', cppflags='-DDEBUGGING -fno-strict-aliasing -pipe' ccversion='', gccversion='3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.3.5.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.3.5' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Locally applied patches: DEVEL24148 --- @INC for perl v5.9.3: /opt/perl/26241/lib/5.9.3/i686-linux /opt/perl/26241/lib/5.9.3 /opt/perl/26241/lib/site_perl/5.9.3/i686-linux /opt/perl/26241/lib/site_perl/5.9.3 /opt/perl/26241/lib/site_perl . --- Environment for perl v5.9.3: HOME=/home/gisle LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/opt/perl/bin:/usr/kde/3.4/bin:/home/gisle/bin:/local/ccache:/local/perl/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.4.4:/opt/ghc/bin:/usr/qt/3/bin:/usr/kde/3.4/bin:/usr/games/bin:/opt/insight/bin PERL_BADLANG (unset) SHELL=/bin/bash
Subject: Re: [perl #37897] sprintf of version objects
Date: Mon, 12 Dec 2005 11:59:06 -0500
To: perl5-porters [...] perl.org
From: John Peacock <jpeacock [...] rowman.com>
Download (untitled) / with headers
text/plain 1013b
Gisle Aas (via RT) wrote: Show quoted text
> Version objects are special cased in perl's sprintf() code, but the result > is not quite right if anything but "%vd" is used: > > $ perl -e 'printf "%vd\n", $^V' > v5.9.3 > $ perl -e 'printf "%v3d\n", $^V' > v5.9.3 > $ perl -e 'printf "%v.3d\n", $^V' > 118.053.046.057.046.051 > $ perl -e 'printf "%vx\n", $^V' > 76.35.2e.39.2e.33
sv_vcatpvfn() being a good example of overloaded operations gone horribly awry, it will take me a while to suss out where/how to fix this. Out of curiosity, are you just working your way through every possible printf() combination, just to see what breaks? I cannot think of a possible reason for utilizing the last two constructs above, but that may just be a failure of imagination. Can we just make them syntax errors? <ducks> John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
CC: perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: 12 Dec 2005 09:52:37 -0800
To: John Peacock <jpeacock [...] rowman.com>
From: Gisle Aas <gisle [...] ActiveState.com>
Download (untitled) / with headers
text/plain 1.3k
John Peacock <jpeacock@rowman.com> writes: Show quoted text
> Gisle Aas (via RT) wrote:
> > Version objects are special cased in perl's sprintf() code, but the result > > is not quite right if anything but "%vd" is used: > > $ perl -e 'printf "%vd\n", $^V' > > v5.9.3 > > $ perl -e 'printf "%v3d\n", $^V' > > v5.9.3 > > $ perl -e 'printf "%v.3d\n", $^V' > > 118.053.046.057.046.051 > > $ perl -e 'printf "%vx\n", $^V' > > 76.35.2e.39.2e.33
> > sv_vcatpvfn() being a good example of overloaded operations gone > horribly awry, it will take me a while to suss out where/how to fix > this. Out of curiosity, are you just working your way through every > possible printf() combination, just to see what breaks?
I'm just looking at Perl_sv_vcatpvfn and was kind of surprised by the special casing of version objects and how simple minded this was. The behaviour exposed does not match how sprintf is documented at all. Show quoted text
> I cannot think of a possible reason for utilizing the last two > constructs above, but that may just be a failure of imagination. > Can we just make them syntax errors?
There are some examples of how the vector flag can be useful in the sprintf docs, but I can't think of any way it is usful for printing of version objects. My suggestion would be just to remove this special casing and let version objects be vectorized as strings by sprintf. --Gisle
Subject: Re: [perl #37897] sprintf of version objects
Date: Mon, 12 Dec 2005 19:17:13 +0100
To: perl5-porters [...] perl.org
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
On 12 Dec 2005 09:52:37 -0800, Gisle Aas <gisle@ActiveState.com> wrote: Show quoted text
> John Peacock <jpeacock@rowman.com> writes: >
> > Gisle Aas (via RT) wrote:
> > > Version objects are special cased in perl's sprintf() code, but the > > > result is not quite right if anything but "%vd" is used: > > > $ perl -e 'printf "%vd\n", $^V' > > > v5.9.3 > > > $ perl -e 'printf "%v3d\n", $^V' > > > v5.9.3 > > > $ perl -e 'printf "%v.3d\n", $^V' > > > 118.053.046.057.046.051 > > > $ perl -e 'printf "%vx\n", $^V' > > > 76.35.2e.39.2e.33
> > > > sv_vcatpvfn() being a good example of overloaded operations gone > > horribly awry, it will take me a while to suss out where/how to fix > > this. Out of curiosity, are you just working your way through every > > possible printf() combination, just to see what breaks?
lt09:/pro/3gl/CPAN/perl-current 117 > ./perl -e '($_=sprintf"%vx\n",$^V)=~s^\d\d.3\d.2^Just Anoth^;s$.3..2$r P$;s;.3.;rl Hacker,;;print' Just Another Perl Hacker, lt09:/pro/3gl/CPAN/perl-current 118 > Show quoted text
> I'm just looking at Perl_sv_vcatpvfn and was kind of surprised by the > special casing of version objects and how simple minded this was. The > behaviour exposed does not match how sprintf is documented at all. >
> > I cannot think of a possible reason for utilizing the last two > > constructs above, but that may just be a failure of imagination. > > Can we just make them syntax errors?
> > There are some examples of how the vector flag can be useful in the > sprintf docs, but I can't think of any way it is usful for printing of > version objects. My suggestion would be just to remove this special > casing and let version objects be vectorized as strings by sprintf. > > --Gisle >
-- H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using Perl 5.6.2, 5.8.0, 5.8.5, & 5.9.2 on HP-UX 10.20, 11.00 & 11.11, AIX 4.3 & 5.2, SuSE 9.2 & 9.3, and Cygwin. http://www.cmve.net/~merijn Smoking perl: http://www.test-smoke.org, perl QA: http://qa.perl.org reports to: smokers-reports@perl.org, perl-qa@perl.org
CC: perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: Mon, 12 Dec 2005 13:19:42 -0500
To: Gisle Aas <gisle [...] ActiveState.com>
From: John Peacock <jpeacock [...] rowman.com>
Download (untitled) / with headers
text/plain 876b
Gisle Aas wrote: Show quoted text
> There are some examples of how the vector flag can be useful in the > sprintf docs, but I can't think of any way it is usful for printing of > version objects. My suggestion would be just to remove this special > casing and let version objects be vectorized as strings by sprintf.
Hysterical Raisins, and all that. $^V was documented as returning a v-string until the version magic patch came in, so the minimal amount of patching was done to preserve that. The problem is that printf("%vd", $^V); exists in the wild so we have to carefully neuter that code path so that "%vd" still works for v-strings and is equivalent to "%s" for version objects. John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
CC: perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: Mon, 12 Dec 2005 12:22:33 -0600
To: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
From: Andy Lester <andy [...] petdance.com>
Download (untitled) / with headers
text/plain 475b
On Mon, Dec 12, 2005 at 07:17:13PM +0100, H.Merijn Brand (h.m.brand@xs4all.nl) wrote: Show quoted text
> lt09:/pro/3gl/CPAN/perl-current 117 > ./perl -e '($_=sprintf"%vx\n",$^V)=~s^\d\d.3\d.2^Just Anoth^;s$.3..2$r P$;s;.3.;rl Hacker,;;print' > Just Another Perl Hacker, > lt09:/pro/3gl/CPAN/perl-current 118 >
If that doesn't belong in t/op/sprintf.t, I don't know what does. Are you going to patch it or should I? -- Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance
CC: Gisle Aas <gisle [...] ActiveState.com>, perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: Tue, 13 Dec 2005 13:09:43 -0500
From: John Peacock <jpeacock [...] rowman.com>
Download (untitled) / with headers
text/plain 727b
John Peacock wrote: Show quoted text
> "%vd" still works for v-strings and is equivalent to "%s" for version > objects.
I realized last night what I need to do (but didn't have the brainpower to do it yet): IIF the term is a version object, then I'll convert that back to its v-string equivalent and allow the existing 'v' format code (i.e. width, precision, etc) do its damage. That should be much easier than figuring out how to ignore all of the undesirable format flags (as the current simplistic method does). Thoughts? Complaints? John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
CC: perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: 13 Dec 2005 10:52:53 -0800
To: John Peacock <jpeacock [...] rowman.com>
From: Gisle Aas <gisle [...] ActiveState.com>
Download (untitled) / with headers
text/plain 421b
John Peacock <jpeacock@rowman.com> writes: Show quoted text
> IIF the term is a version object, then I'll convert that back to its > v-string equivalent and allow the existing 'v' format code > (i.e. width, precision, etc) do its damage. That should be much > easier than figuring out how to ignore all of the undesirable format > flags (as the current simplistic method does). > > Thoughts? Complaints?
Sounds good to me. --Gisle
CC: perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: 13 Dec 2005 12:09:39 -0800
To: John Peacock <jpeacock [...] rowman.com>
From: Gisle Aas <gisle [...] ActiveState.com>
Download (untitled) / with headers
text/plain 3.6k
John Peacock <jpeacock@rowman.com> writes: Show quoted text
> IIF the term is a version object, then I'll convert that back to its > v-string equivalent and allow the existing 'v' format code > (i.e. width, precision, etc) do its damage. That should be much > easier than figuring out how to ignore all of the undesirable format > flags (as the current simplistic method does).
How about something like the following patch? It allow any array reference to be passed as the sprintf vector argument and then the only special case for version objects is that its hash is dereferenced one level to make it an array. Now I can do this: $ perl -e 'printf "%vd\n", $^V' 5.9.3 $ perl -e 'printf "%v04d\n", $^V' 0005.0009.0003 $ perl -e 'printf "%vb\n", $^V' 101.1001.11 $ perl -e 'printf "%v04d\n", [1..5]' 0001.0002.0003.0004.0005 I find this kind of cool, but I'm not sure if this is really useful somehow. It just means that: $str = sprintf "%vX", \@array; is short for: $str = join(".", map sprintf("%X", $_), @array); --Gisle ==== //depot/perl/sv.c#1056 - /home/gisle/perl/blead/sv.c ==== @@ -7811,6 +7811,8 @@ const char *eptr = Nullch; STRLEN elen = 0; SV *vecsv = Nullsv; + AV *vecav = Nullav; + I32 vecavix; const U8 *vecstr = Null(U8*); STRLEN veclen = 0; char c = 0; @@ -8005,23 +8007,17 @@ } else if (efix ? (efix > 0 && efix <= svmax) : svix < svmax) { vecsv = svargs[efix ? efix-1 : svix++]; - vecstr = (U8*)SvPV_const(vecsv,veclen); - vec_utf8 = DO_UTF8(vecsv); - /* if this is a version object, we need to return the - * stringified representation (which the SvPVX_const has - * already done for us), but not vectorize the args - */ - if ( *q == 'd' && sv_derived_from(vecsv,"version") ) - { - q++; /* skip past the rest of the %vd format */ - eptr = (const char *) vecstr; - elen = veclen; - if (elen && *eptr == 'v') { - eptr++; - elen--; - } - vectorize=FALSE; - goto string; + if (sv_derived_from(vecsv,"version")) { + vecsv = *hv_fetch((HV*)SvRV(vecsv), "version", 7, FALSE); + } + if (SvROK(vecsv) && SvTYPE(SvRV(vecsv)) == SVt_PVAV) { + vecav = (AV*)SvRV(vecsv); + vecavix = 0; + veclen = av_len(vecav) + 1; + } + else { + vecstr = (U8*)SvPV_const(vecsv,veclen); + vec_utf8 = DO_UTF8(vecsv); } } else { @@ -8219,18 +8215,25 @@ format_vd: #endif if (vectorize) { - STRLEN ulen; if (!veclen) continue; - if (vec_utf8) - uv = utf8n_to_uvchr(vecstr, veclen, &ulen, - UTF8_ALLOW_ANYUV); + if (vecav) { + uv = SvUV(*av_fetch(vecav, vecavix, 0)); + vecavix++; + veclen--; + } else { - uv = *vecstr; - ulen = 1; + STRLEN ulen; + if (vec_utf8) + uv = utf8n_to_uvchr(vecstr, veclen, &ulen, + UTF8_ALLOW_ANYUV); + else { + uv = *vecstr; + ulen = 1; + } + vecstr += ulen; + veclen -= ulen; } - vecstr += ulen; - veclen -= ulen; if (plus) esignbuf[esignlen++] = plus; } @@ -8304,19 +8307,26 @@ uns_integer: if (vectorize) { - STRLEN ulen; vector: if (!veclen) continue; - if (vec_utf8) - uv = utf8n_to_uvchr(vecstr, veclen, &ulen, - UTF8_ALLOW_ANYUV); + if (vecav) { + uv = SvUV(*av_fetch(vecav, vecavix, 0)); + vecavix++; + veclen--; + } else { - uv = *vecstr; - ulen = 1; + STRLEN ulen; + if (vec_utf8) + uv = utf8n_to_uvchr(vecstr, veclen, &ulen, + UTF8_ALLOW_ANYUV); + else { + uv = *vecstr; + ulen = 1; + } + vecstr += ulen; + veclen -= ulen; } - vecstr += ulen; - veclen -= ulen; } else if (args) { switch (intsize) {
CC: perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: Tue, 13 Dec 2005 15:24:23 -0500
To: Gisle Aas <gisle [...] ActiveState.com>
From: John Peacock <jpeacock [...] rowman.com>
Download (untitled) / with headers
text/plain 911b
Gisle Aas wrote: Show quoted text
> How about something like the following patch? It allow any array > reference to be passed as the sprintf vector argument and then the > only special case for version objects is that its hash is dereferenced > one level to make it an array. Now I can do this:
I don't know if there is any utility to this more general patch, since it doesn't really map very directly with the existing sprintf notation. It should be very straightforward to just iterate over the version object's array and create the v-string equivalent (that's all I was planning on doing. The only special case is $^V (not any generic version object), so I'd think we want to keep the change to the absolute minimum. John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
CC: perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: Tue, 13 Dec 2005 17:11:53 -0500
To: Gisle Aas <gisle [...] ActiveState.com>
From: John Peacock <jpeacock [...] rowman.com>
Gisle Aas wrote: Show quoted text
> John Peacock <jpeacock@rowman.com> writes: >
>> IIF the term is a version object, then I'll convert that back to its >> v-string equivalent and allow the existing 'v' format code >> (i.e. width, precision, etc) do its damage. That should be much >> easier than figuring out how to ignore all of the undesirable format >> flags (as the current simplistic method does). >> >> Thoughts? Complaints?
> > Sounds good to me.
OK, here's my alternate patch, along with tests. This simply recreates a v-string from the version object and then lets the existing vector handling work the same as it always did. The only thing I didn't do is to decide what to do about the special cases of cpan-style versions or alpha versions. Since the only situation that should be in code in the wild refers to $^V, we could actually make this even more specific by determining if vecsv == PL_patchlevel. John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
Download sv.c.diff
text/plain 3.1k
=== sv.c ================================================================== --- sv.c (revision 18901) +++ sv.c (local) @@ -8000,24 +8000,41 @@ } else if (efix ? (efix > 0 && efix <= svmax) : svix < svmax) { vecsv = svargs[efix ? efix-1 : svix++]; - vecstr = (U8*)SvPV_const(vecsv,veclen); - vec_utf8 = DO_UTF8(vecsv); - /* if this is a version object, we need to return the - * stringified representation (which the SvPVX_const has - * already done for us), but not vectorize the args + + /* if this is a version object, we need to convert + * back into v-string notation and then let the + * vectorize happen normally */ - if ( *q == 'd' && sv_derived_from(vecsv,"version") ) + if ( sv_derived_from(vecsv,"version") ) { - q++; /* skip past the rest of the %vd format */ - eptr = (const char *) vecstr; - elen = veclen; - if (elen && *eptr == 'v') { - eptr++; - elen--; - } - vectorize=FALSE; - goto string; + I32 i, len; + UV digit; + U8 tmpbuf[UTF8_MAXBYTES+1]; + U8 *tmpend; + SV *sv = sv_newmortal(); + AV *av = + (AV *)SvRV(*hv_fetch((HV*)SvRV(vecsv), + "version", 7, FALSE)); + len = av_len(av); + sv_setpvn(sv, "", 0); + vecsv = sv_mortalcopy(vecsv); + + digit = (UV)SvIV(*av_fetch(av, 0, 0)); + tmpend = uvchr_to_utf8(tmpbuf, digit); + sv_setpvn(vecsv, (const char*)tmpbuf, tmpend - tmpbuf); + veclen = tmpend - tmpbuf; + + for ( i = 1 ; i <= len ; i++ ) { + digit = (UV)SvIV(*av_fetch(av, i, 0)); + tmpend = uvchr_to_utf8(tmpbuf, digit); + sv_catpvn(vecsv, (const char*)tmpbuf, tmpend - tmpbuf); + veclen += tmpend - tmpbuf; + if (!UNI_IS_INVARIANT(NATIVE_TO_UNI(digit))) + SvUTF8_on(vecsv); + } } + vecstr = (U8*)SvPV_const(vecsv,veclen); + vec_utf8 = DO_UTF8(vecsv); } else { vecstr = (U8*)""; === t/op/sprintf.t ================================================================== --- t/op/sprintf.t (revision 18901) +++ t/op/sprintf.t (local) @@ -245,8 +245,10 @@ >%vd< >[version::qv("1.2.3")]< >1.2.3< >%v.3d< >"\01\02\03"< >001.002.003< >%0v3d< >"\01\02\03"< >001.002.003< +>%v.3d< >[version::qv("1.2.3")]< >001.002.003< >%-v3d< >"\01\02\03"< >1 .2 .3 < >%+-v3d< >"\01\02\03"< >+1 .2 .3 < +>%+-v3d< >[version::qv("1.2.3")]< >+1 .2 .3 < >%v4.3d< >"\01\02\03"< > 001. 002. 003< >%0v4.3d< >"\01\02\03"< >0001.0002.0003< >%0*v2d< >['-', "\0\7\14"]< >00-07-12< @@ -257,6 +259,7 @@ >%v*.*d< >["\01\02\03", 4, 3]< > 001. 002. 003< >%0v*.*d< >["\01\02\03", 4, 3]< >0001.0002.0003< >%0*v*d< >['-', "\0\7\13", 2]< >00-07-11< +>%0*v*d< >['-', version::qv("0.7.11"), 2]< >00-07-11< >%e< >1234.875< >1.234875e+03< >%e< >0.000012345< >1.234500e-05< >%e< >1234567E96< >1.234567e+102< @@ -391,6 +394,8 @@ >%-010x< >2**32-1< >ffffffff < >%0-10x< >2**32-1< >ffffffff < >%0*x< >[-10, ,2**32-1]< >ffffffff < +>%vx< >[version::qv("1.2.3")]< >1.2.3< +>%vx< >[version::qv("1.20.300")]< >1.14.12c< >%y< >''< >%y INVALID< >%z< >''< >%z INVALID< >%2$d %1$d< >[12, 34]< >34 12<
CC: Gisle Aas <gisle [...] ActiveState.com>, perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: Wed, 14 Dec 2005 07:57:02 -0500
From: John Peacock <jpeacock [...] rowman.com>
Download (untitled) / with headers
text/plain 963b
John Peacock wrote: Show quoted text
> OK, here's my alternate patch, along with tests. This simply recreates > a v-string from the version object and then lets the existing vector > handling work the same as it always did. The only thing I didn't do is > to decide what to do about the special cases of cpan-style versions or > alpha versions.
Nah, ignore that; it encapsulates too much knowledge about how version objects are constructed outside of where version objects are defined (util.c). The attached is much better, in that it uses the complete toke.c:scan_vstring logic to create a new v-string. It is much safer and wouldn't need to change if I made any alteration to the version object design (<vassini>inconceivable</vassini>). It is also vastly smaller and easier to understand... John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747
Download sv.c.diff2
text/plain 2.5k
=== sv.c ================================================================== --- sv.c (revision 18901) +++ sv.c (local) @@ -8002,21 +8002,22 @@ vecsv = svargs[efix ? efix-1 : svix++]; vecstr = (U8*)SvPV_const(vecsv,veclen); vec_utf8 = DO_UTF8(vecsv); - /* if this is a version object, we need to return the - * stringified representation (which the SvPVX_const has - * already done for us), but not vectorize the args + + /* if this is a version object, we need to convert + * back into v-string notation and then let the + * vectorize happen normally */ - if ( *q == 'd' && sv_derived_from(vecsv,"version") ) + if ( sv_derived_from(vecsv,"version") ) { - q++; /* skip past the rest of the %vd format */ - eptr = (const char *) vecstr; - elen = veclen; - if (elen && *eptr == 'v') { - eptr++; - elen--; - } - vectorize=FALSE; - goto string; + char *tmpend; + char *version = savesvpv(vecsv); + vecsv = sv_newmortal(); + PL_bufend = version + veclen; + tmpend = scan_vstring((const char *)version,vecsv); + veclen = tmpend - version; + vecstr = (U8*)SvPV_const(vecsv,veclen); + vec_utf8 = DO_UTF8(vecsv); + Safefree(version); } } else { === t/op/sprintf.t ================================================================== --- t/op/sprintf.t (revision 18901) +++ t/op/sprintf.t (local) @@ -245,8 +245,10 @@ >%vd< >[version::qv("1.2.3")]< >1.2.3< >%v.3d< >"\01\02\03"< >001.002.003< >%0v3d< >"\01\02\03"< >001.002.003< +>%v.3d< >[version::qv("1.2.3")]< >001.002.003< >%-v3d< >"\01\02\03"< >1 .2 .3 < >%+-v3d< >"\01\02\03"< >+1 .2 .3 < +>%+-v3d< >[version::qv("1.2.3")]< >+1 .2 .3 < >%v4.3d< >"\01\02\03"< > 001. 002. 003< >%0v4.3d< >"\01\02\03"< >0001.0002.0003< >%0*v2d< >['-', "\0\7\14"]< >00-07-12< @@ -257,6 +259,7 @@ >%v*.*d< >["\01\02\03", 4, 3]< > 001. 002. 003< >%0v*.*d< >["\01\02\03", 4, 3]< >0001.0002.0003< >%0*v*d< >['-', "\0\7\13", 2]< >00-07-11< +>%0*v*d< >['-', version::qv("0.7.11"), 2]< >00-07-11< >%e< >1234.875< >1.234875e+03< >%e< >0.000012345< >1.234500e-05< >%e< >1234567E96< >1.234567e+102< @@ -391,6 +394,8 @@ >%-010x< >2**32-1< >ffffffff < >%0-10x< >2**32-1< >ffffffff < >%0*x< >[-10, ,2**32-1]< >ffffffff < +>%vx< >[version::qv("1.2.3")]< >1.2.3< +>%vx< >[version::qv("1.20.300")]< >1.14.12c< >%y< >''< >%y INVALID< >%z< >''< >%z INVALID< >%2$d %1$d< >[12, 34]< >34 12<
CC: perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: 14 Dec 2005 06:43:04 -0800
To: John Peacock <jpeacock [...] rowman.com>
From: Gisle Aas <gisle [...] ActiveState.com>
Download (untitled) / with headers
text/plain 2.5k
John Peacock <jpeacock@rowman.com> writes: Show quoted text
> --- sv.c (revision 18901) > +++ sv.c (local) > @@ -8002,21 +8002,22 @@ > vecsv = svargs[efix ? efix-1 : svix++]; > vecstr = (U8*)SvPV_const(vecsv,veclen); > vec_utf8 = DO_UTF8(vecsv); > - /* if this is a version object, we need to return the > - * stringified representation (which the SvPVX_const has > - * already done for us), but not vectorize the args > + > + /* if this is a version object, we need to convert > + * back into v-string notation and then let the > + * vectorize happen normally > */ > - if ( *q == 'd' && sv_derived_from(vecsv,"version") ) > + if ( sv_derived_from(vecsv,"version") ) > { > - q++; /* skip past the rest of the %vd format */ > - eptr = (const char *) vecstr; > - elen = veclen; > - if (elen && *eptr == 'v') { > - eptr++; > - elen--; > - } > - vectorize=FALSE; > - goto string; > + char *tmpend; > + char *version = savesvpv(vecsv); > + vecsv = sv_newmortal(); > + PL_bufend = version + veclen; > + tmpend = scan_vstring((const char *)version,vecsv); > + veclen = tmpend - version;
This calculation is meaningless as it is overwritten in the next statement, so you don't need tmpend at all. Show quoted text
> + vecstr = (U8*)SvPV_const(vecsv,veclen); > + vec_utf8 = DO_UTF8(vecsv); > + Safefree(version); > } > } > else {
I suggest you make it: ==== //depot/perl/sv.c#1059 - /home/gisle/perl/blead/sv.c ==== @@ -7995,21 +7995,20 @@ vecsv = svargs[efix ? efix-1 : svix++]; vecstr = (U8*)SvPV_const(vecsv,veclen); vec_utf8 = DO_UTF8(vecsv); - /* if this is a version object, we need to return the - * stringified representation (which the SvPVX_const has - * already done for us), but not vectorize the args + + /* if this is a version object, we need to convert + * back into v-string notation and then let the + * vectorize happen normally */ - if ( *q == 'd' && sv_derived_from(vecsv,"version") ) + if (sv_derived_from(vecsv, "version")) { - q++; /* skip past the rest of the %vd format */ - eptr = (const char *) vecstr; - elen = veclen; - if (elen && *eptr == 'v') { - eptr++; - elen--; - } - vectorize=FALSE; - goto string; + char *version = savesvpv(vecsv); + vecsv = sv_newmortal(); + PL_bufend = version + veclen; + scan_vstring((const char *)version, vecsv); + vecstr = (U8*)SvPV_const(vecsv, veclen); + vec_utf8 = DO_UTF8(vecsv); + Safefree(version); } } else {
CC: perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: 14 Dec 2005 06:52:19 -0800
To: John Peacock <jpeacock [...] rowman.com>
From: Gisle Aas <gisle [...] ActiveState.com>
Download (untitled) / with headers
text/plain 309b
Gisle Aas <gisle@ActiveState.com> writes: Show quoted text
> + scan_vstring((const char *)version, vecsv);
This cast is also useless. A plain (char*) can always be passed to a function taking (const char*). You might even declare "version" as a "const char*" in the first place as its chars isn't modified. --Gisle
CC: perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: Wed, 14 Dec 2005 10:12:56 -0500
To: Gisle Aas <gisle [...] ActiveState.com>
From: John Peacock <jpeacock [...] rowman.com>
Download (untitled) / with headers
text/plain 816b
Gisle Aas wrote: Show quoted text
> This calculation is meaningless as it is overwritten in the next > statement, so you don't need tmpend at all.
Duh! I misread that and thought that SvPV_const(vecsv,veclen) required the length to work, not that it *filled* *in* the length. There are a lot of those un[der]documented macros lurking around that don't make it that easy to change things. Attached is a new path with Gisle's suggested changes as well as documenting why we need to set PL_bufend (that seems unnecessarily obscure without comment, since not everyone has spent lots of time wandering through the depths of toke.c). John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
Download sv.c.diff3
text/plain 2.5k
=== sv.c ================================================================== --- sv.c (revision 18901) +++ sv.c (local) @@ -8002,21 +8002,24 @@ vecsv = svargs[efix ? efix-1 : svix++]; vecstr = (U8*)SvPV_const(vecsv,veclen); vec_utf8 = DO_UTF8(vecsv); - /* if this is a version object, we need to return the - * stringified representation (which the SvPVX_const has - * already done for us), but not vectorize the args + + /* if this is a version object, we need to convert + * back into v-string notation and then let the + * vectorize happen normally */ - if ( *q == 'd' && sv_derived_from(vecsv,"version") ) + if ( sv_derived_from(vecsv,"version") ) { - q++; /* skip past the rest of the %vd format */ - eptr = (const char *) vecstr; - elen = veclen; - if (elen && *eptr == 'v') { - eptr++; - elen--; - } - vectorize=FALSE; - goto string; + char *version = savesvpv(vecsv); + vecsv = sv_newmortal(); + /* scan_vstring is expected to be called during + * tokenization, so we need to fake up the end + * of the buffer for it + */ + PL_bufend = version + veclen; + scan_vstring((const char *)version,vecsv); + vecstr = (U8*)SvPV_const(vecsv,veclen); + vec_utf8 = DO_UTF8(vecsv); + Safefree(version); } } else { === t/op/sprintf.t ================================================================== --- t/op/sprintf.t (revision 18901) +++ t/op/sprintf.t (local) @@ -245,8 +245,10 @@ >%vd< >[version::qv("1.2.3")]< >1.2.3< >%v.3d< >"\01\02\03"< >001.002.003< >%0v3d< >"\01\02\03"< >001.002.003< +>%v.3d< >[version::qv("1.2.3")]< >001.002.003< >%-v3d< >"\01\02\03"< >1 .2 .3 < >%+-v3d< >"\01\02\03"< >+1 .2 .3 < +>%+-v3d< >[version::qv("1.2.3")]< >+1 .2 .3 < >%v4.3d< >"\01\02\03"< > 001. 002. 003< >%0v4.3d< >"\01\02\03"< >0001.0002.0003< >%0*v2d< >['-', "\0\7\14"]< >00-07-12< @@ -257,6 +259,7 @@ >%v*.*d< >["\01\02\03", 4, 3]< > 001. 002. 003< >%0v*.*d< >["\01\02\03", 4, 3]< >0001.0002.0003< >%0*v*d< >['-', "\0\7\13", 2]< >00-07-11< +>%0*v*d< >['-', version::qv("0.7.11"), 2]< >00-07-11< >%e< >1234.875< >1.234875e+03< >%e< >0.000012345< >1.234500e-05< >%e< >1234567E96< >1.234567e+102< @@ -391,6 +394,8 @@ >%-010x< >2**32-1< >ffffffff < >%0-10x< >2**32-1< >ffffffff < >%0*x< >[-10, ,2**32-1]< >ffffffff < +>%vx< >[version::qv("1.2.3")]< >1.2.3< +>%vx< >[version::qv("1.20.300")]< >1.14.12c< >%y< >''< >%y INVALID< >%z< >''< >%z INVALID< >%2$d %1$d< >[12, 34]< >34 12<
CC: perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: Wed, 14 Dec 2005 21:30:09 -0800
To: John Peacock <jpeacock [...] rowman.com>
From: Yitzchak Scott-Thoennes <sthoenna [...] efn.org>
Download (untitled) / with headers
text/plain 474b
On Wed, Dec 14, 2005 at 10:12:56AM -0500, John Peacock wrote: Show quoted text
> Gisle Aas wrote:
> >This calculation is meaningless as it is overwritten in the next > >statement, so you don't need tmpend at all.
> > Duh! I misread that and thought that SvPV_const(vecsv,veclen) required > the length to work, not that it *filled* *in* the length. There are a > lot of those un[der]documented macros lurking around that don't make it > that easy to change things.
Patches welcome...
CC: John Peacock <jpeacock [...] rowman.com>, perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: Wed, 14 Dec 2005 21:32:36 -0800
To: Gisle Aas <gisle [...] ActiveState.com>
From: Yitzchak Scott-Thoennes <sthoenna [...] efn.org>
Download (untitled) / with headers
text/plain 1.1k
On Tue, Dec 13, 2005 at 12:09:39PM -0800, Gisle Aas wrote: Show quoted text
> John Peacock <jpeacock@rowman.com> writes: >
> > IIF the term is a version object, then I'll convert that back to its > > v-string equivalent and allow the existing 'v' format code > > (i.e. width, precision, etc) do its damage. That should be much > > easier than figuring out how to ignore all of the undesirable format > > flags (as the current simplistic method does).
> > How about something like the following patch? It allow any array > reference to be passed as the sprintf vector argument and then the > only special case for version objects is that its hash is dereferenced > one level to make it an array. Now I can do this: > > $ perl -e 'printf "%vd\n", $^V' > 5.9.3 > $ perl -e 'printf "%v04d\n", $^V' > 0005.0009.0003 > $ perl -e 'printf "%vb\n", $^V' > 101.1001.11 > $ perl -e 'printf "%v04d\n", [1..5]' > 0001.0002.0003.0004.0005 > > I find this kind of cool, but I'm not sure if this is really useful > somehow. It just means that: > > $str = sprintf "%vX", \@array; > > is short for: > > $str = join(".", map sprintf("%X", $_), @array);
I like this idea a lot.
CC: perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: 15 Dec 2005 02:49:47 -0800
To: John Peacock <jpeacock [...] rowman.com>
From: Gisle Aas <gisle [...] ActiveState.com>
Download (untitled) / with headers
text/plain 645b
John Peacock <jpeacock@rowman.com> writes: Show quoted text
> Attached is a new path with Gisle's suggested changes as well as > documenting why we need to set PL_bufend
I applied this as change 26365 and added some extra test cases. I was surprised by these: Show quoted text
>%vd< >[version::qv("1.2")]< >1.2.0< >%vd< >[version::qv("1.02")]< >1.2.0< >%vd< >[version::qv("1.002")]< >1.2.0< >%vd< >[version::qv("1.02_03")]< >1.23< >%vd< >[version::qv("50")]< >50.0.0< >%vd< >[version::qv("50_20")]< >50.200< >%vd< >[version::qv("5.005_03")]< >5.53<
Please advice what the expected output of these should be? --Gisle
CC: perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: Thu, 15 Dec 2005 10:34:45 -0500
To: Gisle Aas <gisle [...] ActiveState.com>
From: John Peacock <jpeacock [...] rowman.com>
Download (untitled) / with headers
text/plain 1.9k
Gisle Aas wrote: Show quoted text
> I applied this as change 26365 and added some extra test cases. I was > surprised by these: >
> >%vd< >[version::qv("1.2")]< >1.2.0< > >%vd< >[version::qv("1.02")]< >1.2.0< > >%vd< >[version::qv("1.002")]< >1.2.0< > >%vd< >[version::qv("1.02_03")]< >1.23< > >%vd< >[version::qv("50")]< >50.0.0< > >%vd< >[version::qv("50_20")]< >50.200< > >%vd< >[version::qv("5.005_03")]< >5.53<
> > Please advice what the expected output of these should be?
!!!!! IMPORTANT NOTE: qv() is *not* equivalent to new() !!!!! qv() forces the input value to be interpreted as if it were an "Extended version" (a version with 2 or more decimal points). It is intended to be used to provide a cross-Perl-version way of initializing version objects that does not rely on the v-string handling between 5.6.0 and 5.8.1. If you replace 'version::qv' with 'version->new' in all of those tests, you will get much more obvious answers. However, you will still not get what you might imagine when you are dealing with alpha versions, because the v-string code ignores underscores. So this is what happens: $v = version->new("1.02_03") => stringifies to 1.02_0300 printf("%vd",$v) => displays 1.020300 I suppose we could simply error out if the version object was an alpha version (and one of the vectorization formats was chosen), but I don't have that exposed via an easy to call function. It is just: hv_exists((HV*)SvRV(vecsv), "alpha", 5) but that doesn't check to make sure that the vecsv is actually an RV, but I don't see how that is possible when we just went through the sv_derived_from(vecsv,"version") even to get into that block. Let me sync up to what you applied and see what I can do that makes sense... John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
Subject: Re: [perl #37897] sprintf of version objects
Date: Thu, 15 Dec 2005 10:42:48 -0500
To: Yitzchak Scott-Thoennes <sthoenna [...] efn.org>, perl5-porters [...] perl.org
From: John Peacock <jpeacock [...] rowman.com>
Download (untitled) / with headers
text/plain 831b
Yitzchak Scott-Thoennes wrote: Show quoted text
> On Wed, Dec 14, 2005 at 10:12:56AM -0500, John Peacock wrote:
>> There are a >> lot of those un[der]documented macros lurking around that don't make it >> that easy to change things.
> > Patches welcome...
This is a grey area, though: Documented in perlapi == Public API Do we want to document all of these macros, just because they are used in the *Perl* source, or because they are useful to XS authors too? I feel stupid because I should have just checked to see what that unfamiliar function did. It took me a minute to find it once I realized I was misunderstanding the signature. :( John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
Subject: Re: [perl #37897] sprintf of version objects
Date: Fri, 3 Feb 2006 15:00:57 +0100
To: perl5-porters [...] perl.org
From: Rafael Garcia-Suarez <rgarciasuarez [...] mandriva.com>
Download (untitled) / with headers
text/plain 653b
Gisle Aas (via RT) wrote: Show quoted text
> Version objects are special cased in perl's sprintf() code, but the result > is not quite right if anything but "%vd" is used: > > $ perl -e 'printf "%vd\n", $^V' > v5.9.3 > $ perl -e 'printf "%v3d\n", $^V' > v5.9.3 > $ perl -e 'printf "%v.3d\n", $^V' > 118.053.046.057.046.051 > $ perl -e 'printf "%vx\n", $^V' > 76.35.2e.39.2e.33
Currently we have : $ cat t.pl printf "%vd\n", $^V; printf "%v3d\n", $^V; printf "%v.3d\n", $^V; printf "%vx\n", $^V; $ bleadperl t.pl 5.9.4 5. 9. 4 005.009.004 5.9.4 Those results are satisfying to me, can we close this bug ?
CC: perl5-porters [...] perl.org
Subject: Re: [perl #37897] sprintf of version objects
Date: Fri, 03 Feb 2006 09:21:08 -0500
To: Rafael Garcia-Suarez <rgarciasuarez [...] mandriva.com>
From: John Peacock <jpeacock [...] rowman.com>
Download (untitled) / with headers
text/plain 545b
Rafael Garcia-Suarez wrote: Show quoted text
> Currently we have : > > $ cat t.pl > printf "%vd\n", $^V; > printf "%v3d\n", $^V; > printf "%v.3d\n", $^V; > printf "%vx\n", $^V; > > $ bleadperl t.pl > 5.9.4 > 5. 9. 4 > 005.009.004 > 5.9.4 > > Those results are satisfying to me, can we close this bug ?
Ay ay, captain! John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
RT-Send-CC: perl5-porters [...] perl.org, john.peacock [...] havurah-software.org
Download (untitled) / with headers
text/plain 721b
On Thu Dec 15 07:35:12 2005, jpeacock@rowman.com wrote: Show quoted text
> I suppose we could simply error out if the version object was an alpha > version (and one of the vectorization formats was chosen), but I don't > have that exposed via an easy to call function. It is just: > > hv_exists((HV*)SvRV(vecsv), "alpha", 5)
I see that this change was made, in commit 34ba6322b644, but as a warning. Unfortunately, in causes sprintf("[%vd]", new version v1.1_1) to return "[%vd]", which means that the %-sequence is treated as invalid based on its argument. That doesn’t make sense to me. I think it should simply turn into the empty string, the way it does with sprintf("[%vd]") (with no arguments). -- Father Chrysostomos
Subject: Re: [perl #37897] sprintf of version objects
Date: Thu, 13 Sep 2012 21:01:26 -0400
To: perlbug-followup [...] perl.org
From: John Peacock <john.peacock [...] havurah-software.org>
Download (untitled) / with headers
text/plain 769b
On 09/13/2012 01:26 PM, Father Chrysostomos via RT wrote: Show quoted text
> I see that this change was made, in commit 34ba6322b644, but as a warning. > > Unfortunately, in causes sprintf("[%vd]", new version v1.1_1) to return > "[%vd]", which means that the %-sequence is treated as invalid based on > its argument.
I don't understand this paragraph. Could you show us with code what you see and what you would have expected to see? I see this: $ perl -e 'sprintf("[%vd]", new version v1.1_1)' vector argument not supported with alpha versions at -e line 1. which is precisely what was agreed to in the discussion. I would also note that this ticket was marked as resolved 6 1/2 years ago. I don't see any benefit in changing this extremely uncommon edge case now... John
RT-Send-CC: perl5-porters [...] perl.org, john.peacock [...] havurah-software.org
Download (untitled) / with headers
text/plain 1.3k
On Thu Sep 13 18:02:14 2012, john.peacock@havurah-software.org wrote: Show quoted text
> On 09/13/2012 01:26 PM, Father Chrysostomos via RT wrote:
> > I see that this change was made, in commit 34ba6322b644, but as a
warning. Show quoted text
> > > > Unfortunately, in causes sprintf("[%vd]", new version v1.1_1) to return > > "[%vd]", which means that the %-sequence is treated as invalid based on > > its argument.
> > I don't understand this paragraph. Could you show us with code what you > see and what you would have expected to see? I see this: > > $ perl -e 'sprintf("[%vd]", new version v1.1_1)' > vector argument not supported with alpha versions at -e line 1. > > which is precisely what was agreed to in the discussion.
Try it without the first s. :-) $ perl5.16.0 -e 'printf "[%vd]\n", new version v1.1_1' vector argument not supported with alpha versions at -e line 1. [%vd] I expect to see anything but %vd. Turn on -w and the extra warning is telling: $ perl5.16.0 -we 'printf "[%vd]\n", new version v1.1_1' vector argument not supported with alpha versions at -e line 1. Invalid conversion in printf: "%v" at -e line 1. [%vd] %vd is not invalid. It’s the argument that is invalid. I think the vector warning and an empty string for output would be best. After all, %vd produces the empty string for no argument at all. -- Father Chrysostomos
Subject: Re: [perl #37897] sprintf of version objects
Date: Sat, 15 Sep 2012 11:07:26 -0400
To: perlbug-followup [...] perl.org
From: John Peacock <john.peacock [...] havurah-software.org>
Download (untitled) / with headers
text/plain 450b
On 09/13/2012 11:42 PM, Father Chrysostomos via RT wrote: Show quoted text
> I think the vector warning and an empty string for output would be best. > After all, %vd produces the empty string for no argument at all. >
Like the attached? LD_LIBRARY_PATH=. ./perl -we 'printf "[%vd]\n", new version v1.1_1' vector argument not supported with alpha versions at -e line 1. [] I haven't figured out how to patch t/op/sprintf.t to cope with the warning yet... John
Download vector_alpha.diff
text/x-patch 820b

Message body is not shown because sender requested not to inline it.

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 664b
On Sat Sep 15 08:08:19 2012, john.peacock@havurah-software.org wrote: Show quoted text
> On 09/13/2012 11:42 PM, Father Chrysostomos via RT wrote:
> > I think the vector warning and an empty string for output would be best. > > After all, %vd produces the empty string for no argument at all. > >
> > Like the attached? > > LD_LIBRARY_PATH=. ./perl -we 'printf "[%vd]\n", new version v1.1_1' > vector argument not supported with alpha versions at -e line 1. > [] > > I haven't figured out how to patch t/op/sprintf.t to cope with the > warning yet...
Oops. Sorry. I have already fixed this, but I forgot to say so. The commit id is 8b6051f1221. -- Father Chrysostomos
RT-Send-CC: john.peacock [...] havurah-software.org
Download (untitled) / with headers
text/plain 662b
On Sat Sep 15 08:08:19 2012, john.peacock@havurah-software.org wrote: Show quoted text
> On 09/13/2012 11:42 PM, Father Chrysostomos via RT wrote:
> > I think the vector warning and an empty string for output would be best. > > After all, %vd produces the empty string for no argument at all. > >
> > Like the attached? > > LD_LIBRARY_PATH=. ./perl -we 'printf "[%vd]\n", new version v1.1_1' > vector argument not supported with alpha versions at -e line 1. > [] > > I haven't figured out how to patch t/op/sprintf.t to cope with the > warning yet...
Oops. Sorry. I have already fixed this, but I forgot to say so. The commit id is 8b6051f1221. -- Father Chrysostomos


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org