From 6bc102ca57c5133ccb41282f9b318b89d8ec7a82 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Mon, 13 Sep 1999 03:03:57 +0000 Subject: add -DPERL_Y2KWARN build option that will generate additional warnings on "19$yy" etc (reworked a patch suggested by Ulrich Pfeifer ) p4raw-id: //depot/perl@4132 --- sv.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'sv.c') 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; -- cgit v1.2.1