summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Porting/pumpkin.pod33
-rw-r--r--sv.c14
2 files changed, 22 insertions, 25 deletions
diff --git a/Porting/pumpkin.pod b/Porting/pumpkin.pod
index b2e2c2ef6e..ff1e5bd5f9 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<Configure> with S<-Dccflags='-DCHECK_FORMAT
-Wformat'> (and S<-Dcc=gcc>, if you are not on a system where C<cc>
is C<gcc>) and run C<make>. 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 6fc5588b83..470d483f64 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)