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 /sv.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 'sv.c')
-rw-r--r-- | sv.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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; |