From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,5e0ef8d936a38c44 X-Google-Attributes: gidf7344,public X-Google-Thread: fc89c,5e0ef8d936a38c44 X-Google-Attributes: gidfc89c,public X-Google-Thread: 1014db,5e0ef8d936a38c44 X-Google-Attributes: gid1014db,public X-Google-Thread: f86b3,5e0ef8d936a38c44 X-Google-Attributes: gidf86b3,public X-Google-Thread: fc7fa,5e0ef8d936a38c44 X-Google-Attributes: gidfc7fa,public From: "Arne Vajh�j" Subject: Re: What do you look for in C/C++ source? tm_year? Date: 1997/09/04 Message-ID: <340E66E5.87647499@cri.dk>#1/1 X-Deja-AN: 270288633 References: <340C34A2.FD0EE69F@bellsouth.net.no_spam> To: dmeans@bellsouth.net Organization: A poorly-installed InterNetNews site Newsgroups: comp.software.year-2000,comp.unix.programmer,comp.os.vms,comp.sys.vms,comp.lang.c David Means wrote: > If you're greping through 1000's of lines of ( C/C++ ) code for date related > bugs, what do you look for? My first assumption is to find tm_year. > > What other stuff do you look for? It is matter of how sure you want to be: 1) Search for year and f.ex. a dozen other suspect strings and inspect the found locations manually. You will find most problem spots. 2) Inspect all code modules using time manually. You wil find almost all problem spots. 3) Inspect everything manually. You wil find everything (assuming actually done carefully). So grep'ing is taking a chance, but if your cost-benefit analysis says, that is the way to go, then ... Other good strings to search for that come to my mind is: gmtime,localtime,asciitime,ctime,strftime. But ask your programmers what they usually use for year, if they often use f.ex. yy, then add that to the list. Arne