ckWARNreg() and ckWARNregdep() now use string concatenation, like their brethren
Nicholas Clark [Mon, 12 Oct 2009 17:48:38 +0000 (18:48 +0100)]
They had been concatenating "%s" REPORT_LOCATION, as they weren't passing in a
format string, which wasn't consistent with the 2-5 argument versions. None of
the strings passed in have % characters in them, so this is safe (and any static
analyser will be able to see this).

regcomp.c

index 148c88a..0f5f81d 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -477,15 +477,15 @@ static const scan_data_t zero_scan_data =
 
 #define        ckWARNreg(loc,m) STMT_START {                                   \
     const IV offset = loc - RExC_precomp;                              \
-    Perl_ck_warner(aTHX_ packWARN(WARN_REGEXP), "%s" REPORT_LOCATION,  \
-           m, (int)offset, RExC_precomp, RExC_precomp + offset);       \
+    Perl_ck_warner(aTHX_ packWARN(WARN_REGEXP), m REPORT_LOCATION,     \
+           (int)offset, RExC_precomp, RExC_precomp + offset);          \
 } STMT_END
 
 #define        ckWARNregdep(loc,m) STMT_START {                                \
     const IV offset = loc - RExC_precomp;                              \
     Perl_ck_warner(aTHX_ packWARN2(WARN_DEPRECATED, WARN_REGEXP),      \
-           "%s" REPORT_LOCATION,                                       \
-           m, (int)offset, RExC_precomp, RExC_precomp + offset);       \
+           m REPORT_LOCATION,                                          \
+           (int)offset, RExC_precomp, RExC_precomp + offset);          \
 } STMT_END
 
 #define        ckWARN2reg(loc, m, a1) STMT_START {                             \