develooper Front page | perl.perl5.porters | Postings from January 2003

Re: [PATCH] %_ (was Re: [PATCH] operation on `PL_na' may be undefined)

Thread Previous | Thread Next
January 7, 2003 02:30
Re: [PATCH] %_ (was Re: [PATCH] operation on `PL_na' may be undefined)
Message ID:
Nicholas Clark <> wrote:
:On Mon, Dec 23, 2002 at 06:22:02AM +0000, wrote:
:> John Peacock <> wrote:
:> :Nicholas Clark wrote:
:> :> I wonder how many parts of the perl core can be reduced slightly in size
:> :> by changing %s SvPV_nolen(sv) to %_ sv.
:> :
:> :I was wondering that myself.  I may give it a shot, but it might be a fairly 
:> :megapatch.  We'll see if Hugo likes it...
:> Sounds like a fine idea to me: less code, no speed penalty that I can see.
:> If the patch is very large, best not to spam p5p with it - you can send
:> it to me direct, or put it up for ftp/http somewhere.
:It's not huge. I left out patching the OS/2 specific code in Devel::DProf,
:and I'll send the patch to ext/Encode/Unicode/Unicode.xs direct to Dan

Thanks, the three that refer to PerlIO_printf:
:+++ ./pad.c    Wed Dec 25 21:20:45 2002
:@@ -878,8 +878,8 @@ Perl_intro_my(pTHX)
:@@ -926,8 +926,8 @@ Perl_pad_leavemy(pTHX)
:+++ ./sv.c Wed Dec 25 19:24:59 2002
:@@ -9359,8 +9360,9 @@ Perl_sv_dup(pTHX_ SV *sstr, CLONE_PARAMS

give compiler warnings:
pad.c: In function `Perl_intro_my':
pad.c:878: warning: unknown conversion type character `_' in format
pad.c:878: warning: long unsigned int format, pointer arg (arg 4)
pad.c:878: warning: too many arguments for format

I'm not quite sure why, since PerlIO_printf does not map to a system
library call for this build; however, it would do so in some other
perlsdio.h:#define PerlIO_printf                        PerlSIO_printf
perlsfio.h:#define PerlIO_printf                        sfprintf
iperlsys.h: #define PerlSIO_printf            Perl_fprintf_nocontext
iperlsys.h: #define PerlSIO_printf                    fprintf
perlsdio.h: #define PerlIO_printf                     PerlSIO_printf
.. and I'm not sure what would happen in those situations.

I've applied the patch without those three fragments as #18456.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About