On Sun, Oct 28, 2007 at 10:07:59PM +0000, Mark Scott wrote: > I have a home-built radio clock receiver for the DCF77 time signal > that has been working fine for a year while attached to an i386 > machine. I moved it to an amd64 machine and find that radioclkd > segfaults when decoding the DCF77 signal.
radioclkd tries a binary chop across the full range of time_t, starting with the middle value that the type can hold. Unfortunately, gmtime() doesn't like handing the value 0x4000000000000000 What happens if you add the following line at line 213 in radioclkd.c? /* calculate the number of magnitude bits in a time_t */ for (bits=0,timep=1;timep>0;bits++,timep<<=1) ; + if (bits > 48) bits = 48; /* if time_t is signed, 0 is the median value else 1<<bits is median */ timep = (timep<0) ? 0 : ((time_t) 1<<bits); This limits the range of time_t values to years 1970 to 8921556. If we're still using longwave radio clocks in eight million years time, we've got major problems. -- Paul Martin <[EMAIL PROTECTED]> -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]