diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-09-13 03:03:57 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-09-13 03:03:57 +0000 |
commit | 6bc102ca57c5133ccb41282f9b318b89d8ec7a82 (patch) | |
tree | f2865fee6aba38a706931f32bbe5954a66904917 /pp_hot.c | |
parent | 3e92a2540996678c49663ee454dadc7970cdb925 (diff) | |
download | perl-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.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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; |