summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-09-13 03:03:57 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-09-13 03:03:57 +0000
commit6bc102ca57c5133ccb41282f9b318b89d8ec7a82 (patch)
treef2865fee6aba38a706931f32bbe5954a66904917 /sv.c
parent3e92a2540996678c49663ee454dadc7970cdb925 (diff)
downloadperl-6bc102ca57c5133ccb41282f9b318b89d8ec7a82.tar.gz
add -DPERL_Y2KWARN build option that will generate additional
warnings on "19$yy" etc (reworked a patch suggested by Ulrich Pfeifer <upf@de.uu.net>) p4raw-id: //depot/perl@4132
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index acded3146d..b21c9edf43 100644
--- a/sv.c
+++ b/sv.c
@@ -5037,6 +5037,19 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
*--eptr = '0';
break;
default: /* it had better be ten or less */
+#if defined(PERL_Y2KWARN)
+ if (ckWARN(WARN_MISC)) {
+ STRLEN n;
+ char *s = SvPV(sv,n);
+ if (n >= 2 && s[n-2] == '1' && s[n-1] == '9'
+ && (n == 2 || !isDIGIT(s[n-3])))
+ {
+ Perl_warner(aTHX_ WARN_MISC,
+ "Possible Y2K bug: %%%c %s",
+ c, "format string following '19'");
+ }
+ }
+#endif
do {
dig = uv % base;
*--eptr = '0' + dig;