bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug #23996] arithmetic overflow when using -used


From: James Youngman
Subject: Re: [bug #23996] arithmetic overflow when using -used
Date: Sun, 7 Sep 2008 14:48:05 +0100

On Mon, Sep 1, 2008 at 2:11 AM, James Youngman <address@hidden> wrote:
> On Sun, Aug 24, 2008 at 12:01 AM, Andreas Schwab <address@hidden> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]