From: Robin Barker Date: Tue, 11 Jan 2005 15:48:49 +0000 (+0000) Subject: follow-up to 23767 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=57f5baf2d376469520fedfc328fdf51d005eafe3;p=p5sagit%2Fp5-mst-13.2.git follow-up to 23767 Message-ID: <533D273D4014D411AB1D00062938C4D90849C56A@hotel.npl.co.uk> p4raw-id: //depot/perl@23781 --- diff --git a/Porting/pumpkin.pod b/Porting/pumpkin.pod index b2e2c2e..ff1e5bd 100644 --- a/Porting/pumpkin.pod +++ b/Porting/pumpkin.pod @@ -719,37 +719,32 @@ If you have gcc, you can test the correct use of printf-style arguments. Run C with S<-Dccflags='-DCHECK_FORMAT -Wformat'> (and S<-Dcc=gcc>, if you are not on a system where C is C) and run C. The compiler will produce warnings of -incorrect use of format arguments. CHECK_FORMAT changes perl-defined -formats to common formats, so DO NOT USE the executable produced by -this process. +incorrect use of format arguments. -A more accurate approach is the following commands: +As of change 23767, CHECK_FORMAT changes perl-defined formats +to obscure (but standard) formats, and then traps the obscure +format. The resulting perl executable operates properly but +you should not use the executable produced by this process. =over 4 =item * - -build miniperl with -DCHECK_FORMAT - - make clean - make miniperl OPTIMIZE=-DCHECK_FORMAT >& mini.log - -=item * - -build a clean miniperl, -and build everything else from that with -DCHECK_FORMAT + +A more accurate approach is the following commands: make clean - make miniperl make all OPTIMIZE='-DCHECK_FORMAT -Wformat' >& make.log - + perl -nwe 'print if /^\S+:/ and not /^make\b/' make.log + =item * -clean up, and print warnings from the log files +A more thorough approach to compiler warnings is make clean - perl -nwe 'print if /^\S+:/ and not /^make\b/' \ - mini.log make.log + make miniperl OPTIMIZE=-O\ -DCHECK_FORMAT >& make.log + make all OPTIMIZE=-O\ -DCHECK_FORMAT\ -Wall\ -Wno-unused\ + -Wno-uninitialized >>& make.log + perl -nwe 'print if /^\S+:/ and not /^make\b/' make.log =back diff --git a/sv.c b/sv.c index 6fc5588..470d483 100644 --- a/sv.c +++ b/sv.c @@ -9615,14 +9615,16 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV #ifdef CHECK_FORMAT if (left) { left = FALSE; - if (width > 0) { + if (!width) + goto format_sv; /* %-p -> %_ */ + if (vectorize) { width = 0; - if (vectorize) - goto format_d; - precis = width; - has_precis = TRUE; + goto format_d; /* %-1p -> %vd */ } - goto format_sv; + precis = width; + has_precis = TRUE; + width = 0; + goto format_sv; /* %-Np -> %.N_ */ } #endif if (alt || vectorize)