[tz] [PROPOSED] Remove old Y2K code

Clive D.W. Feather clive at davros.org
Tue Jun 13 19:59:57 UTC 2017


Jonathan Lennox said:
> Since DEPRECATE_TWO_DIGIT_YEARS is used in an if statement, shouldn't this
> be -DDEPRECATE_TWO_DIGIT_YEARS=true ?  Otherwise it expands to
>     if ( && warn != IN_NONE ...
> 
> which obviously won't compile.

Better is to have, in the code:

#ifdef DEPRECATE_TWO_DIGIT_YEARS
#undef DEPRECATE_TWO_DIGIT_YEARS
#define DEPRECATE_TWO_DIGIT_YEARS true
#else
#define DEPRECATE_TWO_DIGIT_YEARS false
#endif

so that it can't be misdefined.

-- 
Clive D.W. Feather          | If you lie to the compiler,
Email: clive at davros.org     | it will get its revenge.
Web: http://www.davros.org  |   - Henry Spencer
Mobile: +44 7973 377646


More information about the tz mailing list