summaryrefslogtreecommitdiff
path: root/pp_hot.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 /pp_hot.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 'pp_hot.c')
-rw-r--r--pp_hot.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/pp_hot.c b/pp_hot.c
index de0434e0f7..dbea9bddca 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -164,8 +164,21 @@ PP(pp_concat)
s = SvPV_force(TARG, len);
}
s = SvPV(right,len);
- if (SvOK(TARG))
+ if (SvOK(TARG)) {
+#if defined(PERL_Y2KWARN)
+ if ((SvIOK(right) || SvNOK(right)) && ckWARN(WARN_MISC)) {
+ STRLEN n;
+ char *s = SvPV(TARG,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: %s",
+ "about to append an integer to '19'");
+ }
+ }
+#endif
sv_catpvn(TARG,s,len);
+ }
else
sv_setpvn(TARG,s,len); /* suppress warning */
SETTARG;