On Mon, Sep 1, 2008 at 2:11 AM, James Youngman <[EMAIL PROTECTED]> wrote: > On Sun, Aug 24, 2008 at 12:01 AM, Andreas Schwab <[EMAIL PROTECTED]> wrote: >> A good compiler (like gcc 4.3) will optimize this to 0, effectively >> removing the overflow check. Checking for overflow after the fact is >> not possible in C. > > I'd welcome an alternative patch for the subtraction operation.
Well, in the absence of an alternative patch I propose to go with the one attached to the bug (after correcting the bug number). Making a patch which never overflows is nontrivial anyway, since the C standard leaves unspecified whether time_t is signed or not, and provides no macro specifying its maximum and minimum values (partly because, I assume, the implementation is not guaranteed to be able to correctly handle them). James.
