From: B.Gilli/G.Filippi Date: 11 Nov 1999 VLT-SW-OCT99 - Y2000 PORTABILITY GUIDELINES =========================================== The following is a brief check list on how to make an application Year2000 compliant. A more complete discussion about Y2K compliance can be found in the VLT-TRE-ESO-17210-1704, issue 1.1, "Technical Report on YEAR 2000 compliance, Guidelines for VLT Control Software", (available from patchedFiles/y2k_tre1.1.ps). 1) Identify places for potential problems: ========================================= Wherever time and date is accessed or manipulated, there is a potential problem. A list of known potentially dangerous patterns (file "compat.Y2000.config") to be used by the standard compat utility that searches in SOURCE files See compat(7) man-page for how to use the utility on your application code. Applicable to both SUN & HP. 2) Check for necessary changes: ============================== For every identified potential problem, inspect the code and decide on a case basis if changes are required. The basic rule is to avoid any ambiguity that could produce future mis-interpretation, and remove usage of obsolete features. If possible, usage of obsolescent features should also be avoided. The following is a list of known cases: * STRUCTURES ------------ - The usage of struct tm, field tm_year is potentially dangerous. Use ccsTIMEVAL structures for LCC/CCS based applications or at least 32-bit signed or better unsigned time_t types. This will insure proper behavior until year 2038. (64 bits will be necessary later on!) - Two digit year representation: yy-mm-dd is forbidden. Always use ISO 8601 standard: ccyy-mm-dd with the 4 digits format to express the year in all ASCII representation of a date. * FUNCTIONS ----------- - strptime() and getdate() shall be avoided, in particular without the format specifier %Y(capital). Rather use CCS/tims functions with the following restrictions: . timsTimeToString(3) is not compliant, is now obsolete and replaced by timsTimeToIsoString(3) . timsStringToTime(3) is not compliant, is now obsolete, and replaced by timsIsoStringToTime(3) * SCRIPTS & SYSTEM COMMANDS --------------------------- - date command: avoid the %y (lowercase) specifier. Rather use the %Y(uppercase) one. - troff scripts avoid formatting with \n(yr as yr will be a 2 digit year. - clock format command for Tcl: avoid %y(lowercase) specifier. Use only %Y(uppercase). pay attention to the usage of the following commands: - date should have been upgraded to accept optional century digits (%Y specifier accepted). - prs,get will never accept century digits. They will rather use the rule that years in the range [69-99] refer to twentieth century while values within [00-68]refer to twenty-first one. - touch is presently not always able to handle -t option with dates later than midnight January 1 2000 should be upgraded with OS patches. 3) Remove obsolescent VLTSW functions. ====================================== Some VLTSW functions have been declared obsolescent in FEB99, and are removed in the OCT99 version. Existing applications should replace such functions with the proper new ones. 4) test the modified applications & redeploy it. =============================================== The proper behavior of the application should be tested, including identification of possible backwards incompatibilities. The critical dates to be tested are: rollover from 31/12/1999 to 1/1/2000 rollover from 28/2/2000 to 29/2/2000 and next one to 1/3/2000 (Year 2000 is a leap year) A complete report on the Y2K tests done at ESO for the VLT Common Sw is posted on the web: http://www.eso.org/projects/vlt/sw-dev/control-model/index.html ____oOo____