However, as time passes, sometimes you don't remember to search for all the "fixme"s and these can creep into production builds.
A simple hack is to put time bombs in your code that refuse to compile after a certain time has elapsed, ie like 2 weeks.
In your prebuild hook, write something that writes a time stamp to a header file, like this:
#! c:/perl/bin/perl
use POSIX;
open F,">buildtime.h" or die;
print F POSIX::strftime(qq{#define BUILDTIME %Y%m%d\n},localtime);
Then in your code, put in hooks like this:
#include "buildtime.h"
#if BUILDTIME > 20090125
#error Fix this bug
#endif
where the time stamp is simply the concatenation of year, month and day (YYYYMMDD), in that order to get the greater-than comparison to work. In my example, the code will refuse to build after Jan 25, 2009.
No comments:
Post a Comment